Skip to content

Commit

Permalink
Add CentOS 8 support
Browse files Browse the repository at this point in the history
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.

collectd/collectd-ci#35
  • Loading branch information
traylenator committed Mar 6, 2020
1 parent 6d74352 commit 972c089
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 8 deletions.
1 change: 1 addition & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
9 changes: 6 additions & 3 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,22 @@
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"7"
"7",
"8"
]
},
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"7"
"7",
"8"
]
},
{
"operatingsystem": "OracleLinux",
"operatingsystemrelease": [
"7"
"7",
"8"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/class_plugin_python_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
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'] != '7' ) {
# for collectdctl command
package{'collectd-utils':
ensure => present,
Expand Down
6 changes: 3 additions & 3 deletions spec/spec_helper_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -46,7 +46,7 @@ def baseline_os_hash
supported_os: [
{
'operatingsystem' => 'CentOS',
'operatingsystemrelease' => ['7']
'operatingsystemrelease' => %w[7 8]
}
]
}
Expand Down

0 comments on commit 972c089

Please sign in to comment.