From 358b8fb5353d5cbc7800245f392b3bcc49c3b958 Mon Sep 17 00:00:00 2001 From: Steve Traylen Date: Fri, 6 Mar 2020 09:31:23 +0100 Subject: [PATCH] Add CentOS 8 support The main differences for CentOS 8 are: * There is now a new collectd-utils package containing collectdctl * python is python3 Note that setting `collectd::ci_package_repo` true will currently result in yum being configured with a non existant repo since https://pkg.ci.collectd.org/rpm/ does not exist for 8. https://github.com/collectd/collectd-ci/issues/35 --- .sync.yml | 1 + .travis.yml | 8 ++ lib/facter/python_dir.rb | 2 + manifests/params.pp | 5 +- manifests/plugin/cuda.pp | 37 ++++-- manifests/plugin/iscdhcp.pp | 38 ++++-- manifests/plugin/python.pp | 8 +- manifests/plugin/rabbitmq.pp | 4 + metadata.json | 9 +- spec/acceptance/class_plugin_python_spec.rb | 83 ++++++++---- spec/acceptance/class_spec.rb | 10 +- spec/acceptance/curl_json_spec.rb | 3 + spec/classes/collectd_plugin_rabbitmq_spec.rb | 125 +++++++++++------- spec/spec_helper_acceptance.rb | 10 +- spec/spec_helper_methods.rb | 6 +- 15 files changed, 246 insertions(+), 103 deletions(-) diff --git a/.sync.yml b/.sync.yml index 12215f5ca..ff751c806 100644 --- a/.sync.yml +++ b/.sync.yml @@ -4,6 +4,7 @@ - set: ubuntu1604-64 - set: ubuntu1804-64 - set: centos7-64 + - set: centos8-64 - set: debian8-64 secure: "FAK3Izs5bSZyblGvcFnGWm0exZV5+v9pbwfRDD2oihWxX3U3pArGW+3XcwcJfLQgrUYBsOTmHC8yPjlgTBYeIt/5pvg9X+3jwNgeto6kozpI/nvAq4NtcHhzxRejuPELhFYeXZ3hEw0w+v/ZRo2cNLwI0LLpiWEDvCMZN1CJ2RY=" spec/spec_helper.rb: diff --git a/.travis.yml b/.travis.yml index 391701cc4..a1c8dec16 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,6 +46,14 @@ matrix: bundler_args: --without development release env: PUPPET_INSTALL_TYPE=agent BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=centos7-64 BEAKER_HYPERVISOR=docker CHECK=beaker services: docker + - rvm: 2.5.3 + bundler_args: --without development release + env: PUPPET_INSTALL_TYPE=agent BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=centos8-64 BEAKER_HYPERVISOR=docker CHECK=beaker + services: docker + - rvm: 2.5.3 + bundler_args: --without development release + env: PUPPET_INSTALL_TYPE=agent BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=centos8-64 BEAKER_HYPERVISOR=docker CHECK=beaker + services: docker - rvm: 2.5.3 bundler_args: --without development release env: PUPPET_INSTALL_TYPE=agent BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=debian8-64 BEAKER_HYPERVISOR=docker CHECK=beaker diff --git a/lib/facter/python_dir.rb b/lib/facter/python_dir.rb index c6beaf66b..1101513ac 100644 --- a/lib/facter/python_dir.rb +++ b/lib/facter/python_dir.rb @@ -16,6 +16,8 @@ else Facter::Util::Resolution.exec('python3 -c "import site; print(site.getsitepackages()[0])"') end + elsif File.exist?('/usr/libexec/platform-python') + Facter::Util::Resolution.exec('/usr/libexec/platform-python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"') else '' end diff --git a/manifests/params.pp b/manifests/params.pp index a97a83d38..8e3fc53a1 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -71,7 +71,10 @@ $config_file = '/etc/collectd.conf' $config_group = 'root' $java_dir = '/usr/share/collectd/java' - $default_python_dir = '/usr/lib/python2.7/site-packages' + $default_python_dir = $facts['os']['release']['major'] ? { + '7' => '/usr/lib/python2.7/site-packages', + default => '/usr/lib/python3.6/site-packages', + } $manage_repo = true $package_configs = { ovs_events => 'ovs-events.conf', diff --git a/manifests/plugin/cuda.pp b/manifests/plugin/cuda.pp index 6d7ad9a9e..5979af814 100644 --- a/manifests/plugin/cuda.pp +++ b/manifests/plugin/cuda.pp @@ -11,29 +11,46 @@ # @param package_provider Optional[String] Passed to package resource. Default: pip # @param provider_proxy Optional[String] Proxy for provider. Default: undef class collectd::plugin::cuda ( - Optional[String] $ensure = 'present', - Optional[Boolean] $manage_package = undef, - Optional[String] $package_name = 'collectd-cuda', - Optional[String] $package_provider = 'pip', - Optional[String] $provider_proxy = undef, + Optional[String] $ensure = 'present', + Optional[Boolean] $manage_package = undef, + Optional[String] $package_name = 'collectd-cuda', + Optional[String] $package_provider = undef, + Optional[String] $provider_proxy = undef, ) { include collectd $_manage_package = pick($manage_package, $collectd::manage_package) + if $facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '8' { + $_python_pip_package = 'python3-pip' + if $package_provider =~ Undef { + $_package_provider = 'pip3' + } + else { + $_package_provider = $package_provider + } + } else { + $_python_pip_package = 'python-pip' + if $package_provider =~ Undef { + $_package_provider = 'pip' + } + else { + $_package_provider = $package_provider + } + } if ($_manage_package) { - if (!defined(Package['python-pip'])) { - package { 'python-pip': ensure => 'present', } + if (!defined(Package[$_python_pip_package])) { + package { $_python_pip_package: ensure => 'present', } Package[$package_name] { - require => Package['python-pip'], + require => Package[$_python_pip_package], } if $facts['os']['family'] == 'RedHat' { # Epel is installed in install.pp if manage_repo is true # python-pip doesn't exist in base for RedHat. Need epel installed first if (defined(Class['::epel'])) { - Package['python-pip'] { + Package[$_python_pip_package] { require => Class['::epel'], } } @@ -49,7 +66,7 @@ package { $package_name: ensure => $ensure, - provider => $package_provider, + provider => $_package_provider, install_options => $install_options, } diff --git a/manifests/plugin/iscdhcp.pp b/manifests/plugin/iscdhcp.pp index 78eafbbb1..44a3c9ab7 100644 --- a/manifests/plugin/iscdhcp.pp +++ b/manifests/plugin/iscdhcp.pp @@ -10,29 +10,47 @@ # @param package_provider Optional[String] Passed to package resource. Default: pip # @param provider_proxy Optional[String] Proxy for provider. Default: undef class collectd::plugin::iscdhcp ( - Optional[String] $ensure = 'present', - Optional[Boolean] $manage_package = undef, - Optional[String] $package_name = 'collectd-iscdhcp', - Optional[String] $package_provider = 'pip', - Optional[String] $provider_proxy = undef, + Optional[String] $ensure = 'present', + Optional[Boolean] $manage_package = undef, + Optional[String] $package_name = 'collectd-iscdhcp', + Optional[String] $package_provider = 'pip', + Optional[String] $provider_proxy = undef, ) { include collectd $_manage_package = pick($manage_package, $collectd::manage_package) + if $facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '8' { + $_python_pip_package = 'python3-pip' + if $package_provider =~ Undef { + $_package_provider = 'pip3' + } + else { + $_package_provider = $package_provider + } + } else { + $_python_pip_package = 'python-pip' + if $package_provider =~ Undef { + $_package_provider = 'pip' + } + else { + $_package_provider = $package_provider + } + } + if ($_manage_package) { - if (!defined(Package['python-pip'])) { - package { 'python-pip': ensure => 'present', } + if (!defined(Package[$_python_pip_package])) { + package { $_python_pip_package: ensure => 'present', } Package[$package_name] { - require => Package['python-pip'], + require => Package[$_python_pip_package], } if $facts['os']['family'] == 'RedHat' { # Epel is installed in install.pp if manage_repo is true # python-pip doesn't exist in base for RedHat. Need epel installed first if (defined(Class['::epel'])) { - Package['python-pip'] { + Package[$_python_pip_package] { require => Class['::epel'], } } @@ -48,7 +66,7 @@ package { $package_name: ensure => $ensure, - provider => $package_provider, + provider => $_package_provider, install_options => $install_options, } diff --git a/manifests/plugin/python.pp b/manifests/plugin/python.pp index 4487dd590..9019b02ec 100644 --- a/manifests/plugin/python.pp +++ b/manifests/plugin/python.pp @@ -32,11 +32,17 @@ $ensure_real = 'absent' } - if $facts['os']['name'] == 'Fedora' or $facts['os']['name'] == 'Amazon' { + if $facts['os']['name'] == 'Amazon' or + ($facts['os']['family'] == 'RedHat' and versioncmp($facts['os']['release']['major'],'8') >= 0) { if $_manage_package { package { 'collectd-python': ensure => $ensure_real, } + if (defined(Class['::epel'])) { + Package['collectd-python'] { + require => Class['::epel'], + } + } } } diff --git a/manifests/plugin/rabbitmq.pp b/manifests/plugin/rabbitmq.pp index 368176cfc..7e4252872 100644 --- a/manifests/plugin/rabbitmq.pp +++ b/manifests/plugin/rabbitmq.pp @@ -61,6 +61,10 @@ ) { include collectd + if $facts['os']['family'] == 'RedHat' and versioncmp($facts['os']['release']['major'],'8') >= 0 { + fail('https://pypi.org/project/collectd-rabbitmq/ does not support Python 3') + } + case $facts['os']['family'] { 'RedHat': { $_custom_types_db = '/usr/share/collectd-rabbitmq/types.db.custom' diff --git a/metadata.json b/metadata.json index b9d33f843..02ea1518f 100644 --- a/metadata.json +++ b/metadata.json @@ -3,19 +3,22 @@ { "operatingsystem": "RedHat", "operatingsystemrelease": [ - "7" + "7", + "8" ] }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ - "7" + "7", + "8" ] }, { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ - "7" + "7", + "8" ] }, { diff --git a/spec/acceptance/class_plugin_python_spec.rb b/spec/acceptance/class_plugin_python_spec.rb index 5d486440b..b6936d240 100644 --- a/spec/acceptance/class_plugin_python_spec.rb +++ b/spec/acceptance/class_plugin_python_spec.rb @@ -7,6 +7,8 @@ pp = <<-EOS class{'collectd::plugin::python': } + # Enable one write plugin to make logs quieter + class { 'collectd::plugin::csv':} EOS # Run 3 times since the collectd_version # fact is impossible until collectd is @@ -25,33 +27,42 @@ context 'trivial module' do it 'works idempotently with no errors' do pp = <<-EOS - if $facts['os']['family'] == 'Debian' { + if $facts['os']['family'] == 'Debian' or ( $facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '8' ) { # for collectdctl command package{'collectd-utils': - ensure => present, + ensure => present, } } - package{'python-pip': + if $facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '8' { + $_python_pip_package = 'python3-pip' + $_pip_provider = 'pip3' + } else { + $_python_pip_package = 'python-pip' + $_pip_provider = 'pip' + } + package{$_python_pip_package: ensure => present, } package{['collectd-connect-time']: - ensure => 'present', - provider => 'pip', - require => Package['python-pip'], - before => Service['collectd'], + ensure => 'present', + provider => $_pip_provider, + require => Package[$_python_pip_package], + before => Service['collectd'], } class{'collectd::plugin::python': - logtraces => true, - interactive => false, + logtraces => true, + interactive => false, modules => { 'collectd_connect_time' => { - config => [{'target' => 'google.de'}], - }, - }, + config => [{'target' => 'google.de'}], + }, + }, } class{'collectd::plugin::unixsock': - socketfile => '/var/run/collectd-sock', + socketfile => '/var/run/collectd-sock', + socketgroup => 'root', } + class { 'collectd::plugin::csv':} EOS # Run it twice and test for idempotency @@ -75,39 +86,57 @@ if $facts['os']['family'] == 'Debian' { # for collectdctl command package{['collectd-utils','python-dbus']: - ensure => present, + ensure => present, } } - package{['git','python-pip']: + if $facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '8' { + $_python_pip_package = 'python3-pip' + $_pip_provider = 'pip3' + } else { + $_python_pip_package = 'python-pip' + $_pip_provider = 'pip' + } + + package{['git',$_python_pip_package]: ensure => present, - before => Package['collectd-systemd'], + before => Package['collectd-systemd'], } + # Dependency on dbus for collectd-systemd installed with pip. + # https://github.com/mbachry/collectd-systemd/issues/11 + if $facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '8' { + package{'python3-dbus': + ensure => present, + } + } + package{'collectd-systemd': - ensure => 'present', - provider => 'pip', - source => 'git+https://github.com/mbachry/collectd-systemd.git', - before => Service['collectd'], + ensure => 'present', + provider => $_pip_provider, + source => 'git+https://github.com/mbachry/collectd-systemd.git', + before => Service['collectd'], } class{'collectd': typesdb => ['/usr/share/collectd/types.db'], } class{'collectd::plugin::python': - logtraces => true, - interactive => false, + logtraces => true, + interactive => false, modules => { 'instanceA' => { - module => 'collectd_systemd', - config => [{'Service' => 'collectd'}], - }, + module => 'collectd_systemd', + config => [{'Service' => 'collectd'}], + }, 'instanceB' => { module => 'collectd_systemd', config => [{'Service' => 'sshd'}], - }, - }, + }, + }, } class{'collectd::plugin::unixsock': socketfile => '/var/run/collectd-sock', + socketgroup => 'root', } + class { 'collectd::plugin::csv':} EOS # Run it twice and test for idempotency diff --git a/spec/acceptance/class_spec.rb b/spec/acceptance/class_spec.rb index e4482ddba..bc1c25614 100644 --- a/spec/acceptance/class_spec.rb +++ b/spec/acceptance/class_spec.rb @@ -6,6 +6,8 @@ it 'works idempotently with no errors' do pp = <<-EOS class { 'collectd': } + # Enable one write plugin to make logs quieter + class { 'collectd::plugin::csv':} EOS # Run it twice and test for idempotency @@ -29,7 +31,11 @@ class { '::collectd': } class { '::collectd::plugin::memory': } - class { '::collectd::plugin::rabbitmq': } + # rabbitmq plugin not ported to Python3 + if $facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] != '8' { + class { '::collectd::plugin::rabbitmq': } + } + class { 'collectd::plugin::csv':} EOS # Run it twice and test for idempotency @@ -44,7 +50,7 @@ class { '::collectd::plugin::rabbitmq': } end end - if fact('osfamily') == 'RedHat' + if fact('osfamily') == 'RedHat' && fact('os.release.major') != '8' describe file('/etc/collectd.d/10-rabbitmq.conf') do it { is_expected.to be_file } it { is_expected.to contain 'TypesDB "/usr/share/collectd-rabbitmq/types.db.custom"' } diff --git a/spec/acceptance/curl_json_spec.rb b/spec/acceptance/curl_json_spec.rb index 247f1f3af..4b20aece0 100644 --- a/spec/acceptance/curl_json_spec.rb +++ b/spec/acceptance/curl_json_spec.rb @@ -17,6 +17,9 @@ }, } } + # Adding one write plugin removes a lot + # of confusing/misleading warnings in collectd logs + class { 'collectd::plugin::csv':} EOS # Run it twice and test for idempotency diff --git a/spec/classes/collectd_plugin_rabbitmq_spec.rb b/spec/classes/collectd_plugin_rabbitmq_spec.rb index 9ce97265f..69a8f3b79 100644 --- a/spec/classes/collectd_plugin_rabbitmq_spec.rb +++ b/spec/classes/collectd_plugin_rabbitmq_spec.rb @@ -23,36 +23,41 @@ } end - it 'import collectd_rabbitmq.collectd_plugin in python-config' do - is_expected.to contain_concat_fragment('collectd_plugin_python_conf_collectd_rabbitmq.collectd_plugin_header').with_content(%r{Import "collectd_rabbitmq.collectd_plugin"}) - end - - it 'Load collectd_rabbitmq in python-config' do - is_expected.to contain_concat_fragment('collectd_plugin_python_conf_collectd_rabbitmq.collectd_plugin_config').with_content(%r{Module "collectd_rabbitmq.collectd_plugin"}) - end - - it 'default to Username guest in python-config' do - is_expected.to contain_concat_fragment('collectd_plugin_python_conf_collectd_rabbitmq.collectd_plugin_config').with_content(%r{Username "guest"}) - end - - it 'default to Password guest in python-config' do - is_expected.to contain_concat_fragment('collectd_plugin_python_conf_collectd_rabbitmq.collectd_plugin_config').with_content(%r{Password "guest"}) - end - - it 'default to Port 15672 in python-config' do - is_expected.to contain_concat_fragment('collectd_plugin_python_conf_collectd_rabbitmq.collectd_plugin_config').with_content(%r{Port "15672"}) - end - - it 'default to Scheme http in python-config' do - is_expected.to contain_concat_fragment('collectd_plugin_python_conf_collectd_rabbitmq.collectd_plugin_config').with_content(%r{Scheme "http"}) - end - - it 'Host should be set to $::fqdn python-config' do - is_expected.to contain_concat_fragment('collectd_plugin_python_conf_collectd_rabbitmq.collectd_plugin_config').with_content(%r{Host "testhost.example.com"}) - end - - it 'Realm set to "RabbitMQ Management"' do - is_expected.to contain_concat_fragment('collectd_plugin_python_conf_collectd_rabbitmq.collectd_plugin_config').with_content(%r{Realm "RabbitMQ Management"}) + case [facts[:os]['family'], facts[:os]['release']['major']] + when %w[RedHat 8] + it { is_expected.to raise_error(%r{does not support Python 3}) } + else + it 'import collectd_rabbitmq.collectd_plugin in python-config' do + is_expected.to contain_concat_fragment('collectd_plugin_python_conf_collectd_rabbitmq.collectd_plugin_header').with_content(%r{Import "collectd_rabbitmq.collectd_plugin"}) + end + + it 'Load collectd_rabbitmq in python-config' do + is_expected.to contain_concat_fragment('collectd_plugin_python_conf_collectd_rabbitmq.collectd_plugin_config').with_content(%r{Module "collectd_rabbitmq.collectd_plugin"}) + end + + it 'default to Username guest in python-config' do + is_expected.to contain_concat_fragment('collectd_plugin_python_conf_collectd_rabbitmq.collectd_plugin_config').with_content(%r{Username "guest"}) + end + + it 'default to Password guest in python-config' do + is_expected.to contain_concat_fragment('collectd_plugin_python_conf_collectd_rabbitmq.collectd_plugin_config').with_content(%r{Password "guest"}) + end + + it 'default to Port 15672 in python-config' do + is_expected.to contain_concat_fragment('collectd_plugin_python_conf_collectd_rabbitmq.collectd_plugin_config').with_content(%r{Port "15672"}) + end + + it 'default to Scheme http in python-config' do + is_expected.to contain_concat_fragment('collectd_plugin_python_conf_collectd_rabbitmq.collectd_plugin_config').with_content(%r{Scheme "http"}) + end + + it 'Host should be set to $::fqdn python-config' do + is_expected.to contain_concat_fragment('collectd_plugin_python_conf_collectd_rabbitmq.collectd_plugin_config').with_content(%r{Host "testhost.example.com"}) + end + + it 'Realm set to "RabbitMQ Management"' do + is_expected.to contain_concat_fragment('collectd_plugin_python_conf_collectd_rabbitmq.collectd_plugin_config').with_content(%r{Realm "RabbitMQ Management"}) + end end end @@ -61,8 +66,13 @@ { custom_types_db: '/var/custom/types.db' } end - it 'override custom TypesDB' do - is_expected.to contain_file('rabbitmq.load').with_content(%r{TypesDB "/var/custom/types.db"}) + case [facts[:os]['family'], facts[:os]['release']['major']] + when %w[RedHat 8] + it { is_expected.to raise_error(%r{does not support Python 3}) } + else + it 'override custom TypesDB' do + is_expected.to contain_file('rabbitmq.load').with_content(%r{TypesDB "/var/custom/types.db"}) + end end end @@ -71,8 +81,13 @@ { config: { 'Username' => 'foo' } } end - it 'override Username to foo in python-config' do - is_expected.to contain_concat_fragment('collectd_plugin_python_conf_collectd_rabbitmq.collectd_plugin_config').with_content(%r{Username "foo"}) + case [facts[:os]['family'], facts[:os]['release']['major']] + when %w[RedHat 8] + it { is_expected.to raise_error(%r{does not support Python 3}) } + else + it 'override Username to foo in python-config' do + is_expected.to contain_concat_fragment('collectd_plugin_python_conf_collectd_rabbitmq.collectd_plugin_config').with_content(%r{Username "foo"}) + end end end @@ -81,8 +96,13 @@ { config: { 'Password' => 'foo' } } end - it 'override Username to foo in python-config' do - is_expected.to contain_concat_fragment('collectd_plugin_python_conf_collectd_rabbitmq.collectd_plugin_config').with_content(%r{Password "foo"}) + case [facts[:os]['family'], facts[:os]['release']['major']] + when %w[RedHat 8] + it { is_expected.to raise_error(%r{does not support Python 3}) } + else + it 'override Username to foo in python-config' do + is_expected.to contain_concat_fragment('collectd_plugin_python_conf_collectd_rabbitmq.collectd_plugin_config').with_content(%r{Password "foo"}) + end end end @@ -91,8 +111,13 @@ { config: { 'Scheme' => 'https' } } end - it 'override Username to foo in python-config' do - is_expected.to contain_concat_fragment('collectd_plugin_python_conf_collectd_rabbitmq.collectd_plugin_config').with_content(%r{Scheme "https"}) + case [facts[:os]['family'], facts[:os]['release']['major']] + when %w[RedHat 8] + it { is_expected.to raise_error(%r{does not support Python 3}) } + else + it 'override Username to foo in python-config' do + is_expected.to contain_concat_fragment('collectd_plugin_python_conf_collectd_rabbitmq.collectd_plugin_config').with_content(%r{Scheme "https"}) + end end end end @@ -102,8 +127,13 @@ { ensure: 'absent' } end - it 'Will remove python-config' do - is_expected.not_to contain_concat__fragment('collectd_plugin_python_conf_collectd_rabbitmq.collectd_plugin_config').with(ensure: 'present') + case [facts[:os]['family'], facts[:os]['release']['major']] + when %w[RedHat 8] + it { is_expected.to raise_error(%r{does not support Python 3}) } + else + it 'Will remove python-config' do + is_expected.not_to contain_concat__fragment('collectd_plugin_python_conf_collectd_rabbitmq.collectd_plugin_config').with(ensure: 'present') + end end end @@ -124,11 +154,16 @@ } end - it do - is_expected.to contain_package(packagename).with( - 'ensure' => ensure_value, - 'provider' => provider - ) + case [facts[:os]['family'], facts[:os]['release']['major']] + when %w[RedHat 8] + it { is_expected.to raise_error(%r{does not support Python 3}) } + else + it do + is_expected.to contain_package(packagename).with( + 'ensure' => ensure_value, + 'provider' => provider + ) + end end end # packagename end # ensure set diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index fe6f8a8c0..b352e554b 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -5,6 +5,8 @@ run_puppet_install_helper unless ENV['BEAKER_provision'] == 'no' +on 'debian', 'apt-get -y install apt-transport-https' + RSpec.configure do |c| # Readable test descriptions c.formatter = :documentation @@ -16,7 +18,13 @@ hosts.each do |host| # python is pre-requisite to the python_path fact. - host.install_package('python') + # apt-transport-https is pre-requisite for https repos. + case host['platform'] + when %r{el-8} + host.install_package('python3') + else + host.install_package('python') + end end end end diff --git a/spec/spec_helper_methods.rb b/spec/spec_helper_methods.rb index ffbb578b9..b078aec87 100644 --- a/spec/spec_helper_methods.rb +++ b/spec/spec_helper_methods.rb @@ -24,11 +24,11 @@ def all_supported_os_hash }, { 'operatingsystem' => 'CentOS', - 'operatingsystemrelease' => ['7'] + 'operatingsystemrelease' => %w[7 8] }, { 'operatingsystem' => 'Ubuntu', - 'operatingsystemrelease' => ['16.04', '18.04'] + 'operatingsystemrelease' => %w[16.04 18.04] }, { 'operatingsystem' => 'FreeBSD', @@ -46,7 +46,7 @@ def baseline_os_hash supported_os: [ { 'operatingsystem' => 'CentOS', - 'operatingsystemrelease' => ['7'] + 'operatingsystemrelease' => %w[7 8] } ] }