Permalink
Browse files

Merge branch 'COOK-1767'

  • Loading branch information...
2 parents 1426c39 + 9a5df2d commit e460773d1ae2c14b73ddfd50845798a16e21d469 @jtimberman committed Nov 26, 2012
View
6 attributes/default.rb
@@ -17,20 +17,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-case node["platform"]
+case node["platform_family"]
when "arch"
default["chef_server"]["init_style"] = "arch"
default["chef_server"]["path"] = "/var/lib/chef"
default["chef_server"]["run_path"] = "/var/run/chef"
default["chef_server"]["cache_path"] = "/var/cache/chef"
default["chef_server"]["backup_path"] = "/var/lib/chef/backup"
-when "debian","ubuntu","redhat","centos","fedora","amazon","scientific"
+when "debian", "rhel", "fedora"
default["chef_server"]["init_style"] = "init"
default["chef_server"]["path"] = "/var/lib/chef"
default["chef_server"]["run_path"] = "/var/run/chef"
default["chef_server"]["cache_path"] = "/var/cache/chef"
default["chef_server"]["backup_path"] = "/var/lib/chef/backup"
-when "openbsd","freebsd","mac_os_x"
+when "openbsd", "freebsd", "mac_os_x"
default["chef_server"]["init_style"] = "bsd"
default["chef_server"]["path"] = "/var/chef"
default["chef_server"]["run_path"] = "/var/run"
View
4 recipes/apache-proxy.rb
@@ -41,7 +41,7 @@
directory "/etc/chef/certificates" do
owner "chef"
group root_group
- mode 0700
+ mode 00700
end
bash "Create SSL Certificates" do
@@ -64,4 +64,4 @@
webui_server_aliases node['chef_server']['proxy']['webui_aliases']
webui_port node['chef_server']['proxy']['webui_port']
log_dir node['apache']['log_dir']
-end
+end
View
4 recipes/nginx-proxy.rb
@@ -28,7 +28,7 @@
directory "/etc/chef/certificates" do
owner "chef"
group root_group
- mode 0700
+ mode 00700
end
bash "Create SSL Certificates" do
@@ -46,7 +46,7 @@
source "chef_server.nginx.conf.erb"
owner "root"
group "root"
- mode 0644
+ mode 00644
notifies :restart, "service[nginx]"
variables(
:api_server_name => node['chef_server']['proxy']['api_server_name'],
View
6 recipes/rabbitmq.rb
@@ -21,10 +21,10 @@
#
def debian_before_squeeze?
- platform?("debian") && (node.platform_version.to_f < 5.0 || (node.platform_version.to_f == 5.0 && node.platform_version !~ /.*sid/ ))
+ platform?("debian") && (node['platform_version'].to_f < 5.0 || (node['platform_version'].to_f == 5.0 && node['platform_version'] !~ /.*sid/ ))
end
-if (platform?("ubuntu") && node.platform_version.to_f <= 9.10) || debian_before_squeeze?
+if (platform?("ubuntu") && node['platform_version'].to_f <= 9.10) || debian_before_squeeze?
include_recipe("erlang")
rabbitmq_dpkg_path = ::File.join(Chef::Config[:file_cache_path], "/", "rabbitmq-server_1.7.2-1_all.deb")
@@ -44,7 +44,7 @@ def debian_before_squeeze?
end
service "rabbitmq-server" do
- if platform?("centos","redhat","fedora","amazon","scientific")
+ if platform_family?("rhel", "fedora")
start_command "/sbin/service rabbitmq-server start &> /dev/null"
stop_command "/sbin/service rabbitmq-server stop &> /dev/null"
end
View
54 recipes/rubygems-install.rb
@@ -33,31 +33,25 @@
home node['chef_server']['path']
end
-case node['platform']
-when "ubuntu"
-
- if node['platform_version'].to_f >= 9.10
- include_recipe "couchdb"
- elsif node['platform_version'].to_f >= 8.10
+case node['platform_family']
+when "debian"
+ if node['platform'] == "ubuntu" && node['platform_version'].to_f >= 9.10
+ include_recipe "couchdb"
+ elsif node['platform'] == "ubuntu" && node['platform_version'].to_f >= 8.10
include_recipe "couchdb::source"
end
- include_recipe "java"
- include_recipe "chef-server::rabbitmq"
- include_recipe "gecode"
-
-when "debian"
- if node['platform_version'].to_f >= 6.0 || node['platform_version'] =~ /.*sid/
+ if node['platform'] == "debian" && node['platform_version'].to_f >= 6.0 || node['platform'] == "debian" && node['platform_version'] =~ /.*sid/
include_recipe "couchdb"
- else
+ elsif node['platform'] == "debian"
include_recipe "couchdb::source"
end
include_recipe "java"
include_recipe "chef-server::rabbitmq"
include_recipe "gecode"
-when "centos","redhat","fedora","amazon","scientific"
+when "rhel", "fedora"
include_recipe "couchdb"
include_recipe "java"
@@ -104,7 +98,7 @@
directory dir do
owner "chef"
group root_group
- mode 0755
+ mode 00755
recursive true
end
end
@@ -114,7 +108,7 @@
source "#{cfg}.rb.erb"
owner "chef"
group root_group
- mode 0600
+ mode 00600
end
link "/etc/chef/webui.rb" do
@@ -129,29 +123,29 @@
directory node['chef_server']['path'] do
owner "chef"
group root_group
- mode 0755
+ mode 00755
recursive true
end
%w{ cache search_index }.each do |dir|
directory "#{node['chef_server']['path']}/#{dir}" do
owner "chef"
group root_group
- mode 0755
+ mode 00755
recursive true
end
end
directory "/etc/chef/certificates" do
owner "chef"
group root_group
- mode 0700
+ mode 00700
end
directory node['chef_server']['run_path'] do
owner "chef"
group root_group
- mode 0755
+ mode 00755
recursive true
end
@@ -187,18 +181,18 @@
action :create
owner "chef"
group root_group
- mode 0755
+ mode 00755
recursive true
end
- dist_dir = value_for_platform(
- ["ubuntu", "debian"] => { "default" => "debian" },
- ["redhat", "centos", "fedora", "amazon", "scientific"] => { "default" => "redhat"}
+ dist_dir = value_for_platform_family(
+ ["debian"] => "debian",
+ ["rhel", "fedora"] => "redhat"
)
- conf_dir = value_for_platform(
- ["ubuntu", "debian"] => { "default" => "default" },
- ["redhat", "centos", "fedora", "amazon", "scientific"] => { "default" => "sysconfig"}
+ conf_dir = value_for_platform_family(
+ ["debian"] => "default",
+ ["rhel", "fedora"] => "sysconfig"
)
chef_version = node['chef_packages']['chef']['version']
@@ -209,12 +203,12 @@
template "/etc/init.d/#{svc}" do
source "#{dist_dir}/init.d/#{svc}.erb"
- mode 0755
+ mode 00755
end
file "/etc/#{conf_dir}/#{svc}" do
content conf_content
- mode 0644
+ mode 00644
end
link "#{node['chef_server']['bin_path']}/#{svc}" do
@@ -238,7 +232,7 @@
server_services.each do |svc|
template "#{node['bluepill']['conf_dir']}/#{svc}.pill" do
source "#{svc}.pill.erb"
- mode 0644
+ mode 00644
end
bluepill_service svc do
View
24 templates/default/chef_server.nginx.conf.erb
@@ -3,26 +3,26 @@ upstream chef_server {
}
upstream chef_server_webui {
- server 127.0.0.1:<%= node['chef_server']['webui_port'] %> fail_timeout=0;
+ server 127.0.0.1:<%= node['chef_server']['webui_port'] %> fail_timeout=0;
}
server {
listen <%= @api_port %> ssl;
ssl_certificate /etc/chef/certificates/chef-server-proxy.pem;
ssl_certificate_key /etc/chef/certificates/chef-server-proxy.pem;
server_name <%= @api_server_name %>;
- access_log <%= node[:nginx][:log_dir] %>/chef-server.access.log;
- error_log <%= node[:nginx][:log_dir] %>/chef-server.error.log warn;
+ access_log <%= node['nginx']['log_dir'] %>/chef-server.access.log;
+ error_log <%= node['nginx']['log_dir'] %>/chef-server.error.log warn;
root <%= node['chef_server']['doc_root'] %>;
-
+
location @chef_server {
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $http_host;
proxy_pass http://chef_server;
}
-
+
location / {
try_files $uri @chef_server;
}
@@ -31,9 +31,9 @@ server {
<% if @api_aliases && @api_aliases.length > 0 %>
server {
server_name <%= @api_aliases.join(' ') %>;
- access_log <%= node[:nginx][:log_dir] %>/chef-server.access.log;
- error_log <%= node[:nginx][:log_dir] %>/chef-server.error.log warn;
-
+ access_log <%= node['nginx']['log_dir'] %>/chef-server.access.log;
+ error_log <%= node['nginx']['log_dir'] %>/chef-server.error.log warn;
+
rewrite ^(.+)$ https://<%= @api_server_name %>$1 permanent;
}
@@ -48,7 +48,7 @@ server {
error_log <%= node[:nginx][:log_dir] %>/chef-server.error.log warn;
root <%= node['chef_server']['doc_root'] %>;
-
+
location @chef_server_webui {
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $http_host;
@@ -76,9 +76,9 @@ server {
<% if @webui_aliases && @webui_aliases.length > 0 %>
server {
server_name <%= @webui_aliases.join(' ') %>;
- access_log <%= node[:nginx][:log_dir] %>/chef-server.access.log;
- error_log <%= node[:nginx][:log_dir] %>/chef-server.error.log warn;
-
+ access_log <%= node['nginx']['log_dir'] %>/chef-server.access.log;
+ error_log <%= node['nginx']['log_dir'] %>/chef-server.error.log warn;
+
rewrite ^(.+)$ https://<%= @webui_server_name %>$1 permanent;
}

0 comments on commit e460773

Please sign in to comment.