Permalink
Browse files

[COOK-2036] - default instead of set

* Corrected node attribute references using #{set['..']}
* Use default priority in attributes file for easier overrides
  • Loading branch information...
1 parent e7f438c commit 9588fd08f2ab94b38e829339d3b52db7f4b9a1ae @jtimberman jtimberman committed Dec 12, 2012
Showing with 67 additions and 67 deletions.
  1. +67 −67 attributes/default.rb
View
@@ -17,84 +17,84 @@
# limitations under the License.
#
-set['apache']['root_group'] = "root"
+default['apache']['root_group'] = "root"
# Where the various parts of apache are
case platform
when "redhat", "centos", "scientific", "fedora", "suse", "amazon"
- set['apache']['package'] = "httpd"
- set['apache']['dir'] = "/etc/httpd"
- set['apache']['log_dir'] = "/var/log/httpd"
- set['apache']['error_log'] = "error.log"
- set['apache']['user'] = "apache"
- set['apache']['group'] = "apache"
- set['apache']['binary'] = "/usr/sbin/httpd"
- set['apache']['icondir'] = "/var/www/icons"
- set['apache']['cache_dir'] = "/var/cache/httpd"
+ default['apache']['package'] = "httpd"
+ default['apache']['dir'] = "/etc/httpd"
+ default['apache']['log_dir'] = "/var/log/httpd"
+ default['apache']['error_log'] = "error.log"
+ default['apache']['user'] = "apache"
+ default['apache']['group'] = "apache"
+ default['apache']['binary'] = "/usr/sbin/httpd"
+ default['apache']['icondir'] = "/var/www/icons"
+ default['apache']['cache_dir'] = "/var/cache/httpd"
if node['platform_version'].to_f >= 6 then
- set['apache']['pid_file'] = "/var/run/httpd/httpd.pid"
+ default['apache']['pid_file'] = "/var/run/httpd/httpd.pid"
else
- set['apache']['pid_file'] = "/var/run/httpd.pid"
+ default['apache']['pid_file'] = "/var/run/httpd.pid"
end
- set['apache']['lib_dir'] = node['kernel']['machine'] =~ /^i[36']86$/ ? "/usr/lib/httpd" : "/usr/lib64/httpd"
- set['apache']['libexecdir'] = "#{set['apache']['lib_dir']}/modules"
- set['apache']['default_site_enabled'] = false
+ default['apache']['lib_dir'] = node['kernel']['machine'] =~ /^i[36']86$/ ? "/usr/lib/httpd" : "/usr/lib64/httpd"
+ default['apache']['libexecdir'] = "#{node['apache']['lib_dir']}/modules"
+ default['apache']['default_site_enabled'] = false
when "debian", "ubuntu"
- set['apache']['package'] = "apache2"
- set['apache']['dir'] = "/etc/apache2"
- set['apache']['log_dir'] = "/var/log/apache2"
- set['apache']['error_log'] = "error.log"
- set['apache']['user'] = "www-data"
- set['apache']['group'] = "www-data"
- set['apache']['binary'] = "/usr/sbin/apache2"
- set['apache']['icondir'] = "/usr/share/apache2/icons"
- set['apache']['cache_dir'] = "/var/cache/apache2"
- set['apache']['pid_file'] = "/var/run/apache2.pid"
- set['apache']['lib_dir'] = "/usr/lib/apache2"
- set['apache']['libexecdir'] = "#{set['apache']['lib_dir']}/modules"
- set['apache']['default_site_enabled'] = false
+ default['apache']['package'] = "apache2"
+ default['apache']['dir'] = "/etc/apache2"
+ default['apache']['log_dir'] = "/var/log/apache2"
+ default['apache']['error_log'] = "error.log"
+ default['apache']['user'] = "www-data"
+ default['apache']['group'] = "www-data"
+ default['apache']['binary'] = "/usr/sbin/apache2"
+ default['apache']['icondir'] = "/usr/share/apache2/icons"
+ default['apache']['cache_dir'] = "/var/cache/apache2"
+ default['apache']['pid_file'] = "/var/run/apache2.pid"
+ default['apache']['lib_dir'] = "/usr/lib/apache2"
+ default['apache']['libexecdir'] = "#{node['apache']['lib_dir']}/modules"
+ default['apache']['default_site_enabled'] = false
when "arch"
- set['apache']['package'] = "apache"
- set['apache']['dir'] = "/etc/httpd"
- set['apache']['log_dir'] = "/var/log/httpd"
- set['apache']['error_log'] = "error.log"
- set['apache']['user'] = "http"
- set['apache']['group'] = "http"
- set['apache']['binary'] = "/usr/sbin/httpd"
- set['apache']['icondir'] = "/usr/share/httpd/icons"
- set['apache']['cache_dir'] = "/var/cache/httpd"
- set['apache']['pid_file'] = "/var/run/httpd/httpd.pid"
- set['apache']['lib_dir'] = "/usr/lib/httpd"
- set['apache']['libexecdir'] = "#{set['apache']['lib_dir']}/modules"
- set['apache']['default_site_enabled'] = false
+ default['apache']['package'] = "apache"
+ default['apache']['dir'] = "/etc/httpd"
+ default['apache']['log_dir'] = "/var/log/httpd"
+ default['apache']['error_log'] = "error.log"
+ default['apache']['user'] = "http"
+ default['apache']['group'] = "http"
+ default['apache']['binary'] = "/usr/sbin/httpd"
+ default['apache']['icondir'] = "/usr/share/httpd/icons"
+ default['apache']['cache_dir'] = "/var/cache/httpd"
+ default['apache']['pid_file'] = "/var/run/httpd/httpd.pid"
+ default['apache']['lib_dir'] = "/usr/lib/httpd"
+ default['apache']['libexecdir'] = "#{node['apache']['lib_dir']}/modules"
+ default['apache']['default_site_enabled'] = false
when "freebsd"
- set['apache']['package'] = "apache22"
- set['apache']['dir'] = "/usr/local/etc/apache22"
- set['apache']['log_dir'] = "/var/log"
- set['apache']['error_log'] = "httpd-error.log"
- set['apache']['root_group'] = "wheel"
- set['apache']['user'] = "www"
- set['apache']['group'] = "www"
- set['apache']['binary'] = "/usr/local/sbin/httpd"
- set['apache']['icondir'] = "/usr/local/www/apache22/icons"
- set['apache']['cache_dir'] = "/var/run/apache22"
- set['apache']['pid_file'] = "/var/run/httpd.pid"
- set['apache']['lib_dir'] = "/usr/local/libexec/apache22"
- set['apache']['libexecdir'] = set['apache']['lib_dir']
- set['apache']['default_site_enabled'] = false
+ default['apache']['package'] = "apache22"
+ default['apache']['dir'] = "/usr/local/etc/apache22"
+ default['apache']['log_dir'] = "/var/log"
+ default['apache']['error_log'] = "httpd-error.log"
+ default['apache']['root_group'] = "wheel"
+ default['apache']['user'] = "www"
+ default['apache']['group'] = "www"
+ default['apache']['binary'] = "/usr/local/sbin/httpd"
+ default['apache']['icondir'] = "/usr/local/www/apache22/icons"
+ default['apache']['cache_dir'] = "/var/run/apache22"
+ default['apache']['pid_file'] = "/var/run/httpd.pid"
+ default['apache']['lib_dir'] = "/usr/local/libexec/apache22"
+ default['apache']['libexecdir'] = node['apache']['lib_dir']
+ default['apache']['default_site_enabled'] = false
else
- set['apache']['dir'] = "/etc/apache2"
- set['apache']['log_dir'] = "/var/log/apache2"
- set['apache']['error_log'] = "error.log"
- set['apache']['user'] = "www-data"
- set['apache']['group'] = "www-data"
- set['apache']['binary'] = "/usr/sbin/apache2"
- set['apache']['icondir'] = "/usr/share/apache2/icons"
- set['apache']['cache_dir'] = "/var/cache/apache2"
- set['apache']['pid_file'] = "logs/httpd.pid"
- set['apache']['lib_dir'] = "/usr/lib/apache2"
- set['apache']['libexecdir'] = "#{set['apache']['lib_dir']}/modules"
- set['apache']['default_site_enabled'] = false
+ default['apache']['dir'] = "/etc/apache2"
+ default['apache']['log_dir'] = "/var/log/apache2"
+ default['apache']['error_log'] = "error.log"
+ default['apache']['user'] = "www-data"
+ default['apache']['group'] = "www-data"
+ default['apache']['binary'] = "/usr/sbin/apache2"
+ default['apache']['icondir'] = "/usr/share/apache2/icons"
+ default['apache']['cache_dir'] = "/var/cache/apache2"
+ default['apache']['pid_file'] = "logs/httpd.pid"
+ default['apache']['lib_dir'] = "/usr/lib/apache2"
+ default['apache']['libexecdir'] = "#{node['apache']['lib_dir']}/modules"
+ default['apache']['default_site_enabled'] = false
end
###

0 comments on commit 9588fd0

Please sign in to comment.