not like that. i think you'd need to use a shell variable in there like:
but that may not work if the property evaluation happens before the shell expansion.
why not use property instances for each location ?
you'd have a custom class w/ whatever properties you want. in the server class you have a pointer property to this class. make a property instance for each location and then set whatever property values you need for that instance (location). set the value of the pointer property for each server to the appropriate location (property instance).
Thanks Bill thats really helpful. I am only a few days into using this tool and have had no training. Your solution sounds exactly what I need to be doing. I just need to work out how to do those things. I was this morning looking at the smart groups and whether I could set a property in the smart group that I could then reference from my script.
?what are you actually trying to do w/ the properties ? set a dns server based on location ? run some command w/ input based on the location ?
Its really basic. The client I'm working for has 2 data center locations. Each location has different DNS lookup host IP addresses. I wanted to create a single script that would update /etc/resolv.conf on AIX. There is a variable called _DATA_CENTER that gets populated with the location when the host is loaded into BSA but I was hoping to be a little more eloquent than hard coding tests for the location name in my script.
Thanks again Bill. I've created a component template as I dont have authority to access the Property Dictionary. My next question is how to access the content of my template from my AIX script. I need to read through the article a few more times but feel free to fast track me !! I do appreciate your time thank you again
well, if you follow the doc then you don't need a script. you'd deploy the /etc/resolv.conf as a 'config file' and you'd setup the blpackage to reference the nameservers you need based on the property instance's property value for the name server.
if you want to use a nsh script then i think you can either pass in the property reference - ??TARGET.POINTER.DNS1?? (or whatever) in as a parameter to the nsh script or you can make a blcli call in the script to get that property value.
Hi Bill, I think the missing link for me is the POINTER. I've setup a component template and a property that has instances called site1 and site2. I've run discovery and I can see a component for each location is associated to my AIX machine. My issue now is when I create a package containing a script to deploy to my host, how do I now refence the instance variable? I've tried TARGET._DATA_CENTER.DNS1. _DATA_CENTER is already set when the server is imported. This fails though saying that property _DATA_CENTER is a string enumeration. So its the POINTER bit I need to know how to setup I think. Hope you can help?
1 of 1 people found this helpful
so i have this custom property class w/ a bunch of properties in it:
(this is from the ootb compliance content we ship but it's still 'custom' for what we are talking about).
there's an instance w/ some values set for those properties:
in my BlPackage i create a local property that points to that class
i add an external command to reference one of the properties in the class:
in the deploy job i can choose the instance from that custom class to use during the job run. in this case the value of the property has nothing to do w/ the target system.
if you want to do it by server, you have a pointer in the server class like CIS AIX Properties:
that has some properties in it and has a couple instances defined.
in the blpackage in that case i would put:
if you click on the little hand w/ the arrow:
that will pull up a dialog to drill into the properties area.
then in this case on your server you would have CIS AIX Properties set to HIGH_LEVEL_POLICY or LOW_LEVEL_POLICY and when the deploy runs it would pick up the value of HISTEXPIRE for whatever instance i set on the server.
Thanks Bill. I wonder if I could try and explain what I have done and then get you to correct where I have gone wrong.
I've created a component template and in the local properties tab have created two instances. In each instance, I have different values for DNS_NAME_SERVER_1 and DNS_NAME_SERVER_2
In my Disconver tab I have this
??NAME?? = "XXXX_AIX_Location_Properties [??TARGET._DATA_CENTRE??] (??TARGET.NAME??)"
I run a discover job and this creates a component for each server based on its location. You can see above there is one server in Birmingham and two in Longbridge. So far great I think
I then create a BLPackage and add two location properties that match the names in the template instances.
The external command is a simple KSH script that issues a command, print "??DNS_NAME_SERVER_1??"
Finally I create a job to deploy the package.
In the package tab I change the assignment type of the two properties to get the values from the components.
However when I run the job, the script prints only the default value for ??DNS_NAME_SERVER_1?? which is blanks. It seems that the component instance values for my two properties are not overriding what I have set in the BLPackage.
Am I nearly there though?
Are you there Bill?
Maybe the robot named "Bill Robinson" is rebooting?
I heard a rumor Bill is offline, PTO on vacation! In the out-of-doors at that!
Maybe he's not really a robot???
So he may not have his normally razor sharp replies here until he returns...
Ah I think I’m over the finish line. The issue was with my deploy job. I was selecting servers to deploy against. I should have been selecting the components that had previously been discovered. As soon as i deploy to the discovered components, the DNS_NAME_SERVER_n properties are correctly resolving. Fantastic.
I'm here. I was not before because dan forgot to plug me back in...
is this working now ?