We will make a change top the php.ini file and ensure chef updates all nodes next time a configuration run is performed.

Copy /etc/php.ini from a node to ~/cookbooks/php/files/default

Then make a change, e.g. add a line to the php.ini file

[PHP]

:: php.ini managed by chef

etc

 

$ cd ~/cookbooks/php/recipes/

$ vi default.rb

package “php” do

action :install

end

 

cookbook_file “/etc/php.ini” do

source “php.ini”

mode “0644”

end

 

$ knife cookbook upload php

NODE

====

$ chef-client

Old file is saved as /var/chef/backup/etc/php.ini.chef-date.nnnn