Created
July 20, 2012 12:19
-
-
Save a-chernykh/3150439 to your computer and use it in GitHub Desktop.
Easy way to edit configuration file with Chef
This file contains hidden or 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
add_line = "config statement" | |
bash "add_to_config" do | |
code <<-EOH | |
grep '#{add_line}' /etc/config || echo '#{add_line}' >> /etc/config | |
EOH | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.