diff --git a/.kitchen.yml b/.kitchen.yml index a851a1d..e40e22f 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -11,6 +11,15 @@ platforms: memory: 512 run_list: - recipe[apt] +- name: debian-7.1.0 + driver_config: + box: opscode-debian-7.1.0 + box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_debian-7.1.0_provisionerless.box + require_chef_omnibus: true + customize: + memory: 512 + run_list: + - recipe[apt] - name: centos-6.4 driver_config: box: opscode-centos-6.4 diff --git a/CHANGELOG.md b/CHANGELOG.md index b742139..a05d2a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## v2.3.1: + +* Fixed Debian support. +* Added Debian Wheezy to Test Kitchen. + ## v2.3.0: * Fixed package installation so that it respects version numbers. diff --git a/recipes/enterprise_package.rb b/recipes/enterprise_package.rb index dd23b43..8e6ddb8 100644 --- a/recipes/enterprise_package.rb +++ b/recipes/enterprise_package.rb @@ -72,11 +72,9 @@ package package_name do source "#{Chef::Config[:file_cache_path]}/#{package_file}" action :install - case node['platform'] when "ubuntu","debian" - options "--force-confdef --force-confold" - end - provider value_for_platform( - [ "ubuntu", "debian" ] => {"default" => Chef::Provider::Package::Dpkg}, - [ "redhat", "centos", "fedora" ] => {"default" => Chef::Provider::Package::Yum} + options "--force-confdef --force-confold" if node['platform_family'] == "debian" + provider value_for_platform_family( + [ "debian" ] => Chef::Provider::Package::Dpkg, + [ "rhel", "fedora" ] => Chef::Provider::Package::Rpm ) end diff --git a/recipes/package.rb b/recipes/package.rb index 662e06d..e74f263 100644 --- a/recipes/package.rb +++ b/recipes/package.rb @@ -50,6 +50,10 @@ when "ubuntu", "debian" include_recipe "apt" + if node['platform'] == "ubuntu" && package_version == "1.3.2-1" + package_version = package_version.gsub(/-/, "~precise") + end + apt_repository "basho" do uri "http://apt.basho.com" distribution node['lsb']['codename'] @@ -59,7 +63,7 @@ package "riak" do action :install - version (package_version == "1.3.2-1" ? package_version.gsub(/-/, "~precise") : package_version) + version package_version end when "centos", "redhat" @@ -78,13 +82,16 @@ action :add end + if platform_version >= 6 + package_version = "#{package_version}.el#{platform_version}" + end + package "riak" do action :install - version (platform_version < 6 ? package_version : "#{package_version}.el#{platform_version}") + version package_version end when "fedora" - remote_file "#{Chef::Config[:file_cache_path]}/#{package_file}" do source package_uri owner "root"