X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/d228f465b5bf9f5dffedcebad5c7fadcbba21cc3..20a1e1fb660f7a1e2dc04920afed483a7af7fbc1:/cookbooks/apache/definitions/apache_site.rb diff --git a/cookbooks/apache/definitions/apache_site.rb b/cookbooks/apache/definitions/apache_site.rb index c0895959d..53620a113 100644 --- a/cookbooks/apache/definitions/apache_site.rb +++ b/cookbooks/apache/definitions/apache_site.rb @@ -32,7 +32,7 @@ define :apache_site, :action => [ :create, :enable ], :variables => {} do mode 0644 variables params[:variables].merge(:name => name, :directory => directory) if File.exists?("/etc/apache2/sites-enabled/#{link_name}") - notifies :reload, resources(:service => "apache2") + notifies :reload, "service[apache2]" end end end @@ -40,14 +40,14 @@ define :apache_site, :action => [ :create, :enable ], :variables => {} do if site_action.include?(:enable) execute "a2ensite-#{name}" do command "/usr/sbin/a2ensite #{name}" - notifies :restart, resources(:service => "apache2") + notifies :restart, "service[apache2]" not_if { File.exists?("/etc/apache2/sites-enabled/#{link_name}") } end elsif site_action.include?(:disable) or site_action.include?(:delete) execute "a2dissite-#{name}" do action :run command "/usr/sbin/a2dissite #{name}" - notifies :restart, resources(:service => "apache2") + notifies :restart, "service[apache2]" only_if { File.exists?("/etc/apache2/sites-enabled/#{link_name}") } end end