Skip to content

Commit

Permalink
Removing SystemD reloading step by a special class from camptocamp/sy…
Browse files Browse the repository at this point in the history
…stemd module, because the class was deprecated by the change voxpupuli/puppet-systemd#171
  • Loading branch information
Eugeny Kisel committed May 18, 2021
1 parent 3546820 commit 403f0c6
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 13 deletions.
3 changes: 1 addition & 2 deletions manifests/broker/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@
}

File["/etc/systemd/system/${service_name}.service"]
~> Exec['systemctl-daemon-reload']
-> Service[$service_name]
~> Service[$service_name]
} else {
file { "/etc/init.d/${service_name}":
ensure => file,
Expand Down
3 changes: 1 addition & 2 deletions manifests/consumer/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@
}

File["/etc/systemd/system/${service_name}.service"]
~> Exec['systemctl-daemon-reload']
-> Service[$service_name]
~> Service[$service_name]
} else {
file { "/etc/init.d/${service_name}":
ensure => file,
Expand Down
3 changes: 1 addition & 2 deletions manifests/mirror/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@
}

File["/etc/systemd/system/${service_name}.service"]
~> Exec['systemctl-daemon-reload']
-> Service[$service_name]
~> Service[$service_name]
} else {
file { "/etc/init.d/${service_name}":
ensure => file,
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
{
"name": "camptocamp/systemd",
"version_requirement": ">= 0.4.0 < 3.0.0"
"version_requirement": ">= 0.4.0 <= 3.0.0"
}
],
"operatingsystem_support": [
Expand Down
2 changes: 0 additions & 2 deletions spec/classes/broker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,10 @@
context 'defaults' do
if os_facts[:service_provider] == 'systemd'
it { is_expected.to contain_file('/etc/init.d/kafka').with_ensure('absent') }
it { is_expected.to contain_file('/etc/systemd/system/kafka.service').that_notifies('Exec[systemctl-daemon-reload]') }
it { is_expected.to contain_file('/etc/systemd/system/kafka.service').with_content %r{^After=network\.target syslog\.target$} }
it { is_expected.to contain_file('/etc/systemd/system/kafka.service').with_content %r{^Wants=network\.target syslog\.target$} }
it { is_expected.not_to contain_file('/etc/systemd/system/kafka.service').with_content %r{^LimitNOFILE=} }
it { is_expected.not_to contain_file('/etc/systemd/system/kafka.service').with_content %r{^LimitCORE=} }
it { is_expected.to contain_exec('systemctl-daemon-reload').that_comes_before('Service[kafka]') }
else
it { is_expected.to contain_file('/etc/init.d/kafka') }
end
Expand Down
2 changes: 0 additions & 2 deletions spec/classes/consumer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
context 'defaults' do
if os_facts[:service_provider] == 'systemd'
it { is_expected.to contain_file('/etc/init.d/kafka-consumer').with_abent('absent') }
it { is_expected.to contain_file('/etc/systemd/system/kafka-consumer.service').that_notifies('Exec[systemctl-daemon-relad]') }
it { is_expected.to contain_exec('systemctl-daemon-reload').that_comes_before('Service[kafka-consumer]') }
else
it { is_expected.to contain_file('/etc/init.d/kafka-consumer') }
end
Expand Down
2 changes: 0 additions & 2 deletions spec/classes/mirror_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@
context 'defaults' do
if os_facts[:service_provider] == 'systemd'
it { is_expected.to contain_file('/etc/init.d/kafka-mirror').with_ensure('absent') }
it { is_expected.to contain_file('/etc/systemd/system/kafka-mirror.service').that_notifies('Exec[systemctl-daemon-reload]') }
it { is_expected.to contain_file('/etc/systemd/system/kafka-mirror.service').with_content %r{/opt/kafka/config/(?=.*consumer)|(?=.*producer).propertie} }
it { is_expected.to contain_exec('systemctl-daemon-reload').that_comes_before('Service[kafka-mirror]') }
else
it { is_expected.to contain_file('/etc/init.d/kafka-mirror') }
it { is_expected.to contain_file('/etc/init.d/kafka-mirror').with_content %r{/opt/kafka/config/(?=.*consumer)|(?=.*producer).properties} }
Expand Down

0 comments on commit 403f0c6

Please sign in to comment.