Skip to content

Commit

Permalink
Update deps to use puppet/systemd (#81)
Browse files Browse the repository at this point in the history
This patch updates from camptocamp/systemd 2.x to puppet/systemd 3.x

This bump is driven by simp/simp-core#829

`daemon_reload` no longer needed as of Puppet 6.1.0, and it was dropped
in `puppet/camptocamp` 3.0[1]

[1]: voxpupuli/puppet-systemd#171
  • Loading branch information
op-ct authored Jun 11, 2022
1 parent 46af393 commit 0c673ab
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 13 deletions.
4 changes: 3 additions & 1 deletion .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ fixtures:
simp_options: https://github.com/simp/pupmod-simp-simp_options.git
simplib: https://github.com/simp/pupmod-simp-simplib.git
stdlib: https://github.com/simp/puppetlabs-stdlib.git
systemd: https://github.com/simp/puppet-systemd.git
systemd:
repo: https://github.com/simp/puppet-systemd.git
branch: simp-master
vox_selinux:
repo: https://github.com/simp/pupmod-voxpupuli-selinux.git
branch: simp-master
Expand Down
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
.idea/
dist
/pkg
/spec/fixtures
# Read everything in fixtures
/spec/fixtures/*
# Un-ignore hieradata
!/spec/fixtures/hieradata/*
# Except this one, which is auto-generated
/spec/fixtures/hieradata/hiera.yaml
/spec/rp_env
/.rspec_system
/.vagrant
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* Fri Jun 03 2022 Chris Tessmer <[email protected]> - 2.8.0
- Update from camptocamp/systemd to puppet/systemd

* Wed Jun 16 2021 Chris Tessmer <[email protected]> - 2.7.0
- Removed support for Puppet 5
- Ensured support for Puppet 7 in requirements and stdlib
Expand Down
3 changes: 1 addition & 2 deletions manifests/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@
$_proc_gid = $facts.dig('simplib__mountpoints', '/proc', 'options_hash', 'gid')

if $_proc_gid {
simplib::assert_optional_dependency($module_name, 'camptocamp/systemd')
simplib::assert_optional_dependency($module_name, 'puppet/systemd')

systemd::dropin_file { "${module_name}_mcstransd_hidepid_add_gid.conf":
unit => "${selinux::mcstrans_service_name}.service",
notify => Service[$selinux::mcstrans_service_name],
daemon_reload => 'eager',
content => @("SYSTEMD_OVERRIDE")
[Service]
SupplementaryGroups=${_proc_gid}
Expand Down
6 changes: 3 additions & 3 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simp-selinux",
"version": "2.7.0",
"version": "2.8.0",
"author": "SIMP Team",
"summary": "manages the SELinux system state",
"license": "Apache-2.0",
Expand Down Expand Up @@ -29,8 +29,8 @@
"simp": {
"optional_dependencies": [
{
"name": "camptocamp/systemd",
"version_requirement": ">= 2.2.0 < 3.0.0"
"name": "puppet/systemd",
"version_requirement": ">= 3.0.0 < 4.0.0"
}
]
},
Expand Down
8 changes: 4 additions & 4 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@
SELINUXTYPE=targeted
EOF
) }
it { is_expected.to contain_package('checkpolicy').with(ensure: 'present') }
it { is_expected.to contain_package('checkpolicy').with_ensure(/\A(present|installed)\Z/) }
it { is_expected.not_to contain_package('mcstrans') }
it { is_expected.not_to contain_service('mcstransd') }

if os_facts[:os][:release][:major].to_i >= 7
it { is_expected.not_to contain_package(policycoreutils_package) }
it { is_expected.not_to create_service('restorecond') }
else
it { is_expected.to contain_package(policycoreutils_package).with(ensure: 'present') }
it { is_expected.to contain_package(policycoreutils_package).with_ensure(/\A(present|installed)\Z/) }
it { is_expected.to create_service('restorecond').with({
enable: true,
ensure: 'running'
Expand All @@ -54,7 +54,7 @@
}
end

it { is_expected.to contain_package('mcstrans').with(ensure: 'present') }
it { is_expected.to contain_package('mcstrans').with_ensure(/\A(present|installed)\Z/) }

it { is_expected.to create_service(mcstrans_service).with({
enable: true,
Expand Down Expand Up @@ -151,7 +151,7 @@
EOF
) }

it { is_expected.to contain_package(policycoreutils_package).with(ensure: 'present') }
it { is_expected.to contain_package(policycoreutils_package).with_ensure(/\A(present|installed)\Z/) }

it { is_expected.to create_service('restorecond').with(
enable: true,
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/install_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
os_facts[:os][:release][:major].to_i >= 7 ? 'policycoreutils-restorecond' : 'policycoreutils'
end

it { is_expected.to contain_package('checkpolicy').with(ensure: 'present') }
it { is_expected.to contain_package('checkpolicy').with(ensure: /\A(present|installed)\Z/) }
it { is_expected.not_to contain_package('mcstrans') }

if os_facts[:os][:release][:major].to_i >= 7
Expand All @@ -31,7 +31,7 @@
}
end

it { is_expected.to contain_package('mcstrans').with(ensure: 'present') }
it { is_expected.to contain_package('mcstrans').with_ensure(/\A(present|installed)\Z/) }
end
end
end
Expand Down

0 comments on commit 0c673ab

Please sign in to comment.