Skip to content

Instantly share code, notes, and snippets.

@someara
Created December 28, 2012 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save someara/4400651 to your computer and use it in GitHub Desktop.
Save someara/4400651 to your computer and use it in GitHub Desktop.
template "/tmp/file1" do
action :create
# mode "00666"
notifies :create, 'template[/tmp/file2]'
end
template "/tmp/file2" do
action :nothing
notifies :run, 'execute[hack the planet]'
end
execute "hack the planet" do
command "/bin/echo HACK THE PLANET"
action :nothing
end
@someara
Copy link
Author

someara commented Dec 28, 2012

[2012-12-28T19:02:09+00:00] INFO: Processing template[/tmp/file1] action create (scratch::default line 10)
[2012-12-28T19:02:09+00:00] INFO: template[/tmp/file1] backed up to /var/chef/backup/tmp/file1.chef-20121228190209
[2012-12-28T19:02:09+00:00] INFO: template[/tmp/file1] updated content
[2012-12-28T19:02:09+00:00] INFO: template[/tmp/file1] owner changed to 0
[2012-12-28T19:02:09+00:00] INFO: template[/tmp/file1] group changed to 0
[2012-12-28T19:02:09+00:00] INFO: template[/tmp/file1] mode changed to 664
[2012-12-28T19:02:09+00:00] INFO: Processing template[/tmp/file2] action nothing (scratch::default line 16)
[2012-12-28T19:02:09+00:00] INFO: Processing execute[hack the planet] action nothing (scratch::default line 39)
[2012-12-28T19:02:09+00:00] INFO: template[/tmp/file1] sending create action to template/tmp/file2
[2012-12-28T19:02:09+00:00] INFO: Processing template[/tmp/file2] action create (scratch::default line 16)
[2012-12-28T19:02:09+00:00] INFO: template[/tmp/file2] backed up to /var/chef/backup/tmp/file2.chef-20121228190209
[2012-12-28T19:02:09+00:00] INFO: template[/tmp/file2] updated content
[2012-12-28T19:02:09+00:00] INFO: template[/tmp/file2] owner changed to 0
[2012-12-28T19:02:09+00:00] INFO: template[/tmp/file2] group changed to 0
[2012-12-28T19:02:09+00:00] INFO: template[/tmp/file2] mode changed to 600
[2012-12-28T19:02:09+00:00] INFO: template[/tmp/file2] sending run action to executehack the planet
[2012-12-28T19:02:09+00:00] INFO: Processing execute[hack the planet] action run (scratch::default line 39)
[2012-12-28T19:02:09+00:00] INFO: execute[hack the planet] ran successfully
[2012-12-28T19:02:09+00:00] INFO: Chef Run complete in 0.259749637 seconds
[2012-12-28T19:02:09+00:00] INFO: Running report handlers
[2012-12-28T19:02:09+00:00] INFO: Report handlers complete

@someara
Copy link
Author

someara commented Dec 28, 2012

When changing just the perms

[2012-12-28T19:02:26+00:00] INFO: *** Chef 10.16.2 ***
[2012-12-28T19:02:27+00:00] INFO: Setting the run_list to ["recipe[scratch::default]"] from JSON
[2012-12-28T19:02:27+00:00] INFO: Run List is [recipe[scratch::default]]
[2012-12-28T19:02:27+00:00] INFO: Run List expands to [scratch::default]
[2012-12-28T19:02:27+00:00] INFO: Starting Chef Run for scratch-berkshelf
[2012-12-28T19:02:27+00:00] INFO: Running start handlers
[2012-12-28T19:02:27+00:00] INFO: Start handlers complete.
[2012-12-28T19:02:27+00:00] INFO: Processing template[/tmp/file1] action create (scratch::default line 10)
[2012-12-28T19:02:27+00:00] INFO: template[/tmp/file1] mode changed to 666
[2012-12-28T19:02:27+00:00] INFO: Processing template[/tmp/file2] action nothing (scratch::default line 16)
[2012-12-28T19:02:27+00:00] INFO: Processing execute[hack the planet] action nothing (scratch::default line 39)
[2012-12-28T19:02:27+00:00] INFO: template[/tmp/file1] sending create action to template/tmp/file2
[2012-12-28T19:02:27+00:00] INFO: Processing template[/tmp/file2] action create (scratch::default line 16)
[2012-12-28T19:02:27+00:00] INFO: Chef Run complete in 0.081508077 seconds
[2012-12-28T19:02:27+00:00] INFO: Running report handlers
[2012-12-28T19:02:27+00:00] INFO: Report handlers complete

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