Skip to content

Commit b26feef

Browse files
author
Christopher Maier
committed
Merge branch 'cm/cleanup'
2 parents 6943c49 + 361291b commit b26feef

File tree

4 files changed

+39
-90
lines changed

4 files changed

+39
-90
lines changed

.kitchen.yml

+3-26
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,13 @@
11
---
22
driver_plugin: vagrant
33
driver_config:
4-
require_chef_omnibus: 11.4.0
5-
6-
provisioner: chef_solo
4+
require_chef_omnibus: 'latest'
5+
provisioner: chef_zero
76
platforms:
8-
97
- name: ubuntu-12.04
10-
driver_config:
11-
box: opscode-ubuntu-12.04
12-
attributes:
13-
push_jobs:
14-
package_url: "https://opc11-tech-preview.s3.amazonaws.com/opscode-push-jobs-client_0.9.0-tech.preview.1%2B20130621231152.git.1.b4a8992-1.ubuntu.11.04_amd64.deb?AWSAccessKeyId=AKIAJFEFN6I3YE4UAMLA&Expires=1378919575&Signature=b9AGjsuFrdNAUDh8uZGhPe9IKVM%3D"
15-
package_checksum: "1fdd05487749f7ad5f1d475cea5b62c4bd4f187eeaa2d90d37cf8d5be1e6e928"
16-
178
- name: ubuntu-10.04
18-
driver_config:
19-
box: opscode-ubuntu-10.04
20-
attributes:
21-
push_jobs:
22-
package_url: "https://opc11-tech-preview.s3.amazonaws.com/opscode-push-jobs-client_0.9.0-tech.preview.1%2B20130621231152.git.1.b4a8992-1.ubuntu.10.04_amd64.deb?AWSAccessKeyId=AKIAJFEFN6I3YE4UAMLA&Expires=1378919575&Signature=yA1vo0gvoCNFsuWqCHwamIiSyx8%3D"
23-
package_checksum: "617b380efa46b1d0661636179fbfc2bb1db1b407e39388a6bbdb1972be2f0728"
24-
25-
269
- name: centos-6.4
27-
driver_config:
28-
box: opscode-centos-6.4
29-
attributes:
30-
push_jobs:
31-
package_url: "https://opc11-tech-preview.s3.amazonaws.com/opscode-push-jobs-client-0.9.0_tech.preview.1%2B20130621231152.git.1.b4a8992-1.el6.x86_64.rpm?AWSAccessKeyId=AKIAJFEFN6I3YE4UAMLA&Expires=1378919575&Signature=BM4gvp7HOqJxp03YovculAUN8js%3D"
32-
package_checksum: "617b380efa46b1d0661636179fbfc2bb1db1b407e39388a6bbdb1972be2f0728"
33-
10+
- name: centos-5.9
3411
suites:
3512
- name: default
3613
run_list:

attributes/default.rb

+30-15
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
# limitations under the License.
1818
#
1919

20-
default['push_jobs']['package_url'] = nil
20+
default['push_jobs']['package_url'] = nil
2121
default['push_jobs']['package_checksum'] = ''
22-
default['push_jobs']['package_version'] = '1.0.0-1'
23-
default['push_jobs']['gem_url'] = nil
24-
default['push_jobs']['gem_checksum'] = ''
22+
default['push_jobs']['package_version'] = '1.0.0-1'
23+
default['push_jobs']['gem_url'] = nil
24+
default['push_jobs']['gem_checksum'] = ''
2525

2626
default['push_jobs']['whitelist'] = { 'chef-client' => 'chef-client' }
2727

@@ -35,15 +35,30 @@
3535
# These are the sha256 checksums of each platform's package, for when they are determined and retrieved algorithmically
3636
default['push_jobs']['default_package_checksums'] = {
3737
'opscode-push-jobs-client-1.0.0%2B20131028192012-1.windows.msi' => 'ab3deb425682b1f025fce1980b91ed88d0912051c0801c7a295a17c2ac75096a',
38-
'opscode-push-jobs-client-1.0.0-1.el5.i686.rpm' => '0e6023b7d1b853eed63133f7d1e63fd6d55f5a06793098f016063669162bfae8',
39-
'opscode-push-jobs-client-1.0.0-1.el5.x86_64.rpm' => 'fadfa187e67f79f5d079843c7758a369dd9237be2db83fad46b24d607f827056',
40-
'opscode-push-jobs-client-1.0.0-1.el6.i686.rpm' => 'acda0d7389b81ead4e83883177a6c28fdafdd1f889229cc5c4c90646213a8c88',
41-
'opscode-push-jobs-client-1.0.0-1.el6.x86_64.rpm' => 'aaf73394de3bcea955fd791aa50d0ee27aaea8a0ac54fb839d31313912814343',
42-
'opscode-push-jobs-client_1.0.0-1.debian.6.0.5_amd64.deb' => '36181b0cd881a106d80c9b51d8cc694051b6983e3ddc292ef91888e745f81006',
43-
'opscode-push-jobs-client_1.0.0-1.debian.6.0.5_i386.deb' => 'f4e0e403bc0fb0c907ce7f72eb52cb6b58108cf906d63648dfc1ad7558397270',
44-
'opscode-push-jobs-client_1.0.0-1.ubuntu.10.04_amd64.deb' => '1dbfaf2f2e7c427c3dc53cc66df03c38dc4a91f4dc07145ec300da35de0cbf86',
45-
'opscode-push-jobs-client_1.0.0-1.ubuntu.10.04_i386.deb' => '6a72eb218c66bf4155ed71ce358724d905c351c8e8894a2eb6806387ac7a9066',
46-
'opscode-push-jobs-client_1.0.0-1.ubuntu.11.04_amd64.deb' => '8aa01ffbeba089cc321fc0a0aab2e8064f69120165e638e79d3b1cd713904f1a',
47-
'opscode-push-jobs-client_1.0.0-1.ubuntu.11.04_i386.deb' => 'db91e682c782e32042d43d9ec39eec0d47f9348ea998177d3b2ae29402640035',
48-
'opscode-push-jobs-client_1.0.0-1.ubuntu.12.04_amd64.deb' => 'b32e439f1fd6f38dc7acfeb2d31fb173e9d5b3cbb439f88cee0ed19b2229e97b'
38+
'opscode-push-jobs-client-1.0.0-1.el5.i686.rpm' => '0e6023b7d1b853eed63133f7d1e63fd6d55f5a06793098f016063669162bfae8',
39+
'opscode-push-jobs-client-1.0.0-1.el5.x86_64.rpm' => 'fadfa187e67f79f5d079843c7758a369dd9237be2db83fad46b24d607f827056',
40+
'opscode-push-jobs-client-1.0.0-1.el6.i686.rpm' => 'acda0d7389b81ead4e83883177a6c28fdafdd1f889229cc5c4c90646213a8c88',
41+
'opscode-push-jobs-client-1.0.0-1.el6.x86_64.rpm' => 'aaf73394de3bcea955fd791aa50d0ee27aaea8a0ac54fb839d31313912814343',
42+
'opscode-push-jobs-client_1.0.0-1.ubuntu.10.04_amd64.deb' => '1dbfaf2f2e7c427c3dc53cc66df03c38dc4a91f4dc07145ec300da35de0cbf86',
43+
'opscode-push-jobs-client_1.0.0-1.ubuntu.10.04_i386.deb' => '6a72eb218c66bf4155ed71ce358724d905c351c8e8894a2eb6806387ac7a9066',
44+
'opscode-push-jobs-client_1.0.0-1.ubuntu.11.04_amd64.deb' => '8aa01ffbeba089cc321fc0a0aab2e8064f69120165e638e79d3b1cd713904f1a',
45+
'opscode-push-jobs-client_1.0.0-1.ubuntu.11.04_i386.deb' => 'db91e682c782e32042d43d9ec39eec0d47f9348ea998177d3b2ae29402640035',
46+
'opscode-push-jobs-client_1.0.0-1.ubuntu.12.04_amd64.deb' => 'b32e439f1fd6f38dc7acfeb2d31fb173e9d5b3cbb439f88cee0ed19b2229e97b'
4947
}
48+
49+
package_version = node['push_jobs']['package_version']
50+
package_machine = node['kernel']['machine']
51+
url_host = "https://opscode-push-jobs-client.s3.amazonaws.com/#{package_version}"
52+
53+
case node['platform_family']
54+
when 'debian'
55+
package_machine = 'amd64' if package_machine == 'x86_64'
56+
case node['platform']
57+
when 'ubuntu'
58+
default['push_jobs']['package_url'] = "#{url_host}/opscode-push-jobs-client_#{package_version}.ubuntu.#{node['platform_version']}_#{package_machine}.deb"
59+
end
60+
when 'rhel'
61+
default['push_jobs']['package_url'] = "#{url_host}/opscode-push-jobs-client-#{package_version}.el#{node['platform_version'].to_i}.#{node['kernel']['machine']}.rpm"
62+
when 'windows'
63+
default['push_jobs']['package_url'] = "#{url_host}/opscode-push-jobs-client-1.0.0%2B20131028192012-1.windows.msi"
64+
end

recipes/linux.rb

+4-38
Original file line numberDiff line numberDiff line change
@@ -22,46 +22,12 @@
2222
# Do not continue if trying to run the Linux recipe on Windows
2323
raise 'This recipe does not support Windows' if node['platform_family'] == 'windows'
2424

25-
if node['push_jobs']['package_url']
26-
package_url = node['push_jobs']['package_url']
27-
package_file = PushJobsHelper.package_file(node['push_jobs']['package_url'])
25+
if node['push_jobs']['package_url'] && node['push_jobs']['package_checksum']
26+
package_url = node['push_jobs']['package_url']
27+
package_file = PushJobsHelper.package_file(node['push_jobs']['package_url'])
2828
package_checksum = node['push_jobs']['package_checksum']
2929
else
30-
package_version = node['push_jobs']['package_version']
31-
# Patterned off of http://opscode.com/chef/install.sh
32-
# Unknown: /etc/lsb-release
33-
if platform?('debian')
34-
# opscode-push-jobs-client_1.0.0-1.debian.6.0.5_amd64.deb
35-
# opscode-push-jobs-client_1.0.0-1.debian.6.0.5_i386.deb
36-
package_machine = node['kernel']['machine']
37-
package_machine = 'amd64' if package_machine == 'x86_64'
38-
39-
package_file = "opscode-push-jobs-client_#{package_version}.debian.#{node['platform_version']}_#{package_machine}.deb"
40-
elsif platform?('ubuntu')
41-
# opscode-push-jobs-client_1.0.0-1.ubuntu.10.04_amd64.deb
42-
# opscode-push-jobs-client_1.0.0-1.ubuntu.10.04_i386.deb
43-
# opscode-push-jobs-client_1.0.0-1.ubuntu.11.04_amd64.deb
44-
# opscode-push-jobs-client_1.0.0-1.ubuntu.11.04_i386.deb
45-
# opscode-push-jobs-client_1.0.0-1.ubuntu.12.04_amd64.deb
46-
# opscode-push-jobs-client_1.0.0-1.ubuntu.12.04_i386.deb
47-
package_machine = node['kernel']['machine']
48-
package_machine = 'amd64' if package_machine == 'x86_64'
49-
package_file = "opscode-push-jobs-client_#{package_version}.ubuntu.#{node['platform_version']}_#{package_machine}.deb"
50-
elsif platform_family?('rhel')
51-
# opscode-push-jobs-client-1.0.0-1.el5.i686.rpm
52-
# opscode-push-jobs-client-1.0.0-1.el5.x86_64.rpm
53-
# opscode-push-jobs-client-1.0.0-1.el6.i686.rpm
54-
# opscode-push-jobs-client-1.0.0-1.el6.x86_64.rpm
55-
package_file = "opscode-push-jobs-client-#{package_version}.el#{node['platform_version'].to_i}.#{node['kernel']['machine']}.rpm"
56-
else
57-
package_file = nil
58-
end
59-
60-
package_url = "https://opscode-push-jobs-client.s3.amazonaws.com/#{package_version}/#{package_file}"
61-
package_checksum = node['push_jobs']['default_package_checksums'][package_file]
62-
if !package_checksum
63-
raise "Unable to determine proper Push Jobs Client package for platform #{node['platform']} version #{node['platform_version']} on #{node['kernel']['machine']}. Please specify package_url and package_checksum explicitly."
64-
end
30+
raise "Unable to determine proper Push Jobs Client package for platform #{node['platform']} version #{node['platform_version']} on #{node['kernel']['machine']}. Please specify package_url and package_checksum explicitly."
6531
end
6632

6733
remote_file "#{Chef::Config[:file_cache_path]}/#{package_file}" do

recipes/windows.rb

+2-11
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,14 @@
2222
# Do not continue if trying to run the Windows recipe on non-Windows
2323
raise 'This recipe only supports Windows' unless node['platform_family'] == 'windows'
2424

25-
if node['push_jobs']['package_url']
26-
package_url = node['push_jobs']['package_url']
27-
package_checksum = node['push_jobs']['package_checksum']
28-
else
29-
package_file = 'opscode-push-jobs-client-1.0.0%2B20131028192012-1.windows.msi'
30-
package_url = "https://opscode-push-jobs-client.s3.amazonaws.com/1.0.0-1/#{package_file}"
31-
package_checksum = node['push_jobs']['default_package_checksums'][package_file]
32-
end
33-
3425
# OC-7332: need the version as part of the DisplayName. Hardcoding is
3526
# fine for now, it will be removed from the installer when the ticket
3627
# is resolved.
3728
display_name = 'Opscode Push Jobs Client Installer for Windows v0.0.1'
3829

3930
windows_package display_name do
40-
source package_url
41-
checksum package_checksum
31+
source node['push_jobs']['package_url']
32+
checksum node['push_jobs']['package_checksum']
4233
end
4334

4435
directory Chef::Config.platform_specific_path('/etc/chef')

0 commit comments

Comments
 (0)