Created
December 17, 2012 21:09
-
-
Save srinivasmohan/4322280 to your computer and use it in GitHub Desktop.
Hosts.erb template for updhosts.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Last updated <%= Time.now.to_s %> by '<%= $0.split('/')[-1] %> <%= ARGV[0] %> <%= ARGV[1] %>' | |
127.0.0.1 localhost | |
<%= myip_ohai %> my_mgmt_host | |
#Static entries... | |
#... | |
#... | |
#The following are chef managed instances whose IPs are pulled from knife exec runs. | |
##All of the below are generated from template entry in /etc/hosts.erb | |
<% %w{server1 server2 server3}.sort.each do |thissvr| %> | |
<%= findremoteip(thissvr)+"\n" %> | |
<% end %> | |
##End of knife generated section | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See https://gist.github.com/4322269 for updhosts.rb