true
end
-action :create do
+action :create do # ~FC017
if node[:lsb][:release].to_f >= 14.04
create_conf
end
end
-action :enable do
+action :enable do # ~FC017
if node[:lsb][:release].to_f >= 14.04
enable_conf
else
end
end
-action :disable do
+action :disable do # ~FC017
if node[:lsb][:release].to_f >= 14.04
disable_conf
else
end
end
-action :delete do
+action :delete do # ~FC017
if node[:lsb][:release].to_f >= 14.04
delete_conf
end
end
end
-if node[:exim][:smarthost_via]
- firewall_rule "deny-outbound-smtp" do
- action :reject
- source "fw"
- dest "net"
- proto "tcp:syn"
- dest_ports "smtp"
- end
+firewall_rule "deny-outbound-smtp" do
+ action :reject
+ source "fw"
+ dest "net"
+ proto "tcp:syn"
+ dest_ports "smtp"
+ only_if { node[:exim][:smarthost_via] }
end
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "1.0.0"
depends "apache"
+depends "git"
depends "mysql"
case dmi.system.product_name
when "ProLiant DL360 G6", "ProLiant DL360 G7"
- default[:hardware][:sensors]["power_meter-*"][:power]["power1"] = { :ignore => true }
+ default[:hardware][:sensors][:"power_meter-*"][:power][:"power1"] = { :ignore => true }
end
end
end
if Chef::Util.compare_versions(node[:kernel][:release], [3, 3]) < 0
default[:hardware][:modules] |= ["microcode"]
- if node[:cpu]["0"][:vendor_id] == "GenuineIntel"
+ if node[:cpu][:"0"][:vendor_id] == "GenuineIntel"
default[:hardware][:modules] |= ["coretemp"]
end
end
--- /dev/null
+Cookbook
+========
+TODO: Enter the cookbook description here.
+
+e.g.
+This cookbook makes your favorite breakfast sandwich.
+
+Requirements
+------------
+TODO: List your cookbook requirements. Be sure to include any requirements this cookbook has on platforms, libraries, other cookbooks, packages, operating systems, etc.
+
+Attributes
+----------
+TODO: List you cookbook attributes here.
+
+Usage
+-----
+TODO: Write usage instructions for each cookbook.
+
+Contributing
+------------
+TODO: (optional) If this is a public cookbook, detail the process for contributing. If this is a private cookbook, remove this section.
+
+e.g.
+1. Fork the repository on Github
+2. Create a named feature branch (like `add_component_x`)
+3. Write your change
+4. Write tests for your change (if applicable)
+5. Run the tests, ensuring they all pass
+6. Submit a Pull Request using Github
+
+License and Authors
+-------------------
+Authors: TODO: List authors
+++ /dev/null
-= DESCRIPTION:
-
-= REQUIREMENTS:
-
-= ATTRIBUTES:
-
-= USAGE:
-
user node[:mediawiki][:user]
group node[:mediawiki][:group]
ignore_failure repository.start_with?("git://github.com/wikimedia/mediawiki-extensions")
- notifies :run, resources(:execute => "#{mediawiki_directory}/maintenance/update.php")
+ notifies :run, "execute[#{mediawiki_directory}/maintenance/update.php]"
end
end
- if template
+ if template # ~FC023
template "#{mediawiki_directory}/LocalSettings.d/Ext-#{name}.inc.php" do
cookbook "mediawiki"
source template
group node[:mediawiki][:group]
mode 0664
variables template_variables
- notifies :create, resources(:template => "#{mediawiki_directory}/LocalSettings.php")
+ notifies :create, "template[#{mediawiki_directory}/LocalSettings.php]"
end
end
mode 0664
content "<?php require_once('#{extension_directory}/#{name}.php');\n"
only_if { File.exist?("#{extension_directory}/#{name}.php") }
- notifies :create, resources(:template => "#{mediawiki_directory}/LocalSettings.php")
+ notifies :create, "template[#{mediawiki_directory}/LocalSettings.php]"
end
end
group node[:mediawiki][:group]
end
- directory "#{site_directory}" do
+ directory site_directory do
owner node[:mediawiki][:user]
group node[:mediawiki][:group]
mode 0775
end
- directory "#{mediawiki[:directory]}" do
+ directory mediawiki[:directory] do
owner node[:mediawiki][:user]
group node[:mediawiki][:group]
mode 0775
end
- git "#{mediawiki[:directory]}" do
+ git mediawiki[:directory] do
action :sync
repository mediawiki_repository
reference mediawiki_reference
# depth 1
user node[:mediawiki][:user]
group node[:mediawiki][:group]
- notifies :run, resources(:execute => "#{mediawiki[:directory]}/maintenance/install.php"), :immediately
- notifies :run, resources(:execute => "#{mediawiki[:directory]}/maintenance/update.php")
+ notifies :run, "execute[#{mediawiki[:directory]}/maintenance/install.php]", :immediately
+ notifies :run, "execute[#{mediawiki[:directory]}/maintenance/update.php]"
end
# Safety catch if git doesn't update but install.php hasn't run
not_if do
File.exist?("#{mediawiki[:directory]}/LocalSettings-install.php")
end
- notifies :run, resources(:execute => "#{mediawiki[:directory]}/maintenance/install.php"), :immediately
+ notifies :run, "execute[#{mediawiki[:directory]}/maintenance/install.php]", :immediately
action :create
end
group node[:mediawiki][:group]
mode 0664
variables :name => name, :database_params => database_params, :mediawiki => mediawiki
- notifies :run, resources(:execute => "#{mediawiki[:directory]}/maintenance/update.php")
+ notifies :run, "execute[#{mediawiki[:directory]}/maintenance/update.php]"
end
template "/etc/cron.d/mediawiki-#{cron_name}" do
+name "mediawiki"
maintainer "OpenStreetMap Administrators"
maintainer_email "admins@openstreetmap.org"
license "Apache 2.0"
description "Installs and configures mediawiki"
-long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
+long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "1.0.0"
-depends "git"
depends "memcached"
+depends "apache"
depends "mysql"
+depends "git"
template "munin.erb"
end
-munin_plugin "memcached_multi_bytes" do
- target "memcached_multi_"
-end
-
-munin_plugin "memcached_multi_commands" do
- target "memcached_multi_"
-end
-
-munin_plugin "memcached_multi_conns" do
- target "memcached_multi_"
-end
-
-munin_plugin "memcached_multi_evictions" do
- target "memcached_multi_"
-end
-
-munin_plugin "memcached_multi_items" do
- target "memcached_multi_"
-end
-
-munin_plugin "memcached_multi_memory" do
- target "memcached_multi_"
+%w(bytes commands conns evictions items memory).each do |stat|
+ munin_plugin "memcached_multi_#{stat}" do
+ target "memcached_multi_"
+ end
end
servers.each do |server|
server.interfaces(:role => :external) do |interface|
- if interface[:zone]
- firewall_rule "accept-munin-#{server}" do
- action :accept
- family interface[:family]
- source "#{interface[:zone]}:#{interface[:address]}"
- dest "fw"
- proto "tcp:syn"
- dest_ports "munin"
- source_ports "1024:"
- end
+ firewall_rule "accept-munin-#{server}" do
+ action :accept
+ family interface[:family]
+ source "#{interface[:zone]}:#{interface[:address]}"
+ dest "fw"
+ proto "tcp:syn"
+ dest_ports "munin"
+ source_ports "1024:"
end
end
end
end
end
-munin_plugin "hpasmcli_temp" do
+munin_plugin "hpasmcli_temp" do # ~FC005
action :delete
end
package "libdbd-mysql-perl"
package "libcache-cache-perl"
-munin_plugin "mysql_bin_relay_log" do
- target "mysql_"
-end
-
-munin_plugin "mysql_commands" do
- target "mysql_"
-end
-
-munin_plugin "mysql_connections" do
- target "mysql_"
-end
-
-munin_plugin "mysql_files_tables" do
- target "mysql_"
-end
-
-munin_plugin "mysql_innodb_bpool" do
- target "mysql_"
-end
-
-munin_plugin "mysql_innodb_bpool_act" do
- target "mysql_"
-end
-
-munin_plugin "mysql_innodb_insert_buf" do
- target "mysql_"
-end
-
-munin_plugin "mysql_innodb_io" do
- target "mysql_"
-end
-
-munin_plugin "mysql_innodb_io_pend" do
- target "mysql_"
-end
-
-munin_plugin "mysql_innodb_log" do
- target "mysql_"
-end
-
-munin_plugin "mysql_innodb_rows" do
- target "mysql_"
-end
-
-munin_plugin "mysql_innodb_semaphores" do
- target "mysql_"
-end
-
-munin_plugin "mysql_innodb_tnx" do
- target "mysql_"
-end
-
-munin_plugin "mysql_myisam_indexes" do
- target "mysql_"
-end
-
-munin_plugin "mysql_network_traffic" do
- target "mysql_"
-end
-
-munin_plugin "mysql_qcache" do
- target "mysql_"
-end
-
-munin_plugin "mysql_qcache_mem" do
- target "mysql_"
-end
-
-munin_plugin "mysql_replication" do
- target "mysql_"
-end
-
-munin_plugin "mysql_select_types" do
- target "mysql_"
-end
-
-munin_plugin "mysql_slow" do
- target "mysql_"
-end
-
-munin_plugin "mysql_sorts" do
- target "mysql_"
-end
-
-munin_plugin "mysql_table_locks" do
- target "mysql_"
-end
-
-munin_plugin "mysql_tmp_tables" do
- target "mysql_"
+%w(
+ bin_relay_log commands connections files_tables innodb_bpool
+ innodb_bpool_act innodb_insert_buf innodb_io innodb_io_pend
+ innodb_log innodb_rows innodb_semaphores innodb_tnx myisam_indexes
+ network_traffic qcache qcache_mem replication select_types slow
+ sorts table_locks tmp_tables
+).each do |stat|
+ munin_plugin "mysql_#{stat}" do
+ target "mysql_"
+ end
end
next unless gateway[:openvpn]
gateway[:openvpn][:tunnels].each_value do |tunnel|
- if tunnel[:peer][:address]
+ if tunnel[:peer][:address] # ~FC023
route tunnel[:peer][:address] do
netmask "255.255.255.255"
gateway interface[:gateway]
end
keys = {
- "rsa" => node[:keys][:ssh][:host_rsa_public],
- "dsa" => node[:keys][:ssh][:host_dsa_public]
+ "rsa" => node[:keys][:ssh][:host_rsa_public], # ~FC039
+ "dsa" => node[:keys][:ssh][:host_dsa_public] # ~FC039
}
- if node[:keys][:ssh][:host_ecdsa_public]
- ecdsa_type = node[:keys][:ssh][:host_ecdsa_type]
+ if node[:keys][:ssh][:host_ecdsa_public] # ~FC039
+ ecdsa_type = node[:keys][:ssh][:host_ecdsa_type] # ~FC039
- keys[ecdsa_type] = node[:keys][:ssh][:host_ecdsa_public]
+ keys[ecdsa_type] = node[:keys][:ssh][:host_ecdsa_public] # ~FC039
end
Hash[
database_password = passwords[node[:otrs][:database_password]]
site = node[:otrs][:site]
-remote_file "/tmp/otrs-#{version}.tar.bz2" do
+remote_file "#{Chef::Config[:file_cache_path]}/otrs-#{version}.tar.bz2" do
source "http://ftp.otrs.org/pub/otrs/otrs-#{version}.tar.bz2"
not_if { File.exist?("/opt/otrs-#{version}") }
end
execute "untar-otrs-#{version}" do
- command "tar jxf /tmp/otrs-#{version}.tar.bz2"
+ command "tar jxf #{Chef::Config[:file_cache_path]}/otrs-#{version}.tar.bz2"
cwd "/opt"
user "root"
group "root"
mode "0755"
end
-remote_file "/tmp/piwik-#{version}.zip" do
+remote_file "#{Chef::Config[:file_cache_path]}/piwik-#{version}.zip" do
source "http://builds.piwik.org/piwik-#{version}.zip"
not_if { File.exist?("/opt/piwik-#{version}/piwik") }
end
execute "unzip-piwik-#{version}" do
- command "unzip -q /tmp/piwik-#{version}.zip"
+ command "unzip -q #{Chef::Config[:file_cache_path]}/piwik-#{version}.zip"
cwd "/opt/piwik-#{version}"
user "root"
group "root"
notifies :restart, "service[apache2]"
end
- directory "#{directory}/taginfo/web/tmp" do
- owner "taginfo"
- group "taginfo"
- mode 0755
- end
-
- directory "#{directory}/data" do
- owner "taginfo"
- group "taginfo"
- mode 0755
- end
-
- directory "#{directory}/data/old" do
- owner "taginfo"
- group "taginfo"
- mode 0755
- end
-
- directory "#{directory}/download" do
- owner "taginfo"
- group "taginfo"
- mode 0755
- end
-
- directory "#{directory}/sources" do
- owner "taginfo"
- group "taginfo"
- mode 0755
- end
-
- directory "#{directory}/planet" do
- owner "taginfo"
- group "taginfo"
- mode 0755
+ %w(taginfo/web/tmp bin data data/old download sources planet planet/log planet/replication).each do |dir|
+ directory "#{directory}/#{dir}" do
+ owner "taginfo"
+ group "taginfo"
+ mode 0755
+ end
end
remote_file "#{directory}/planet/planet.pbf" do
mode 0644
end
- directory "#{directory}/planet/log" do
- owner "taginfo"
- group "taginfo"
- mode 0755
- end
-
- directory "#{directory}/planet/replication" do
- owner "taginfo"
- group "taginfo"
- mode 0755
- end
-
template "#{directory}/planet/replication/configuration.txt" do
source "configuration.txt.erb"
owner "taginfo"
mode 0644
end
- directory "#{directory}/bin" do
- owner "taginfo"
- group "taginfo"
- mode 0755
- end
-
template "#{directory}/bin/update-planet" do
source "update-planet.erb"
owner "taginfo"
end
resolvers = node[:networking][:nameservers].map do |resolver|
- IPAddr.new(resolver).ipv6? ? "[#{resolver}]" : "#{resolver}"
+ IPAddr.new(resolver).ipv6? ? "[#{resolver}]" : resolver
end
nginx_site "tile-ssl" do
--- /dev/null
+Cookbook
+========
+TODO: Enter the cookbook description here.
+
+e.g.
+This cookbook makes your favorite breakfast sandwich.
+
+Requirements
+------------
+TODO: List your cookbook requirements. Be sure to include any requirements this cookbook has on platforms, libraries, other cookbooks, packages, operating systems, etc.
+
+Attributes
+----------
+TODO: List you cookbook attributes here.
+
+Usage
+-----
+TODO: Write usage instructions for each cookbook.
+
+Contributing
+------------
+TODO: (optional) If this is a public cookbook, detail the process for contributing. If this is a private cookbook, remove this section.
+
+e.g.
+1. Fork the repository on Github
+2. Create a named feature branch (like `add_component_x`)
+3. Write your change
+4. Write tests for your change (if applicable)
+5. Run the tests, ensuring they all pass
+6. Submit a Pull Request using Github
+
+License and Authors
+-------------------
+Authors: TODO: List authors
+++ /dev/null
-= DESCRIPTION:
-
-= REQUIREMENTS:
-
-= ATTRIBUTES:
-
-= USAGE:
-
+name "wiki"
maintainer "OpenStreetMap Administrators"
maintainer_email "admins@openstreetmap.org"
license "Apache 2.0"
description "Installs and configures servers for wiki.openstreetmap.org"
-long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
+long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "1.0.0"
depends "mediawiki"
depends "squid"