Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 9th, 2012  |  syntax: None  |  size: 0.58 KB  |  hits: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/usr/bin/env ruby
  2.  
  3. require '/usr/local/cft/contextclient/lib/utils/c3_utils.rb'
  4.  
  5. # get the user-data from the etc/cloudinit.d/code/user-data
  6. # this is magic behavior which should be formalized
  7.  
  8. # cat it into the environment
  9. #testing this in firstboot env only - why did I not have it there?
  10. # can't use for now because gets deleted every client run - blechhh!. /etc/cloudinit.d/params.txt
  11. my_properties = C3Utils.load_properties("/usr/local/cft/contextclient/manager-data")
  12.  
  13. system("bin/hostname #{my_properties['hostname']}")
  14. # end of test - might need on re-boot, can't image why...