From 2b09e41df1182259179df8adcea5b514c425acce Mon Sep 17 00:00:00 2001 From: Dennis Hoppe Date: Fri, 10 Jan 2020 14:10:58 +0100 Subject: [PATCH 1/2] Add support for RHEL/CentOS 8 and Debian 10 --- .sync.yml | 10 ++++++---- .travis.yml | 36 ++++++++++++++++++++++++++---------- manifests/init.pp | 2 +- manifests/params.pp | 6 +++++- metadata.json | 25 ++++++++++++++----------- 5 files changed, 52 insertions(+), 27 deletions(-) diff --git a/.sync.yml b/.sync.yml index 865a3bee7..c26ffe481 100644 --- a/.sync.yml +++ b/.sync.yml @@ -2,9 +2,11 @@ .travis.yml: secure: "xwp69Nk5akckY84I/UecQOJx1guhKFscwR16AURDw/A2oO6uY2T8iHqWN+i0jrQ4rB+EZK76dTvDZiNIOBByPc0GC4Hn53L2wy0uEz41Sd/Ys4gZviIFjY81y2jEeFa2MFPAI5KWCBFk4vPOoT8raYpkBA37ux6kvm2bemmqqSQ=" docker_sets: - - set: ubuntu1804-64 - - set: ubuntu1604-64 - - set: centos7-64 - set: centos6-64 - - set: debian9-64 + - set: centos7-64 + - set: centos8-64 - set: debian8-64 + - set: debian9-64 + - set: debian10-64 + - set: ubuntu1604-64 + - set: ubuntu1804-64 diff --git a/.travis.yml b/.travis.yml index dac86f25c..d9f54abc3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,35 +24,35 @@ matrix: env: PUPPET_VERSION="~> 5.0" CHECK=build DEPLOY_TO_FORGE=yes - rvm: 2.5.3 bundler_args: --without development release - env: PUPPET_INSTALL_TYPE=agent BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=ubuntu1804-64 BEAKER_HYPERVISOR=docker CHECK=beaker + env: PUPPET_INSTALL_TYPE=agent BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=centos6-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=ubuntu1804-64 BEAKER_HYPERVISOR=docker CHECK=beaker + env: PUPPET_INSTALL_TYPE=agent BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=centos6-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=ubuntu1604-64 BEAKER_HYPERVISOR=docker CHECK=beaker + env: PUPPET_INSTALL_TYPE=agent BEAKER_PUPPET_COLLECTION=puppet5 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=puppet6 BEAKER_debug=true BEAKER_setfile=ubuntu1604-64 BEAKER_HYPERVISOR=docker CHECK=beaker + 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=centos7-64 BEAKER_HYPERVISOR=docker CHECK=beaker + 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=centos7-64 BEAKER_HYPERVISOR=docker CHECK=beaker + 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=centos6-64 BEAKER_HYPERVISOR=docker CHECK=beaker + env: PUPPET_INSTALL_TYPE=agent BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=debian8-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=centos6-64 BEAKER_HYPERVISOR=docker CHECK=beaker + env: PUPPET_INSTALL_TYPE=agent BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=debian8-64 BEAKER_HYPERVISOR=docker CHECK=beaker services: docker - rvm: 2.5.3 bundler_args: --without development release @@ -64,11 +64,27 @@ matrix: 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 + env: PUPPET_INSTALL_TYPE=agent BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=debian10-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=debian8-64 BEAKER_HYPERVISOR=docker CHECK=beaker + env: PUPPET_INSTALL_TYPE=agent BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=debian10-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=ubuntu1604-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=ubuntu1604-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=ubuntu1804-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=ubuntu1804-64 BEAKER_HYPERVISOR=docker CHECK=beaker services: docker branches: only: diff --git a/manifests/init.pp b/manifests/init.pp index f176c9f39..eb7b49b15 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -164,7 +164,7 @@ case $facts['os']['family'] { 'RedHat': { - if $facts['os']['release']['major'] == '7' { + if $facts['os']['release']['major'] =~ /(7|8)/ { $use_systemd_service_file = true } else { $use_systemd_service_file = false diff --git a/manifests/params.pp b/manifests/params.pp index b41ef435b..10cb009c4 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -34,7 +34,11 @@ } 'RedHat': { $dhcp_dir = '/etc/dhcp' - $packagename = 'dhcp' + if $facts['os']['release']['major'] == '8' { + $packagename = 'dhcp-server' + } else { + $packagename = 'dhcp' + } $servicename = 'dhcpd' $package_provider = undef $dhcpd_binary = '/usr/sbin/dhcpd' diff --git a/metadata.json b/metadata.json index 382a1f322..cda261bb7 100644 --- a/metadata.json +++ b/metadata.json @@ -18,36 +18,39 @@ } ], "operatingsystem_support": [ + { + "operatingsystem": "Archlinux" + }, { "operatingsystem": "RedHat", "operatingsystemrelease": [ "6", - "7" + "7", + "8" ] }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ "6", - "7" - ] - }, - { - "operatingsystem": "Ubuntu", - "operatingsystemrelease": [ - "16.04", - "18.04" + "7", + "8" ] }, { "operatingsystem": "Debian", "operatingsystemrelease": [ "8", - "9" + "9", + "10" ] }, { - "operatingsystem": "Archlinux" + "operatingsystem": "Ubuntu", + "operatingsystemrelease": [ + "16.04", + "18.04" + ] } ], "requirements": [ From 55cb535e22e1a446d97cb1e6a407a40d08038fb2 Mon Sep 17 00:00:00 2001 From: Dennis Hoppe Date: Wed, 22 Jan 2020 12:42:04 +0100 Subject: [PATCH 2/2] Add missing facts --- spec/defines/dhcp_class_spec.rb | 6 ++++-- spec/defines/host_spec.rb | 6 ++++-- spec/defines/ignoredsubnet_spec.rb | 6 ++++-- spec/defines/pool6_spec.rb | 6 ++++-- spec/defines/pool_spec.rb | 6 ++++-- 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/spec/defines/dhcp_class_spec.rb b/spec/defines/dhcp_class_spec.rb index d16a6094d..21b4836b0 100644 --- a/spec/defines/dhcp_class_spec.rb +++ b/spec/defines/dhcp_class_spec.rb @@ -5,8 +5,10 @@ let(:header) { ['#################################', "# Custom class #{title}", '#################################'] } let(:facts) do { - osfamily: 'RedHat', - os: { family: 'RedHat' } + os: { + family: 'RedHat', + release: { major: '8' } + } } end diff --git a/spec/defines/host_spec.rb b/spec/defines/host_spec.rb index 69dfc82fc..43e59d67e 100644 --- a/spec/defines/host_spec.rb +++ b/spec/defines/host_spec.rb @@ -7,8 +7,10 @@ let(:facts) do { concat_basedir: '/dne', - osfamily: 'RedHat', - os: { family: 'RedHat' } + os: { + family: 'RedHat', + release: { major: '8' } + } } end diff --git a/spec/defines/ignoredsubnet_spec.rb b/spec/defines/ignoredsubnet_spec.rb index fa51a5918..5eaa8f966 100644 --- a/spec/defines/ignoredsubnet_spec.rb +++ b/spec/defines/ignoredsubnet_spec.rb @@ -7,8 +7,10 @@ let(:facts) do { concat_basedir: '/dne', - osfamily: 'RedHat', - os: { family: 'RedHat' } + os: { + family: 'RedHat', + release: { major: '8' } + } } end let :default_params do diff --git a/spec/defines/pool6_spec.rb b/spec/defines/pool6_spec.rb index f5a261427..23f1d7091 100644 --- a/spec/defines/pool6_spec.rb +++ b/spec/defines/pool6_spec.rb @@ -7,8 +7,10 @@ let(:facts) do { concat_basedir: '/dne', - osfamily: 'RedHat', - os: { family: 'RedHat' } + os: { + family: 'RedHat', + release: { major: '8' } + } } end let :params do diff --git a/spec/defines/pool_spec.rb b/spec/defines/pool_spec.rb index 442ec815b..373f104c8 100644 --- a/spec/defines/pool_spec.rb +++ b/spec/defines/pool_spec.rb @@ -7,8 +7,10 @@ let(:facts) do { concat_basedir: '/dne', - osfamily: 'RedHat', - os: { family: 'RedHat' } + os: { + family: 'RedHat', + release: { major: '8' } + } } end let :params do