Showing with 72 additions and 57 deletions.
  1. +1 −1 .fixtures.yml
  2. +1 −1 .github/workflows/ci.yml
  3. +21 −0 CHANGELOG.md
  4. +2 −1 Gemfile
  5. +19 −3 Rakefile
  6. +5 −16 manifests/init.pp
  7. +4 −11 manifests/params.pp
  8. +3 −7 metadata.json
  9. +1 −7 spec/classes/init_spec.rb
  10. +15 −8 templates/debian/default_isc-dhcp-server
  11. +0 −2 templates/redhat/sysconfig-dhcpd
2 changes: 1 addition & 1 deletion .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ fixtures:
puppet_version: '>= 6.0.0'
concat: 'https://github.com/puppetlabs/puppetlabs-concat'
stdlib: 'https://github.com/puppetlabs/puppetlabs-stdlib.git'
systemd: 'https://github.com/camptocamp/puppet-systemd'
systemd: 'https://github.com/voxpupuli/puppet-systemd'
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
puppet_major_versions: ${{ steps.get_outputs.outputs.puppet_major_versions }}
puppet_unit_test_matrix: ${{ steps.get_outputs.outputs.puppet_unit_test_matrix }}
env:
BUNDLE_WITHOUT: development:release
BUNDLE_WITHOUT: development:system_tests:release
steps:
- uses: actions/checkout@v2
- name: Setup ruby
Expand Down
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## [8.0.0](https://github.com/theforeman/puppet-dhcp/tree/8.0.0) (2021-10-29)

