3ofcoins / chef-cookbook-hostname

Chef cookbook to set node's hostname and FQDN.
MIT License
41 stars 90 forks source link

Enable insert of HOSTNAME if non exists in sysconfig/network #33

Open philpoore opened 10 years ago

philpoore commented 10 years ago

Recipe fails when "HOSTNAME" is not found in "/etc/sysconfig/network" Due to this line file.search_file_replace_line('^HOSTNAME', "HOSTNAME=#{fqdn}") https://github.com/3ofcoins/chef-cookbook-hostname/blob/develop/recipes/default.rb#L64

is it possible to "search + replace" or "insert" if that fails...?