diff --git a/.fixtures.yml b/.fixtures.yml index 579193a4..401b0a0f 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -12,6 +12,4 @@ fixtures: repo: 'https://github.com/puppetlabs/puppetlabs-selinux_core' puppet_version: '>= 6.0.0' stdlib: 'https://github.com/puppetlabs/puppetlabs-stdlib' - systemd: - repo: 'https://github.com/camptocamp/puppet-systemd' - ref: '2.12.0' + systemd: 'https://github.com/camptocamp/puppet-systemd' diff --git a/manifests/service.pp b/manifests/service.pp index e436e9d8..d07aa05d 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -28,11 +28,21 @@ content => template('pulpcore/pulpcore-worker@.service.erb'), } + # In camptocamp/systemd 3.0.0 support for Puppet < 6.1.0 was dropped. + # This means there is no single daemon-reload class anymore. This also means + # there is no more relation that ensures all services are loaded prior to running them. + $metadata = load_module_metadata('systemd') + if SemVer($metadata['version']) >= SemVer('3.0.0') { + $reload_require = undef + } else { + $reload_require = Class['systemd::systemctl::daemon_reload'] + } + Integer[1, $pulpcore::worker_count].each |$n| { service { "pulpcore-worker@${n}.service": ensure => $pulpcore::service_ensure, enable => $pulpcore::service_enable, - require => Class['systemd::systemctl::daemon_reload'], + require => $reload_require, subscribe => Systemd::Unit_file['pulpcore-worker@.service'], } } @@ -44,7 +54,7 @@ service { $worker: ensure => false, enable => false, - require => [Systemd::Unit_file['pulpcore-worker@.service'], Class['systemd::systemctl::daemon_reload']], + require => [Systemd::Unit_file['pulpcore-worker@.service'], $reload_require], } } } diff --git a/metadata.json b/metadata.json index 9917f60b..00eb0589 100644 --- a/metadata.json +++ b/metadata.json @@ -28,7 +28,7 @@ }, { "name": "camptocamp/systemd", - "version_requirement": ">= 2.2.0 < 3.0.0" + "version_requirement": ">= 2.2.0 < 4.0.0" }, { "name": "puppet/extlib",