[Full Changelog](https://github.com/theforeman/puppet-dhcp/compare/7.0.0...8.0.0)

**Breaking changes:**

- Drop EL6 support [\#198](https://github.com/theforeman/puppet-dhcp/pull/198) ([ekohl](https://github.com/ekohl))
- Drop Debian 8 support and update default template [\#197](https://github.com/theforeman/puppet-dhcp/pull/197) ([ekohl](https://github.com/ekohl))

**Implemented enhancements:**

- Depend on camptocamp/systemd ~\> 3.1 [\#202](https://github.com/theforeman/puppet-dhcp/pull/202) ([ekohl](https://github.com/ekohl))

**Fixed bugs:**

- Ensure systemd drop-in happens before service [\#199](https://github.com/theforeman/puppet-dhcp/pull/199) ([ekohl](https://github.com/ekohl))

**Closed issues:**

- Use of notify\_service requires systemd dependency version bump [\#201](https://github.com/theforeman/puppet-dhcp/issues/201)

## [7.0.0](https://github.com/theforeman/puppet-dhcp/tree/7.0.0) (2021-07-23)

[Full Changelog](https://github.com/theforeman/puppet-dhcp/compare/6.2.0...7.0.0)
Expand Down
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ gem 'puppet-lint-param-docs', '>= 1.3.0', {"groups"=>["test"]}
gem 'puppet-lint-spaceship_operator_without_tag-check', {"groups"=>["test"]}
gem 'puppet-lint-strict_indent-check', {"groups"=>["test"]}
gem 'puppet-lint-undef_in_function-check', {"groups"=>["test"]}
gem 'voxpupuli-test', '~> 1.4'
gem 'voxpupuli-test', '~> 1.4', {"groups"=>["test"]}
gem 'github_changelog_generator', '>= 1.15.0', {"groups"=>["development"]}
gem 'puppet_metadata', '~> 0.3'
gem 'puppet-blacksmith', '>= 6.0.0', {"groups"=>["development"]}
gem 'voxpupuli-acceptance', '~> 1.0', {"groups"=>["system_tests"]}
gem 'puppetlabs_spec_helper', {"groups"=>["system_tests"]}

# vim:ft=ruby
22 changes: 19 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
# This file is managed centrally by modulesync
# https://github.com/theforeman/foreman-installer-modulesync

require 'voxpupuli/test/rake'
# Attempt to load voxupuli-test (which pulls in puppetlabs_spec_helper),
# otherwise attempt to load it directly.
begin
require 'voxpupuli/test/rake'
rescue LoadError
begin
require 'puppetlabs_spec_helper/rake_tasks'
rescue LoadError
end
end

# We use fixtures in our modules, which is not the default
task :beaker => 'spec_prep'
# load optional tasks for acceptance
# only available if gem group releases is installed
begin
require 'voxpupuli/acceptance/rake'
rescue LoadError
else
# We use fixtures in our modules, which is not the default
task :beaker => 'spec_prep'
end

# blacksmith isn't always present, e.g. on Travis with --without development
begin
Expand Down
21 changes: 5 additions & 16 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -98,22 +98,11 @@
}
}
'RedHat': {
if versioncmp($facts['os']['release']['major'], '7') >= 0 {
include systemd
systemd::dropin_file { 'interfaces.conf':
unit => 'dhcpd.service',
content => template('dhcp/redhat/systemd-dropin.conf.erb'),
}
} else {
file { '/etc/sysconfig/dhcpd':
ensure => file,
owner => 'root',
group => 'root',
mode => '0644',
before => Package[$packagename],
notify => Service[$servicename],
content => template('dhcp/redhat/sysconfig-dhcpd'),
}
include systemd
systemd::dropin_file { 'interfaces.conf':
unit => 'dhcpd.service',
content => template('dhcp/redhat/systemd-dropin.conf.erb'),
notify_service => true,
}
}
/^(FreeBSD|DragonFly)$/: {
Expand Down
15 changes: 4 additions & 11 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,10 @@
}
$servicename = 'dhcpd'
$root_group = 'root'
if $facts['os']['release']['full'] =~ /^[0-6]\./ {
$bootfiles = {
'00:07' => 'grub/grubx64.efi',
'00:09' => 'grub/grubx64.efi',
}
} else {
$bootfiles = {
'00:06' => 'grub2/shim.efi',
'00:07' => 'grub2/shim.efi',
'00:09' => 'grub2/shim.efi',
}
$bootfiles = {
'00:06' => 'grub2/shim.efi',
'00:07' => 'grub2/shim.efi',
'00:09' => 'grub2/shim.efi',
}
}

Expand Down
10 changes: 3 additions & 7 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "theforeman-dhcp",
"version": "7.0.0",
"version": "8.0.0",
"author": "theforeman",
"summary": "Manage the ISC DHCP daemon",
"license": "Apache-2.0",
Expand All @@ -16,8 +16,8 @@
],
"dependencies": [
{
"name": "camptocamp/systemd",
"version_requirement": ">= 1.0.0 < 4.0.0"
"name": "puppet/systemd",
"version_requirement": ">= 3.1.0 < 4.0.0"
},
{
"name": "puppetlabs/concat",
Expand All @@ -38,23 +38,20 @@
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"6",
"7",
"8"
]
},
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"6",
"7",
"8"
]
},
{
"operatingsystem": "Scientific",
"operatingsystemrelease": [
"6",
"7"
]
},
Expand All @@ -68,7 +65,6 @@
{
"operatingsystem": "Debian",
"operatingsystemrelease": [
"8",
"9",
"10"
]
Expand Down
8 changes: 1 addition & 7 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,12 @@

it { is_expected.not_to contain_concat__fragment('dhcp.conf+20_includes') }

if facts[:osfamily] == 'RedHat' && facts[:operatingsystemmajrelease].to_i >= 7
if facts[:osfamily] == 'RedHat'
it { is_expected.to contain_systemd__dropin_file('interfaces.conf') }
else
it { is_expected.not_to contain_systemd__dropin_file('interfaces.conf') }
end

if facts[:osfamily] == 'RedHat' && facts[:operatingsystemmajrelease].to_i < 7
it { is_expected.to contain_file('/etc/sysconfig/dhcpd') }
else
it { is_expected.not_to contain_file('/etc/sysconfig/dhcpd') }
end

if facts[:osfamily] == 'Debian'
it { is_expected.to contain_file('/etc/default/isc-dhcp-server') }
else
Expand Down
23 changes: 15 additions & 8 deletions templates/debian/default_isc-dhcp-server
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
# Defaults for dhcp initscript
# sourced by /etc/init.d/dhcp
# installed at /etc/default/isc-dhcp-server by the maintainer scripts
# Defaults for isc-dhcp-server (sourced by /etc/init.d/isc-dhcp-server)

#
# This is a POSIX shell fragment
#
# Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf).
DHCPDv4_CONF=<%= @dhcp_dir %>/dhcpd.conf
#DHCPDv6_CONF=/etc/dhcp/dhcpd6.conf

# Path to dhcpd's PID file (default: /var/run/dhcpd.pid).
#DHCPDv4_PID=/var/run/dhcpd.pid
#DHCPDv6_PID=/var/run/dhcpd6.pid

# Additional options to start dhcpd with.
# Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead
#OPTIONS=""

# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES="<%= @dhcp_interfaces.join(' ') %>"
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACESv4="<%= @dhcp_interfaces.join(' ') %>"
INTERFACESv6=""
2 changes: 0 additions & 2 deletions templates/redhat/sysconfig-dhcpd

This file was deleted.