Skip to content

Instantly share code, notes, and snippets.

@a-chernykh
Created July 20, 2012 12:19
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save a-chernykh/3150439 to your computer and use it in GitHub Desktop.
Save a-chernykh/3150439 to your computer and use it in GitHub Desktop.
Easy way to edit configuration file with Chef
add_line = "config statement"
bash "add_to_config" do
code <<-EOH
grep '#{add_line}' /etc/config || echo '#{add_line}' >> /etc/config
EOH
end
@msnaresh
Copy link

Helo Andrey,

I'm new to Chef tool, recently we have deployed new RHEL 7 VMs in Azure cloud at the same time working with RHEL 7 is also a new experience for me. My doubt is when I'm doing modifications to sysctl.conf or ifcfg-eth0 or rsyslog.conf configuration files, those modifications are existing only for couple of hours, later again those files are reverting to its original format. What ever modifications I do are not reflecting. Our on-site engineer has configured CHEF in our environment and what ever modifications I'm doing is on chef client. I don't know how to work with Chef. All I want to know is that CHEF that restricting the modification of config files? if yes then can you help me how to edit my configuration files to reflect the changes permanently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment