Commit 57062608 authored by Jonathan Hartman's avatar Jonathan Hartman
Browse files

Also install the runit-systemd package on newer Ubuntus

Looks like it was introduced in 17.10.

https://packages.ubuntu.com/search?keywords=runit-systemd



With this addition, the cookbook now converges successfully on the prerelease
18.04 builds.
Signed-off-by: default avatarJonathan Hartman <j@hartman.io>
parent e66fb3ba
......@@ -63,3 +63,10 @@ platforms:
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update
- name: ubuntu-18.04
driver:
image: dokken/ubuntu-18.04
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update
......@@ -21,6 +21,7 @@ platforms:
- name: oracle-7
- name: ubuntu-14.04
- name: ubuntu-16.04
- name: ubuntu-18.04
suites:
- name: default
......
......@@ -34,7 +34,13 @@ when 'rhel', 'amazon'
when 'debian'
# debian 9+ ship with runit-systemd which includes only what you need for process supervision and not
# what is necessary for running runit as pid 1, which we don't care about.
pkg_name = platform?('debian') && node['platform_version'].to_i >= 9 ? 'runit-systemd' : 'runit'
pv = node['platform_version']
pkg_name = if (platform?('debian') && pv.to_i >= 9) || \
(platform?('ubuntu') && Gem::Version.new(pv) >= Gem::Version.new('17.10'))
'runit-systemd'
else
'runit'
end
package pkg_name do
action :install
......
......@@ -114,6 +114,24 @@ describe 'runit::default on ubuntu 16.04' do
end
end
describe 'runit::default on ubuntu 18.04' do
cached(:ubuntu18_default) do
ChefSpec::SoloRunner.new(
platform: 'ubuntu',
version: '18.04'
).converge('runit::default')
end
it 'installs the runit-systemd package' do
expect(ubuntu18_default).to install_package('runit-systemd')
end
it 'starts and enabled the correct runit service' do
expect(ubuntu18_default).to enable_service('runit')
expect(ubuntu18_default).to start_service('runit')
end
end
describe 'runit::default on debian 7' do
cached(:debian7_default) do
ChefSpec::SoloRunner.new(
......
if os[:family] == 'debian' && os[:release].to_i == 9
if (os[:name] == 'debian' && os[:release].to_i >= 9) || \
(os[:name] == 'ubuntu' && Gem::Version.new(os[:release]) >= Gem::Version.new('17.10'))
describe package('runit-systemd') do
it { should be_installed }
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment