From 261e7e9cd1a9882faa4ed7087b5902ebafe25988 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sat, 23 Nov 2013 12:04:41 +0000 Subject: [PATCH 1/1] Convert all notify/subscribe calls to the new style syntax --- cookbooks/apache/definitions/apache_module.rb | 6 ++-- cookbooks/apache/definitions/apache_site.rb | 6 ++-- cookbooks/apache/recipes/ssl.rb | 8 ++--- cookbooks/apt/definitions/apt_source.rb | 2 +- cookbooks/apt/recipes/default.rb | 2 +- cookbooks/bind/recipes/default.rb | 6 ++-- cookbooks/chef/definitions/ohai_plugin.rb | 2 +- cookbooks/civicrm/recipes/default.rb | 6 ++-- cookbooks/db/recipes/base.rb | 2 +- cookbooks/dev/recipes/default.rb | 8 ++--- cookbooks/devices/recipes/default.rb | 2 +- cookbooks/dns/recipes/default.rb | 2 +- cookbooks/exim/recipes/default.rb | 2 +- cookbooks/geodns/recipes/default.rb | 6 ++-- cookbooks/git/recipes/server.rb | 2 +- cookbooks/hardware/recipes/default.rb | 4 +-- cookbooks/memcached/recipes/default.rb | 2 +- cookbooks/munin/definitions/munin_plugin.rb | 2 +- .../munin/definitions/munin_plugin_conf.rb | 2 +- cookbooks/munin/recipes/default.rb | 4 +-- cookbooks/mysql/recipes/default.rb | 2 +- cookbooks/networking/recipes/default.rb | 34 +++++++++---------- cookbooks/nfs/recipes/server.rb | 2 +- cookbooks/nginx/definitions/nginx_site.rb | 4 +-- cookbooks/nominatim/recipes/default.rb | 2 +- cookbooks/ntp/recipes/default.rb | 4 +-- cookbooks/openvpn/recipes/default.rb | 2 +- cookbooks/osqa/recipes/default.rb | 8 ++--- cookbooks/otrs/recipes/default.rb | 2 +- cookbooks/owl/recipes/default.rb | 6 ++-- cookbooks/postgresql/recipes/default.rb | 10 +++--- cookbooks/rsyncd/recipes/default.rb | 2 +- cookbooks/snmpd/recipes/default.rb | 2 +- cookbooks/spamassassin/recipes/default.rb | 4 +-- cookbooks/squid/recipes/default.rb | 6 ++-- cookbooks/sysctl/recipes/default.rb | 2 +- cookbooks/sysfs/recipes/default.rb | 2 +- cookbooks/thinkup/recipes/default.rb | 4 +-- cookbooks/tile/recipes/default.rb | 16 ++++----- cookbooks/web/definitions/rails_port.rb | 24 ++++++------- cookbooks/web/recipes/cgimap.rb | 10 +++--- cookbooks/web/recipes/gpx.rb | 6 ++-- 42 files changed, 115 insertions(+), 115 deletions(-) diff --git a/cookbooks/apache/definitions/apache_module.rb b/cookbooks/apache/definitions/apache_module.rb index 4ac89432d..beb43b2ef 100644 --- a/cookbooks/apache/definitions/apache_module.rb +++ b/cookbooks/apache/definitions/apache_module.rb @@ -41,7 +41,7 @@ define :apache_module, :action => [ :install, :enable ], :variables => {} do mode 0644 variables params[:variables] if File.exists?("/etc/apache2/mods-enabled/#{name}.load") - notifies :reload, resources(:service => "apache2") + notifies :reload, "service[apache2]" end end end @@ -50,13 +50,13 @@ define :apache_module, :action => [ :install, :enable ], :variables => {} do if module_action.include?(:enable) execute "a2enmod-#{name}" do command "/usr/sbin/a2enmod #{name}" - notifies :restart, resources(:service => "apache2") + notifies :restart, "service[apache2]" not_if { File.exists?("/etc/apache2/mods-enabled/#{name}.load") } end elsif module_action.include?(:disable) or module_action.include?(:remove) execute "a2dismod-#{name}" do command "/usr/sbin/a2dismod #{name}" - notifies :restart, resources(:service => "apache2") + notifies :restart, "service[apache2]" only_if { File.exists?("/etc/apache2/mods-enabled/#{name}.load") } end end 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 diff --git a/cookbooks/apache/recipes/ssl.rb b/cookbooks/apache/recipes/ssl.rb index b32c11c8b..356416795 100644 --- a/cookbooks/apache/recipes/ssl.rb +++ b/cookbooks/apache/recipes/ssl.rb @@ -32,12 +32,12 @@ template "/etc/apache2/conf.d/ssl" do group "root" mode 0644 variables :certificate => certificate - notifies :reload, resources(:service => "apache2") + notifies :reload, "service[apache2]" end service "apache2" do action :nothing - subscribes :restart, resources(:cookbook_file => "/etc/ssl/certs/rapidssl.pem") - subscribes :restart, resources(:cookbook_file => "/etc/ssl/certs/#{certificate}.pem") - subscribes :restart, resources(:file => "/etc/ssl/private/#{certificate}.key") + subscribes :restart, "cookbook_file[/etc/ssl/certs/rapidssl.pem]" + subscribes :restart, "cookbook_file[/etc/ssl/certs/#{certificate}.pem]" + subscribes :restart, "file[/etc/ssl/private/#{certificate}.key]" end diff --git a/cookbooks/apt/definitions/apt_source.rb b/cookbooks/apt/definitions/apt_source.rb index f98b2b22c..382f9cce4 100644 --- a/cookbooks/apt/definitions/apt_source.rb +++ b/cookbooks/apt/definitions/apt_source.rb @@ -37,7 +37,7 @@ define :apt_source do owner "root" group "root" mode 0644 - notifies :run, resources(:execute => "apt-update") + notifies :run, "execute[apt-update]" variables :url => params[:url] end end diff --git a/cookbooks/apt/recipes/default.rb b/cookbooks/apt/recipes/default.rb index 65f625a0b..a8e41cc0f 100644 --- a/cookbooks/apt/recipes/default.rb +++ b/cookbooks/apt/recipes/default.rb @@ -34,7 +34,7 @@ template "/etc/apt/sources.list" do owner "root" group "root" mode 0644 - notifies :run, resources(:execute => "apt-update") + notifies :run, "execute[apt-update]" end apt_source "opscode" do diff --git a/cookbooks/bind/recipes/default.rb b/cookbooks/bind/recipes/default.rb index 80dee1de3..1d2a8d8bf 100644 --- a/cookbooks/bind/recipes/default.rb +++ b/cookbooks/bind/recipes/default.rb @@ -31,7 +31,7 @@ template "/etc/bind/named.conf.local" do owner "root" group "root" mode 0644 - notifies :restart, resources(:service => "bind9") + notifies :restart, "service[bind9]" end template "/etc/bind/named.conf.options" do @@ -39,7 +39,7 @@ template "/etc/bind/named.conf.options" do owner "root" group "root" mode 0644 - notifies :restart, resources(:service => "bind9") + notifies :restart, "service[bind9]" end template "/etc/bind/db.10" do @@ -47,7 +47,7 @@ template "/etc/bind/db.10" do owner "root" group "root" mode 0644 - notifies :reload, resources(:service => "bind9") + notifies :reload, "service[bind9]" end firewall_rule "accept-dns-udp" do diff --git a/cookbooks/chef/definitions/ohai_plugin.rb b/cookbooks/chef/definitions/ohai_plugin.rb index 06e9d300d..50be323fe 100644 --- a/cookbooks/chef/definitions/ohai_plugin.rb +++ b/cookbooks/chef/definitions/ohai_plugin.rb @@ -31,7 +31,7 @@ define :ohai_plugin, :action => [ :create, :delete ] do owner "root" group "root" mode 0644 - notifies :reload, resources(:ohai => plugin_name) + notifies :reload, "ohai[#{plugin_name}]" end elsif plugin_action.include?(:delete) template "/etc/chef/ohai/#{plugin_name}.rb" do diff --git a/cookbooks/civicrm/recipes/default.rb b/cookbooks/civicrm/recipes/default.rb index 28e2d7779..58cea555e 100644 --- a/cookbooks/civicrm/recipes/default.rb +++ b/cookbooks/civicrm/recipes/default.rb @@ -124,7 +124,7 @@ execute "civicrm-load-data" do cwd "/usr/share/drupal7/sites/all/modules/civicrm" user "root" group "root" - notifies :run, resources(:execute => "civicrm-load-acl") + notifies :run, "execute[civicrm-load-acl]" end execute "civicrm-load" do @@ -133,7 +133,7 @@ execute "civicrm-load" do cwd "/usr/share/drupal7/sites/all/modules/civicrm" user "root" group "root" - notifies :run, resources(:execute => "civicrm-load-data") + notifies :run, "execute[civicrm-load-data]" end execute "civicrm-gencode" do @@ -142,7 +142,7 @@ execute "civicrm-gencode" do user "root" group "root" creates "#{civicrm_directory}/civicrm-version.php" - notifies :run, resources(:execute => "civicrm-load") + notifies :run, "execute[civicrm-load]" end directory "/data/crm.osmfoundation.org/civicrm/en_US" do diff --git a/cookbooks/db/recipes/base.rb b/cookbooks/db/recipes/base.rb index 3f9920487..4b126d106 100644 --- a/cookbooks/db/recipes/base.rb +++ b/cookbooks/db/recipes/base.rb @@ -52,5 +52,5 @@ execute "/srv/www.openstreetmap.org/rails/db/functions/Makefile" do cwd "/srv/www.openstreetmap.org/rails/db/functions" user "rails" group "rails" - subscribes :run, resources(:git => "/srv/www.openstreetmap.org/rails") + subscribes :run, "git[/srv/www.openstreetmap.org/rails]" end diff --git a/cookbooks/dev/recipes/default.rb b/cookbooks/dev/recipes/default.rb index b96f9291e..29ce0c063 100644 --- a/cookbooks/dev/recipes/default.rb +++ b/cookbooks/dev/recipes/default.rb @@ -78,12 +78,12 @@ template "/etc/php5/fpm/pool.d/default.conf" do owner "root" group "root" mode 0644 - notifies :reload, resources(:service => "php5-fpm") + notifies :reload, "service[php5-fpm]" end file "/etc/php5/fpm/pool.d/www.conf" do action :delete - notifies :reload, resources(:service => "php5-fpm") + notifies :reload, "service[php5-fpm]" end package "phppgadmin" @@ -117,7 +117,7 @@ search(:accounts, "*:*").each do |account| group "root" mode 0644 variables :user => name - notifies :reload, resources(:service => "php5-fpm") + notifies :reload, "service[php5-fpm]" end apache_site "#{name}.dev.openstreetmap.org" do @@ -170,7 +170,7 @@ if node[:postgresql][:clusters]["9.1/main"] group "apis" mode 0644 variables :site => site_name - notifies :touch, resources(:file => "#{rails_directory}/tmp/restart.txt") + notifies :touch, "file[#{rails_directory}/tmp/restart.txt]" end apache_site site_name do diff --git a/cookbooks/devices/recipes/default.rb b/cookbooks/devices/recipes/default.rb index 73c1a4e9a..8a83da46b 100644 --- a/cookbooks/devices/recipes/default.rb +++ b/cookbooks/devices/recipes/default.rb @@ -27,5 +27,5 @@ template "/etc/udev/rules.d/99-chef.rules" do owner "root" group "root" mode 0644 - notifies :run, resources(:execute => "udevadm-trigger") + notifies :run, "execute[udevadm-trigger]" end diff --git a/cookbooks/dns/recipes/default.rb b/cookbooks/dns/recipes/default.rb index 530fd77e4..768ad711b 100644 --- a/cookbooks/dns/recipes/default.rb +++ b/cookbooks/dns/recipes/default.rb @@ -95,7 +95,7 @@ directory "/var/lib/dns" do owner "git" group "git" mode 02775 - notifies :run, resources(:execute => "dns-update") + notifies :run, "execute[dns-update]" end cookbook_file "#{node[:dns][:repository]}/hooks/post-receive" do diff --git a/cookbooks/exim/recipes/default.rb b/cookbooks/exim/recipes/default.rb index 219629f59..61731d8e4 100644 --- a/cookbooks/exim/recipes/default.rb +++ b/cookbooks/exim/recipes/default.rb @@ -78,7 +78,7 @@ template "/etc/exim4/exim4.conf" do mode 0644 variables :relay_to_domains => relay_to_domains.sort, :relay_from_hosts => relay_from_hosts.sort - notifies :restart, resources(:service => "exim4") + notifies :restart, "service[exim4]" end search(:accounts, "*:*").each do |account| diff --git a/cookbooks/geodns/recipes/default.rb b/cookbooks/geodns/recipes/default.rb index 0bd74fb8e..09f28c9d9 100644 --- a/cookbooks/geodns/recipes/default.rb +++ b/cookbooks/geodns/recipes/default.rb @@ -27,7 +27,7 @@ end file "/etc/powerdns/pdns.d/pdns.simplebind" do action :delete - notifies :reload, resources(:service => "pdns") + notifies :reload, "service[pdns]" end template "/etc/powerdns/pdns.d/geo.conf" do @@ -35,7 +35,7 @@ template "/etc/powerdns/pdns.d/geo.conf" do owner "root" group "root" mode "0600" - notifies :reload, resources(:service => "pdns") + notifies :reload, "service[pdns]" end directory "/etc/powerdns/zones.d" do @@ -49,7 +49,7 @@ template "/etc/powerdns/zones.d/tile.conf" do owner "root" group "root" mode "0644" - notifies :reload, resources(:service => "pdns") + notifies :reload, "service[pdns]" end template "/etc/cron.weekly/geodns-update" do diff --git a/cookbooks/git/recipes/server.rb b/cookbooks/git/recipes/server.rb index f8f0ef3d4..66efbb146 100644 --- a/cookbooks/git/recipes/server.rb +++ b/cookbooks/git/recipes/server.rb @@ -84,5 +84,5 @@ template "/etc/xinetd.d/git" do owner "root" group "root" mode 0644 - notifies :reload, resources(:service => "xinetd") + notifies :reload, "service[xinetd]" end diff --git a/cookbooks/hardware/recipes/default.rb b/cookbooks/hardware/recipes/default.rb index a561681ac..9fa225d26 100644 --- a/cookbooks/hardware/recipes/default.rb +++ b/cookbooks/hardware/recipes/default.rb @@ -106,7 +106,7 @@ unless unit.nil? provider Chef::Provider::Service::Upstart action [ :enable, :start ] supports :status => true, :restart => true, :reload => false - subscribes :restart, resources(:template => "/etc/init/ttyS#{unit}.conf") + subscribes :restart, "template[/etc/init/ttyS#{unit}.conf]" end end @@ -122,7 +122,7 @@ if File.exist?("/etc/default/grub") group "root" mode 0644 variables :unit => unit, :speed => speed - notifies :run, resources(:execute => "update-grub") + notifies :run, "execute[update-grub]" end end diff --git a/cookbooks/memcached/recipes/default.rb b/cookbooks/memcached/recipes/default.rb index d8d1434d0..0ed312b0d 100644 --- a/cookbooks/memcached/recipes/default.rb +++ b/cookbooks/memcached/recipes/default.rb @@ -29,7 +29,7 @@ template "/etc/memcached.conf" do owner "root" group "root" mode 0644 - notifies :restart, resources(:service => "memcached") + notifies :restart, "service[memcached]" end munin_plugin_conf "memcached_multi" do diff --git a/cookbooks/munin/definitions/munin_plugin.rb b/cookbooks/munin/definitions/munin_plugin.rb index beee646fa..4704313b7 100644 --- a/cookbooks/munin/definitions/munin_plugin.rb +++ b/cookbooks/munin/definitions/munin_plugin.rb @@ -38,7 +38,7 @@ define :munin_plugin, :action => :create do link "/etc/munin/plugins/#{params[:name]}" do action params[:action] to target_path - notifies :restart, resources(:service => "munin-node") + notifies :restart, "service[munin-node]" end end diff --git a/cookbooks/munin/definitions/munin_plugin_conf.rb b/cookbooks/munin/definitions/munin_plugin_conf.rb index 63cecd0ab..91ad9894c 100644 --- a/cookbooks/munin/definitions/munin_plugin_conf.rb +++ b/cookbooks/munin/definitions/munin_plugin_conf.rb @@ -28,7 +28,7 @@ define :munin_plugin_conf, :action => :create, :variables => {} do group "root" mode 0644 variables params[:variables].merge(:name => params[:name]) - notifies :restart, resources(:service => "munin-node") + notifies :restart, "service[munin-node]" end else file "/etc/munin/plugin-conf.d/#{params[:name]}" do diff --git a/cookbooks/munin/recipes/default.rb b/cookbooks/munin/recipes/default.rb index 41d722e0c..33f51097e 100644 --- a/cookbooks/munin/recipes/default.rb +++ b/cookbooks/munin/recipes/default.rb @@ -50,7 +50,7 @@ template "/etc/munin/munin-node.conf" do group "root" mode 0644 variables :servers => servers - notifies :restart, resources(:service => "munin-node") + notifies :restart, "service[munin-node]" end remote_directory "/usr/local/share/munin/plugins" do @@ -73,7 +73,7 @@ remote_directory "/etc/munin/plugin-conf.d" do files_group "root" files_mode 0644 purge false - notifies :restart, resources(:service => "munin-node") + notifies :restart, "service[munin-node]" end if Dir.glob("/proc/acpi/thermal_zone/*/temperature").empty? diff --git a/cookbooks/mysql/recipes/default.rb b/cookbooks/mysql/recipes/default.rb index d56fbdc04..f9d2e2d03 100644 --- a/cookbooks/mysql/recipes/default.rb +++ b/cookbooks/mysql/recipes/default.rb @@ -30,7 +30,7 @@ template "/etc/mysql/conf.d/chef.cnf" do owner "root" group "root" mode 0644 - notifies :reload, resources(:service => "mysql") + notifies :reload, "service[mysql]" end package "libdbd-mysql-perl" diff --git a/cookbooks/networking/recipes/default.rb b/cookbooks/networking/recipes/default.rb index 9e87e2855..04df2495f 100644 --- a/cookbooks/networking/recipes/default.rb +++ b/cookbooks/networking/recipes/default.rb @@ -56,7 +56,7 @@ template "/etc/hostname" do owner "root" group "root" mode 0644 - notifies :run, resources(:execute => "hostname") + notifies :run, "execute[hostname]" end template "/etc/hosts" do @@ -135,7 +135,7 @@ template "/etc/default/shorewall" do owner "root" group "root" mode 0644 - notifies :restart, resources(:service => "shorewall") + notifies :restart, "service[shorewall]" end template "/etc/shorewall/shorewall.conf" do @@ -143,7 +143,7 @@ template "/etc/shorewall/shorewall.conf" do owner "root" group "root" mode 0644 - notifies :restart, resources(:service => "shorewall") + notifies :restart, "service[shorewall]" end template "/etc/shorewall/zones" do @@ -152,7 +152,7 @@ template "/etc/shorewall/zones" do group "root" mode 0644 variables :type => "ipv4" - notifies :restart, resources(:service => "shorewall") + notifies :restart, "service[shorewall]" end template "/etc/shorewall/interfaces" do @@ -160,7 +160,7 @@ template "/etc/shorewall/interfaces" do owner "root" group "root" mode 0644 - notifies :restart, resources(:service => "shorewall") + notifies :restart, "service[shorewall]" end template "/etc/shorewall/hosts" do @@ -169,7 +169,7 @@ template "/etc/shorewall/hosts" do group "root" mode 0644 variables :zones => zones - notifies :restart, resources(:service => "shorewall") + notifies :restart, "service[shorewall]" end template "/etc/shorewall/policy" do @@ -177,7 +177,7 @@ template "/etc/shorewall/policy" do owner "root" group "root" mode 0644 - notifies :restart, resources(:service => "shorewall") + notifies :restart, "service[shorewall]" end template "/etc/shorewall/rules" do @@ -186,7 +186,7 @@ template "/etc/shorewall/rules" do group "root" mode 0644 variables :rules => [] - notifies :restart, resources(:service => "shorewall") + notifies :restart, "service[shorewall]" end firewall_rule "limit-icmp-echo" do @@ -217,12 +217,12 @@ if node[:roles].include?("gateway") owner "root" group "root" mode 0644 - notifies :restart, resources(:service => "shorewall") + notifies :restart, "service[shorewall]" end else file "/etc/shorewall/masq" do action :delete - notifies :restart, resources(:service => "shorewall") + notifies :restart, "service[shorewall]" end end @@ -240,7 +240,7 @@ if not node.interfaces(:family => :inet6).empty? owner "root" group "root" mode 0644 - notifies :restart, resources(:service => "shorewall6") + notifies :restart, "service[shorewall6]" end template "/etc/shorewall6/shorewall6.conf" do @@ -248,7 +248,7 @@ if not node.interfaces(:family => :inet6).empty? owner "root" group "root" mode 0644 - notifies :restart, resources(:service => "shorewall6") + notifies :restart, "service[shorewall6]" end template "/etc/shorewall6/zones" do @@ -257,7 +257,7 @@ if not node.interfaces(:family => :inet6).empty? group "root" mode 0644 variables :type => "ipv6" - notifies :restart, resources(:service => "shorewall6") + notifies :restart, "service[shorewall6]" end template "/etc/shorewall6/interfaces" do @@ -265,7 +265,7 @@ if not node.interfaces(:family => :inet6).empty? owner "root" group "root" mode 0644 - notifies :restart, resources(:service => "shorewall6") + notifies :restart, "service[shorewall6]" end template "/etc/shorewall6/hosts" do @@ -274,7 +274,7 @@ if not node.interfaces(:family => :inet6).empty? group "root" mode 0644 variables :zones => zones - notifies :restart, resources(:service => "shorewall6") + notifies :restart, "service[shorewall6]" end template "/etc/shorewall6/policy" do @@ -282,7 +282,7 @@ if not node.interfaces(:family => :inet6).empty? owner "root" group "root" mode 0644 - notifies :restart, resources(:service => "shorewall6") + notifies :restart, "service[shorewall6]" end template "/etc/shorewall6/rules" do @@ -291,7 +291,7 @@ if not node.interfaces(:family => :inet6).empty? group "root" mode 0644 variables :rules => [] - notifies :restart, resources(:service => "shorewall6") + notifies :restart, "service[shorewall6]" end firewall_rule "limit-icmp6-echo" do diff --git a/cookbooks/nfs/recipes/server.rb b/cookbooks/nfs/recipes/server.rb index 3e13507f1..508d14eca 100644 --- a/cookbooks/nfs/recipes/server.rb +++ b/cookbooks/nfs/recipes/server.rb @@ -60,5 +60,5 @@ template "/etc/exports" do group "root" mode 0644 variables :exports => exports - notifies :run, resources(:execute => "exportfs") + notifies :run, "execute[exportfs]" end diff --git a/cookbooks/nginx/definitions/nginx_site.rb b/cookbooks/nginx/definitions/nginx_site.rb index 51228d632..528527b07 100644 --- a/cookbooks/nginx/definitions/nginx_site.rb +++ b/cookbooks/nginx/definitions/nginx_site.rb @@ -30,14 +30,14 @@ define :nginx_site, :action => [ :create ], :variables => {} do group "root" mode 0644 variables params[:variables].merge(:name => name, :directory => directory) - notifies :reload, resources(:service => "nginx") + notifies :reload, "service[nginx]" end end if site_action.include?(:delete) file "/etc/nginx/conf.d/#{name}.conf" do action :delete - notifies :restart, resources(:service => "nginx") + notifies :restart, "service[nginx]" end end end diff --git a/cookbooks/nominatim/recipes/default.rb b/cookbooks/nominatim/recipes/default.rb index cd12156d8..dfa2df7c1 100644 --- a/cookbooks/nominatim/recipes/default.rb +++ b/cookbooks/nominatim/recipes/default.rb @@ -54,7 +54,7 @@ node[:nominatim][:fpm_pools].each do |name,data| group "root" mode 0644 variables data.merge(:name => name) - notifies :reload, resources(:service => "php5-fpm") + notifies :reload, "service[php5-fpm]" end end diff --git a/cookbooks/ntp/recipes/default.rb b/cookbooks/ntp/recipes/default.rb index 938aa47ac..12447a28d 100644 --- a/cookbooks/ntp/recipes/default.rb +++ b/cookbooks/ntp/recipes/default.rb @@ -35,7 +35,7 @@ file "/etc/timezone" do group "root" mode 0644 content "#{node[:tz]}\n" - notifies :run, resources(:execute => "dpkg-reconfigure-tzdata"), :immediately + notifies :run, "execute[dpkg-reconfigure-tzdata]", :immediately end service "ntp" do @@ -48,7 +48,7 @@ template "/etc/ntp.conf" do owner "root" group "root" mode 0644 - notifies :restart, resources(:service => "ntp") + notifies :restart, "service[ntp]" end munin_plugins = [ "ntp_kernel_err", "ntp_kernel_pll_freq", "ntp_kernel_pll_off", "ntp_offset" ] diff --git a/cookbooks/openvpn/recipes/default.rb b/cookbooks/openvpn/recipes/default.rb index cbd45ee65..fbf6af9b6 100644 --- a/cookbooks/openvpn/recipes/default.rb +++ b/cookbooks/openvpn/recipes/default.rb @@ -69,7 +69,7 @@ node[:openvpn][:tunnels].each do |name,details| :port => node[:openvpn][:tunnels][name][:port], :mode => node[:openvpn][:tunnels][name][:mode], :peer => node[:openvpn][:tunnels][name][:peer] - notifies :restart, resources(:service => "openvpn") + notifies :restart, "service[openvpn]" end else file "/etc/openvpn/#{name}.conf" do diff --git a/cookbooks/osqa/recipes/default.rb b/cookbooks/osqa/recipes/default.rb index 766f2f4b0..98707f9ba 100644 --- a/cookbooks/osqa/recipes/default.rb +++ b/cookbooks/osqa/recipes/default.rb @@ -61,7 +61,7 @@ node[:osqa][:sites].each do |site| cwd "#{directory}/osqa" user site_user group site_group - notifies :reload, resources(:service => "apache2") + notifies :reload, "service[apache2]" end subversion "#{directory}/osqa" do @@ -70,7 +70,7 @@ node[:osqa][:sites].each do |site| revision osqa_revision user site_user group site_group - notifies :run, resources(:execute => "osqa-migrate") + notifies :run, "execute[osqa-migrate]" end remote_directory "#{directory}/osqa/forum_modules/osmauth" do @@ -89,7 +89,7 @@ node[:osqa][:sites].each do |site| group site_group mode 0644 variables :directory => directory - notifies :reload, resources(:service => "apache2") + notifies :reload, "service[apache2]" end settings = edit_file "#{directory}/osqa/settings_local.py.dist" do |line| @@ -110,6 +110,6 @@ node[:osqa][:sites].each do |site| group site_group mode 0644 content settings - notifies :reload, resources(:service => "apache2") + notifies :reload, "service[apache2]" end end diff --git a/cookbooks/otrs/recipes/default.rb b/cookbooks/otrs/recipes/default.rb index 487fddf90..fa9644287 100644 --- a/cookbooks/otrs/recipes/default.rb +++ b/cookbooks/otrs/recipes/default.rb @@ -131,7 +131,7 @@ Dir.glob("/opt/otrs/var/cron/*.dist") do |distname| group "www-data" mode 0664 content IO.read(distname) - notifies :run, resources(:execute => "/opt/otrs/bin/Cron.sh") + notifies :run, "execute[/opt/otrs/bin/Cron.sh]" end end diff --git a/cookbooks/owl/recipes/default.rb b/cookbooks/owl/recipes/default.rb index 819abdd78..a1868edcf 100644 --- a/cookbooks/owl/recipes/default.rb +++ b/cookbooks/owl/recipes/default.rb @@ -97,7 +97,7 @@ execute "/srv/owl.openstreetmap.org/openstreetmap-watch-list/rails/Gemfile" do cwd "/srv/owl.openstreetmap.org/openstreetmap-watch-list/rails" user "root" group "root" - notifies :touch, resources(:file => "/srv/owl.openstreetmap.org/openstreetmap-watch-list/rails/tmp/restart.txt") + notifies :touch, "file[/srv/owl.openstreetmap.org/openstreetmap-watch-list/rails/tmp/restart.txt]" end git "/srv/owl.openstreetmap.org/openstreetmap-watch-list" do @@ -106,7 +106,7 @@ git "/srv/owl.openstreetmap.org/openstreetmap-watch-list" do revision "owl.osm.org" user "owl" group "owl" - notifies :run, resources(:execute => "/srv/owl.openstreetmap.org/openstreetmap-watch-list/rails/Gemfile") + notifies :run, "execute[/srv/owl.openstreetmap.org/openstreetmap-watch-list/rails/Gemfile]" end directory "srv/owl.openstreetmap.org/openstreetmap-watch-list/rails/tmp" do @@ -124,7 +124,7 @@ template "/srv/owl.openstreetmap.org/openstreetmap-watch-list/rails/config/datab owner "owl" group "owl" mode 0664 - notifies :run, resources(:execute => "/srv/owl.openstreetmap.org/openstreetmap-watch-list/rails/Gemfile") + notifies :run, "execute[/srv/owl.openstreetmap.org/openstreetmap-watch-list/rails/Gemfile]" only_if { node[:postgresql][:clusters]["9.1/main"] } end diff --git a/cookbooks/postgresql/recipes/default.rb b/cookbooks/postgresql/recipes/default.rb index 4cf4b0bda..9dfde2448 100644 --- a/cookbooks/postgresql/recipes/default.rb +++ b/cookbooks/postgresql/recipes/default.rb @@ -39,7 +39,7 @@ node[:postgresql][:versions].each do |version| group "postgres" mode 0644 variables :version => version, :defaults => defaults, :settings => settings - notifies :reload, resources(:service => "postgresql") + notifies :reload, "service[postgresql]" end template "/etc/postgresql/#{version}/main/pg_hba.conf" do @@ -49,7 +49,7 @@ node[:postgresql][:versions].each do |version| mode 0640 variables :early_rules => settings[:early_authentication_rules] || defaults[:early_authentication_rules], :late_rules => settings[:late_authentication_rules] || defaults[:late_authentication_rules] - notifies :reload, resources(:service => "postgresql") + notifies :reload, "service[postgresql]" end template "/etc/postgresql/#{version}/main/pg_ident.conf" do @@ -58,7 +58,7 @@ node[:postgresql][:versions].each do |version| group "postgres" mode 0640 variables :maps => settings[:user_name_maps] || defaults[:user_name_maps] - notifies :reload, resources(:service => "postgresql") + notifies :reload, "service[postgresql]" end link "/var/lib/postgresql/#{version}/main/server.crt" do @@ -79,12 +79,12 @@ node[:postgresql][:versions].each do |version| group "postgres" mode 0640 variables :defaults => defaults, :settings => settings - notifies :reload, resources(:service => "postgresql") + notifies :reload, "service[postgresql]" end else template "/var/lib/postgresql/#{version}/main/recovery.conf" do action :delete - notifies :reload, resources(:service => "postgresql") + notifies :reload, "service[postgresql]" end end end diff --git a/cookbooks/rsyncd/recipes/default.rb b/cookbooks/rsyncd/recipes/default.rb index 56eb2f6ff..44fef331e 100644 --- a/cookbooks/rsyncd/recipes/default.rb +++ b/cookbooks/rsyncd/recipes/default.rb @@ -52,7 +52,7 @@ template "/etc/default/rsync" do owner "root" group "root" mode 0644 - notifies :restart, resources(:service => "rsync") + notifies :restart, "service[rsync]" end template "/etc/rsyncd.conf" do diff --git a/cookbooks/snmpd/recipes/default.rb b/cookbooks/snmpd/recipes/default.rb index c67466785..ef6094b01 100644 --- a/cookbooks/snmpd/recipes/default.rb +++ b/cookbooks/snmpd/recipes/default.rb @@ -34,7 +34,7 @@ template "/etc/snmp/snmpd.conf" do group "root" mode 0600 variables :communities => communities - notifies :restart, resources(:service => "snmpd") + notifies :restart, "service[snmpd]" end node[:snmpd][:clients].each do |address| diff --git a/cookbooks/spamassassin/recipes/default.rb b/cookbooks/spamassassin/recipes/default.rb index ec1109c76..e9150a55d 100644 --- a/cookbooks/spamassassin/recipes/default.rb +++ b/cookbooks/spamassassin/recipes/default.rb @@ -29,7 +29,7 @@ template "/etc/default/spamassassin" do owner "root" group "root" mode 0644 - notifies :restart, resources(:service => "spamassassin") + notifies :restart, "service[spamassassin]" end trusted_networks = node[:exim][:relay_from_hosts] @@ -48,5 +48,5 @@ template "/etc/spamassassin/local.cf" do group "root" mode 0644 variables :trusted_networks => trusted_networks.sort - notifies :restart, resources(:service => "spamassassin") + notifies :restart, "service[spamassassin]" end diff --git a/cookbooks/squid/recipes/default.rb b/cookbooks/squid/recipes/default.rb index 6452f67af..ce8ec8c9e 100644 --- a/cookbooks/squid/recipes/default.rb +++ b/cookbooks/squid/recipes/default.rb @@ -43,9 +43,9 @@ end service "squid" do action [ :enable, :start ] supports :status => true, :restart => true, :reload => true - subscribes :reload, resources(:template => "/etc/squid/squid.conf") - subscribes :restart, resources(:template => "/etc/default/squid") - subscribes :reload, resources(:template => "/etc/resolv.conf") + subscribes :reload, "template[/etc/squid/squid.conf]" + subscribes :restart, "template[/etc/default/squid]" + subscribes :reload, "template[/etc/resolv.conf]" end munin_plugin "squid_cache" diff --git a/cookbooks/sysctl/recipes/default.rb b/cookbooks/sysctl/recipes/default.rb index 380e747b9..d2797a289 100644 --- a/cookbooks/sysctl/recipes/default.rb +++ b/cookbooks/sysctl/recipes/default.rb @@ -37,7 +37,7 @@ template "/etc/sysctl.d/60-chef.conf" do owner "root" group "root" mode 0644 - notifies :run, resources(:execute => "sysctl") + notifies :run, "execute[sysctl]" end node[:sysctl].each_value do |group| diff --git a/cookbooks/sysfs/recipes/default.rb b/cookbooks/sysfs/recipes/default.rb index c6eb15ff5..b9b5faff3 100644 --- a/cookbooks/sysfs/recipes/default.rb +++ b/cookbooks/sysfs/recipes/default.rb @@ -29,5 +29,5 @@ template "/etc/sysfs.conf" do owner "root" group "root" mode 0644 - notifies :restart, resources(:service => "sysfsutils") + notifies :restart, "service[sysfsutils]" end diff --git a/cookbooks/thinkup/recipes/default.rb b/cookbooks/thinkup/recipes/default.rb index 25864460f..c7b6ed23f 100644 --- a/cookbooks/thinkup/recipes/default.rb +++ b/cookbooks/thinkup/recipes/default.rb @@ -50,7 +50,7 @@ git "/srv/thinkup.openstreetmap.org" do revision "v1.2.1" user "root" group "root" - notifies :reload, resources(:service => "apache2") + notifies :reload, "service[apache2]" end directory "/srv/thinkup.openstreetmap.org/logs" do @@ -92,7 +92,7 @@ file "/srv/thinkup.openstreetmap.org/webapp/config.inc.php" do group "root" mode 0644 content thinkup_config - notifies :reload, resources(:service => "apache2") + notifies :reload, "service[apache2]" end thinkup_cron = edit_file "/srv/thinkup.openstreetmap.org/extras/cron/config.sample" do |line| diff --git a/cookbooks/tile/recipes/default.rb b/cookbooks/tile/recipes/default.rb index 03c850dc9..9f54d530d 100644 --- a/cookbooks/tile/recipes/default.rb +++ b/cookbooks/tile/recipes/default.rb @@ -77,8 +77,8 @@ template "/etc/renderd.conf" do owner "root" group "root" mode 0644 - notifies :reload, resources(:service => "apache2") - notifies :restart, resources(:service => "renderd") + notifies :reload, "service[apache2]" + notifies :restart, "service[renderd]" end remote_directory "/srv/tile.openstreetmap.org/html" do @@ -186,7 +186,7 @@ node[:tile][:data].each do |name,data| command "ogr2ogr #{processed} #{original}" user "tile" group "tile" - subscribes :run, resources(:execute => file), :immediately + subscribes :run, "execute[#{file}]", :immediately end end @@ -195,7 +195,7 @@ node[:tile][:data].each do |name,data| command "find #{directory} -type f -iname '*.shp' -print0 | xargs -0 --no-run-if-empty shapeindex --shape_files" user "tile" group "tile" - subscribes :run, resources(:execute => file), :immediately + subscribes :run, "execute[#{file}]", :immediately end remote_file file do @@ -211,8 +211,8 @@ node[:tile][:data].each do |name,data| group "tile" mode 0644 backup false - notifies :run, resources(:execute => file), :immediately - notifies :restart, resources(:service => "renderd") + notifies :run, "execute[#{file}]", :immediately + notifies :restart, "service[renderd]" end end @@ -461,8 +461,8 @@ end service "replicate" do action [ :enable, :start ] supports :restart => true - subscribes :restart, resources(:template => "/usr/local/bin/replicate") - subscribes :restart, resources(:template => "/etc/init.d/replicate") + subscribes :restart, "template[/usr/local/bin/replicate]" + subscribes :restart, "template[/etc/init.d/replicate]" end template "/etc/logrotate.d/replicate" do diff --git a/cookbooks/web/definitions/rails_port.rb b/cookbooks/web/definitions/rails_port.rb index be6e0be22..dbc5c3210 100644 --- a/cookbooks/web/definitions/rails_port.rb +++ b/cookbooks/web/definitions/rails_port.rb @@ -83,8 +83,8 @@ define :rails_port, :action => [ :create, :enable ] do cwd rails_directory user rails_user group rails_group - notifies :delete, resources(:file => "#{rails_directory}/public/export/embed.html") - notifies :touch, resources(:file => "#{rails_directory}/tmp/restart.txt") + notifies :delete, "file[#{rails_directory}/public/export/embed.html]" + notifies :touch, "file[#{rails_directory}/tmp/restart.txt]" end execute "#{rails_directory}/db/migrate" do @@ -93,7 +93,7 @@ define :rails_port, :action => [ :create, :enable ] do cwd rails_directory user rails_user group rails_group - notifies :run, resources(:execute => "#{rails_directory}/public/assets") + notifies :run, "execute[#{rails_directory}/public/assets]" end execute "#{rails_directory}/Gemfile" do @@ -103,11 +103,11 @@ define :rails_port, :action => [ :create, :enable ] do user "root" group "root" if run_migrations - notifies :run, resources(:execute => "#{rails_directory}/db/migrate") + notifies :run, "execute[#{rails_directory}/db/migrate]" else - notifies :run, resources(:execute => "#{rails_directory}/public/assets") + notifies :run, "execute[#{rails_directory}/public/assets]" end - subscribes :run, resources(:gem_package => "bundler#{ruby_version}") + subscribes :run, "gem_package[bundler#{ruby_version}]" end directory rails_directory do @@ -122,7 +122,7 @@ define :rails_port, :action => [ :create, :enable ] do revision rails_revision user rails_user group rails_group - notifies :run, resources(:execute => "#{rails_directory}/Gemfile") + notifies :run, "execute[#{rails_directory}/Gemfile]" end directory "#{rails_directory}/tmp" do @@ -142,7 +142,7 @@ define :rails_port, :action => [ :create, :enable ] do group rails_group mode 0664 variables database_params - notifies :touch, resources(:file => "#{rails_directory}/tmp/restart.txt") + notifies :touch, "file[#{rails_directory}/tmp/restart.txt]" end application_yml = edit_file "#{rails_directory}/config/example.application.yml" do |line| @@ -213,7 +213,7 @@ define :rails_port, :action => [ :create, :enable ] do group rails_group mode 0664 content application_yml - notifies :touch, resources(:file => "#{rails_directory}/tmp/restart.txt") + notifies :touch, "file[#{rails_directory}/tmp/restart.txt]" end if params[:piwik_configuration] @@ -222,12 +222,12 @@ define :rails_port, :action => [ :create, :enable ] do group rails_group mode 0664 content YAML.dump(params[:piwik_configuration]) - notifies :run, resources(:execute => "#{rails_directory}/public/assets") + notifies :run, "execute[#{rails_directory}/public/assets]" end else file "#{rails_directory}/config/piwik.yml" do action :delete - notifies :run, resources(:execute => "#{rails_directory}/public/assets") + notifies :run, "execute[#{rails_directory}/public/assets]" end end @@ -250,7 +250,7 @@ define :rails_port, :action => [ :create, :enable ] do File.mtime("#{rails_directory}/lib/quad_tile/quad_tile_so.so") >= File.mtime("#{rails_directory}/lib/quad_tile/quad_tile.c") and File.mtime("#{rails_directory}/lib/quad_tile/quad_tile_so.so") >= File.mtime("#{rails_directory}/lib/quad_tile/quad_tile.h") end - notifies :touch, resources(:file => "#{rails_directory}/tmp/restart.txt") + notifies :touch, "file[#{rails_directory}/tmp/restart.txt]" end template "/etc/cron.daily/rails-#{name}" do diff --git a/cookbooks/web/recipes/cgimap.rb b/cookbooks/web/recipes/cgimap.rb index c1f8e894e..ac8acff60 100644 --- a/cookbooks/web/recipes/cgimap.rb +++ b/cookbooks/web/recipes/cgimap.rb @@ -53,7 +53,7 @@ execute "cgimap-configure" do cwd cgimap_directory user "rails" group "rails" - notifies :run, resources(:execute => "cgimap-build"), :immediate + notifies :run, "execute[cgimap-build]", :immediate end execute "cgimap-autogen" do @@ -62,7 +62,7 @@ execute "cgimap-autogen" do cwd cgimap_directory user "rails" group "rails" - notifies :run, resources(:execute => "cgimap-configure"), :immediate + notifies :run, "execute[cgimap-configure]", :immediate end git cgimap_directory do @@ -71,7 +71,7 @@ git cgimap_directory do revision "live" user "rails" group "rails" - notifies :run, resources(:execute => "cgimap-autogen"), :immediate + notifies :run, "execute[cgimap-autogen]", :immediate end if node[:web][:readonly_database_host] @@ -115,7 +115,7 @@ else service "cgimap" do action [ :enable, :start ] supports :restart => true, :reload => true - subscribes :restart, resources(:execute => "cgimap-build") - subscribes :restart, resources(:file => "/etc/init.d/cgimap") + subscribes :restart, "execute[cgimap-build]" + subscribes :restart, "file[/etc/init.d/cgimap]" end end diff --git a/cookbooks/web/recipes/gpx.rb b/cookbooks/web/recipes/gpx.rb index c5d0088f8..b2117dde9 100644 --- a/cookbooks/web/recipes/gpx.rb +++ b/cookbooks/web/recipes/gpx.rb @@ -50,7 +50,7 @@ git gpx_directory do revision "live" user "rails" group "rails" - notifies :run, resources(:execute => "gpx-import-build"), :immediate + notifies :run, "execute[gpx-import-build]", :immediate end template "/etc/init.d/gpx-import" do @@ -75,7 +75,7 @@ else service "gpx-import" do action [ :enable, :start ] supports :restart => true, :reload => true - subscribes :restart, resources(:execute => "gpx-import-build") - subscribes :restart, resources(:template => "/etc/init.d/gpx-import") + subscribes :restart, "execute[gpx-import-build]" + subscribes :restart, "template[/etc/init.d/gpx-import]" end end -- 2.39.5