Skip to content

Instantly share code, notes, and snippets.

@schubert
Created August 24, 2012 05:09
Show Gist options
  • Save schubert/3445649 to your computer and use it in GitHub Desktop.
Save schubert/3445649 to your computer and use it in GitHub Desktop.
Chef WTF
directory node["application"]["path"] do
not_if "test -d #{node['application']['path']}"
action :create
recursive true
owner node["environment"]["user"]
group node["environment"]["group"]
mode "775"
end
directory node["application"]["path"] do
not_if "test -L #{node['application']['path']}"
action :delete
end
#INFO: Processing directory[/srv/apps] action create (common::default line 33)
#INFO: directory[/srv/apps] created directory /srv/apps
#INFO: directory[/srv/apps] owner changed to 1000
#INFO: directory[/srv/apps] group changed to 4
#INFO: directory[/srv/apps] mode changed to 775
#DEBUG: Processing directory[/srv/apps] on testing
#INFO: Processing directory[/srv/apps] action delete (common::default line 42)
#DEBUG: Skipping directory[/srv/apps] due to not_if command `test -d /srv/apps`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment