Permalink
Browse files

[COOK-1767] - change all the platform family bits together

Per comment from btm on the ticket,

"There are other places in the cookbook that switch on platform,
particularly attributes, we should change them all together to be
consistent where appropriate."
  • Loading branch information...
1 parent 6704de7 commit 9a5df2d432ed941e4749a8c7e7724c2995940fdc @jtimberman committed Nov 26, 2012
Showing with 15 additions and 15 deletions.
  1. +3 −3 attributes/default.rb
  2. +4 −4 recipes/rabbitmq.rb
  3. +8 −8 recipes/rubygems-install.rb
View
@@ -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
@@ -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
@@ -66,4 +66,4 @@ def debian_before_squeeze?
# the three regex's map to config, write, read permissions respectively
execute 'rabbitmqctl set_permissions -p /chef chef ".*" ".*" ".*"' do
not_if 'rabbitmqctl list_user_permissions chef|grep /chef'
-end
+end
@@ -35,13 +35,13 @@
case node['platform_family']
when "debian"
- if node['platform'] == "ubuntu" AND node['platform_version'].to_f >= 9.10
+ if node['platform'] == "ubuntu" && node['platform_version'].to_f >= 9.10
include_recipe "couchdb"
- elsif node['platform'] == "ubuntu" AND node['platform_version'].to_f >= 8.10
+ elsif node['platform'] == "ubuntu" && node['platform_version'].to_f >= 8.10
include_recipe "couchdb::source"
end
- if node['platform'] == "debian" AND node['platform_version'].to_f >= 6.0 || node['platform'] == "debian" AND 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"
elsif node['platform'] == "debian"
include_recipe "couchdb::source"
@@ -186,13 +186,13 @@
end
dist_dir = value_for_platform_family(
- ["debian"] => { "default" => "debian" },
- ["rhel", "fedora"] => { "default" => "redhat"}
+ ["debian"] => "debian",
+ ["rhel", "fedora"] => "redhat"
)
conf_dir = value_for_platform_family(
- ["debian"] => { "default" => "default" },
- ["rhel", "fedora"] => { "default" => "sysconfig"}
+ ["debian"] => "default",
+ ["rhel", "fedora"] => "sysconfig"
)
chef_version = node['chef_packages']['chef']['version']
@@ -263,4 +263,4 @@
log("Could not determine service init style, manual intervention required to set up server services.")
-end
+end

0 comments on commit 9a5df2d

Please sign in to comment.