amazon web services - Chef Recipe to set hostname of an EC2 instance AWS -


i want write chef recipe set hostname of ec2 instance :

awsregioninstancetyperandomno 

like awsedev001

how can in chef recipe? have recipe ?

please help

how in regular unix land?

you first add full fqdn /etc/hostname persistence:

file '/etc/hostname'   content 'hostname.example.com' end 

then set hostname running os:

execute 'hostname hostname.example.com'   not_if 'hostname -eq "hostname.example.com"' end 

this simple chef recipe example, can made more complex suit needs. may want @ hostname cookbook on chef community site.


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -