3 Replies Latest reply on Oct 15, 2012 10:49 AM by Brandi Dean

    populate /etc/hosts with both short name and fqdn

    Brandi Dean

      Can anyone tell me how to provision a server and populate both the short name and fqdn hostname into the /etc/hosts file.  I have tried putting settings in post-install configuration, and it seems to be getting overwritten by BladeLogic when the job is created. 


      In the kickstart entries tab of the system package, there is:

      echo ??DEVICE.IP_ADDRESS?? ??DEVICE.FQDN?? >> /etc/hosts

      echo "echo ??DEVICE.IP_ADDRESS?? ??DEVICE.IP_ADDRESS?? ??DEVICE.FQDN?? ??DEVICE.SHORTNAME?? >> /etc/hosts" >> /root/provscript


      the first echo is what is coming from Bladelogic, and the second echo is what is coming from the Post-Install Configuration tab, which I put in.  All this manages to do is create two entries for the ip address in the hosts file     hosta  <---Put there by BL     hosta.domain.com     hosta  <--put there by BL via /root/provscript


      This is not what I want, I only want the entry that has both short and long host name. 


      I have defined the variables above under DEVICE in property dictionary then I input correct info when I create the Device in BL.   The package uses these variables so that I dont have to define them in the job. 


      I have to imagine someone has encountered this before. I know I can create a package to modify it after the server is provisioned, but I would like to do it at provisioning time.


      I've done various things to try to get this to work, to no avail, so any suggestions would be appreciated.