14 Replies Latest reply on May 9, 2012 1:08 PM by Sean Berry

    simple search and replace

      Hi all -


      After a file asset has been laid down on a system, I would like to use bladelogic to search/replace tokens or expand properties inside some of the configuration files.


      In terms of BL, what is this called/how is this done?


      I've read through the documentation several times now.  I guess I'm looking for resources and databags in chef speak.


      Does this even exist?

        • 1. Re: simple search and replace
          Bill Robinson

          You should add the file as a ‘config file’ using the appropriate grammar file.


          Then you can deploy the file or even just one or two entries in the file.

          • 2. simple search and replace

            are there documented steps somewhere about how to do this?  Again - I'm trying to do things once manually then I want to do everything programattically....

            • 3. Re: simple search and replace
              Bill Robinson

              There should be a section in the doc about how to create a config file object.


              Then right click on the config file in live browse or on a particular entry and choose ‘add to depot as blpackage’.  Edit the things you want to change and deploy it.

              • 4. simple search and replace

                So the software needs to be installed once for this to work?


                That's a bit chicken-and-egg-y?

                • 5. Re: simple search and replace
                  Bill Robinson

                  I typically make sure that my silent install instructions and such work outside of blade on a dev or test system, then I get it into blade.  so during the course of that work I can create all the objects I need in blade.  though it would be nice to create arbitrary CFOs and such on the file in a blpackage w/o having to pull the container from a system.

                  • 6. simple search and replace

                    So if my zip file that I'm deploying contains configuration, how do I make sure that those configuration files are correctly managed?


                    Seems like BL just wants to lay down what it knew last for a given file!


                    Between the clunky interface and switching between 5 roles, I'm getting ready to just throw in the towel...

                    • 7. Re: simple search and replace
                      Bill Robinson

                      The role setup is really determined by your organization and how the separation of duties has been defined in the tool.  If you have issue w/ the role setup I would really take it up w/ whoever designed the RBAC structure in your environment.  Some of our customers have hundreds of roles and some have only a handful, it is all up to the customer to decide what will best model their workflow and current permission structure.


                      So how does your deploy work?

                      You will extract the zip file into a directory on your target server.  then inside that zip file are a number of configuration files that you want to modify entries in, after the files are put in place, that are specific to that host?

                      What are you deploying?  is this application code for an appserver (war,ear,etc)?, an actual application install?

                      • 8. simple search and replace

                        It's several things honestly, but they all distill to a common theme, one zip, some binaries and a set of config files.


                        I think it's always a good idea to keep config seperately, but just searching the BL userguide for "configuration files" results in 10 tillion things and nothing seems to be an exact match.


                        That's another great question...


                        I think in general configuration should be broken up by environment, application and finally machine (with other layering in there and with machine specific configuration takeing precedence over everything else).  I'm not even sure where to PUT this type of configuration right now within bladelogic....

                        • 9. simple search and replace
                          Joe Piotrowski

                          As Bill said, anything you can do outside of BBSA you can do within BBSA. If you have a process (a script for example) that you currently use to perform this action, you can easily run that script within BBSA.


                          However, one of the powerful features of BBSA is that we break down server into parts. You can think of them as objects. If you Live Browse a server, everything you see is essentially a BBSA part or object. If you expand the Configuration domain, you will see a list Configuration Files that BBSA looks for out of the box.


                          A Configuration File is a type of BBSA object. It parses the file (depending on it's type) and breaks it into Name > Value1 > Value2 > etc format. Until you create that Configuration File type, BBSA won't know what it is or how to parse it.


                          Bill is suggesting that the easiest way in BBSA to handle what you're trying to do is to leverage Configuration Files. Unfortunately our offline and online documentation is more technical information than training. So you're stuck with taking a BBSA class or asking for help here.


                          If you are much more specific about what you're trying to accomplish we can be of more help. With more information we can walk you through the process of building a package, deploying your package and/or modifying your configuration file before or after the fact. But your requirements are vague.

                          • 10. simple search and replace

                            Hmmm - after all this fighting with bladelogic, I'm off and running with a chef proof of concept.  In 24 hours not only did I get the server installed but I'm deploying software.  I'm ahead of where I was with bladelogic in a fraction of the time.


                            Look - the question was simple, not vague - a file that is tokenized is placed on the system. How do you expand those tokens?


                            In the end, I guess it doesnt matter - my goal now is to proof out chef an move away from blade logic.


                            Some of my posts here have 200+ views but only a handful of responses (most mine bumping the thread and adding statuses). Are people even using this?  When you buy bladelogic, do you have to hire consultants?


                            Seriously frustrated....

                            • 11. simple search and replace
                              Bill Robinson

                              Can you provide a little background on your env - you are using BSA as a POC or have it live in your environment and are trying a new use case? BecauseI think you would be better served by using the BARA tool (https://docs.bmc.com/docs/display/ara82/Home)  (which is part of the 'BladeLogic' suite) instead of straight up BSA.  BSA is a server configuration management tool.  It can do application deployment and we have many customers that use it for that but BARA is designed to specifically handle middleware application code more along the lines of what I think you are expecting.


                              If I was going to do this w/ BSA:

                              • create a blpackage and put the zip file in there along w/ an external command to extract it. 
                                • per your other thread I’d make sure to push out zip if I’m pushing to windows or a powershell script to do it (why does windows not have a commandline unzip?) 
                              • create a config file object in the config file object dictionary. 
                                • I’d choose the appropriate grammar file to parse the name value pairs. 
                              • either add the whole file or the individual entries I want to change out to the blpackage. 
                              • create some local properties in the blpackage for the entries I wanted to swap out, put those in place of the actual values in the blpackage. 
                              • create a deploy job set the values I want to set and run the job. 


                              There are a few other ways to accomplish this in BSA that involves modeling the application in the property dictionary and with Component Templates, and there are ways to take into account needing to push to multiple servers and set different values per server, or multple instances of the same app on the same server. 


                              What compounds your use case w/ BSA is that these files don't exist beforehand on the target and for the config file method to really work BSA expects them to exist so we can add them or their parts to the blpackage and that is not what you have in your case.  I do think BSA could handle this better by letting you model the CFO entries you want directly in the blpackage w/o needing the file to exist somewhere to grab it from.


                              BSA adds a lot that is not obvious in use case you describe - the main one I can think of is Role Based Access Control.  You were able to stand something up w/ Chef and just do it, soup to nuts.  In many environments, that's not permitted.  There are package builders, dev deployers, test deployers, prod deployers, etc.  Every action gets tied to a change request, etc and all the actions are logged.  When I have played around w/ Chef and Puppet I have not found much in the way of RBAC. 


                              We are working to provide 'use case' documentation and we've developed some for BSA for OS Patching, OS Provisioning and Compliance already. 



                              1 of 1 people found this helpful
                              • 12. Re: simple search and replace

                                Not sure about puppet but chef turns the deployment medium on its head.


                                Not a proof of concept, Bladelogic is very much live.


                                You've summed it all up - war and zip and configuration.


                                It's all just totally foreign to me.  I guess I ten to automate then test then automate the next thing and test.  With BL, seems like you need to fully deploy once by hand then point a live view at some structure.


                                It's just never very clear until you've gone down a rabbit hole for half a day that it was the wrong thing to do.


                                In the end, playing around in the GUI is NOT how we will end up leveraging BL.  Everything will be Jenkins based and probably executing some blcli script - so yet another later of (frustrating) complexity.


                                Thanks so much for all the help but it seems that either I need to take this BL class or put all my energies into something else.

                                • 13. simple search and replace

                                  Sorry to hear you are having trouble, ecirmella. Have you reached out to our support to get some one-on-one help? We have a great support organization that can dig into your problem and figure out the best way to get you to your end-goal. I understand your reluctance to take a class, so maybe the next best thing is to get one of our automation experts on the phone with you.

                                  • 14. Re: simple search and replace
                                    Sean Berry



                                    Here's some great pointers to how to parameterize or tokenize a config file.  Let me know whether you can see these documents.


                                    https://docs.bmc.com/docs/display/ara82/Preparing+parameters+and+tokens+for+deployment (text: “parameterizing properties in files within an application archive”)



                                    https://docs.bmc.com/docs/display/ara82/Including+the+application+archive+in+the+deployment,  “If you want to tokenize properties within an application archive, extract the relevant files….”