7 Replies Latest reply on Sep 19, 2012 12:05 PM by Mike Reider

    using Custom Property dictionary parameters in BLPackage

    Mike Reider

      Hi all, I am a bit confused on how to pass parameters based on custom property dictionary values

       

      I am trying to automate an Oracle agent install using BSA 8.2

       

      in teh BLPackage, I have my ext. cmd,

       

      sh oracle_installer.sh <DIR> <VER>

       

      lets day for <DIR> and <VER> I want to provide specific values based on custom prop dictionary values

       

      I created a new class property class called Software Install, created a new Property to this custom class called ORACLE_DIR and added a value to this , lets say "/opt/oracle"

       

      01.gif

       

       

      How can I pass this parameter in the blpackage using something like this? This custom parameter doesnt show up in teh built in objects drop down, and if I set this ORACLE_DIR value instead of Simple - String to Property class - Server (so it shows up from the Target dropdown in the Blpackage), I cant add the specific value for the directory path, its grayed out.

       

      02.gif

       

      I basically want to be able to do this in teh blpackage:

       

      sh oracle_installer.sh -d ??TARGET.ORACLE_DIR?? 

        • 1. Re: using Custom Property dictionary parameters in BLPackage

          I think you are doing it the wrong way.

           

          There are two ways to do this

          1. Add oracle dir and ver to the built in server property class and then use that with TARGET.DIR

           

          Or

           

          2. Use your custom ORACLE property class in the BLPackage by going to the property tab. Add a new property and mark it as property class = "your Oracle class". Now when you creat your CMD you should be able to see ORACLE.DIR in the drop down.

           

          Does it makes sense? I dont have a system in front of me so no screenshots.

          • 2. Re: using Custom Property dictionary parameters in BLPackage
            Mike Reider

            Hi, thanks for replying,

             

            the 1st option isnt too useful because I have about 30 env. variables I want to add, things like JYTHON_DIR, APACHE_VER, ORACLE_CLIENT_VER, etc etc

             

            putting all that into Server class is a bit messy, I wanted to create a custom class for the customer so they can manage it.

             

            For 2nd option, I know I can add local properties to the particular BLpackage, but I wanted to add global variables that I can reference in any BLpackage. This is a local option only.

            • 3. Re: using Custom Property dictionary parameters in BLPackage

              This is what I was thinking. MAybe there are other ways as well

               

              I have created the same Custom Property Class as you did: "Software Deployment"

               

              Option 1.

              Link "Software Deployment" to the SERVER property class so that I can use ??TARGET.SOFTWARE_DEPLOYMENT.??... in any package.

              ScreenHunter_26 Sep. 19 16.47.jpg

               

              Option 2.

              Link "Software Deployment" as a Local Property on every BLPackage that needs to use it.

              ScreenHunter_25 Sep. 19 16.45.jpg

               

              Access the parameter in two diffent ways depending on option 1 or 2.

              ScreenHunter_24 Sep. 19 16.44.jpg

              • 4. Re: using Custom Property dictionary parameters in BLPackage
                Mike Reider

                thats it! I went with option 2, created a Local Property called Software Install - linked to my custom Property class "Software_Install"

                 

                then in the BLpackage, the drop down shows Software Install > with all the related custom variables.

                 

                the blpacakge looks like this,

                 

                 

                cd ??Software_Install.TEMP_DIR??

                sh install.sh -d ??Software_Install.ORACLE_INSTALL_DIR??

                 

                 

                thanks for the assist, all my custom env. vars are in 1 custom class. I didnt understand how to use these vars properly.

                • 5. Re: using Custom Property dictionary parameters in BLPackage
                  Mike Reider

                  noticing a problem w this now,

                   

                  I tried option 1, adding a property to Server class that references the custom Software_Install class, added a parameter to this Software_install class called LOG_DIR with a string value of /opt/log

                   

                  trying to run my blpackage cmd like this to test whether teh value is getting passed,

                   

                  echo ??TARGET.Software_Install.LOG_DIR?? >> /tmp/logtest.txt

                   

                  no value gets passed via that call, the txt file is empty. It doesn seem to pass on the value, I tried it with option 1 and option 2 and no value gets passed.

                  • 6. Re: using Custom Property dictionary parameters in BLPackage

                    You need to create an instance of your custom property class Software Install. Goto your custom property class and select the knstance tab and hit the green plus sign. Give it a name and assign values if different from deault values. Now go back to your package and you will have to options.

                     

                    Assign a defailt value to you SOFTWARE_INSTALL property and point it to the instance you created in step one.

                     

                    You can also mark it as Required in which case it will appear in the deploymEnt job under the package where you can assign it a new value.

                     

                    The benefit with this is that you can have multiple jobs deploying the same package to different environments where all use different values for the SW Install property. 

                    • 7. Re: using Custom Property dictionary parameters in BLPackage
                      Mike Reider

                      Just realized I didnt have an instance, thanks for the reminder. Its working properly now!