Skip to content
This repository was archived by the owner on Nov 24, 2023. It is now read-only.

Commit 46c9f49

Browse files
committed
Fix order when setting a github action runner as absent
Bump minor systemd version requirement 2.7.0 https://github.com/camptocamp/puppet-systemd/blob/master/CHANGELOG.md#270-2019-10-29 From now on, service resource is already managed by Systemd::Unit_file
1 parent 9c2caa6 commit 46c9f49

File tree

2 files changed

+13
-18
lines changed

2 files changed

+13
-18
lines changed

manifests/instance.pp

+12-17
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,20 @@
141141
refreshonly => true
142142
}
143143

144+
$active_service = $ensure ? {
145+
'present' => true,
146+
'absent' => false,
147+
}
148+
149+
$enable_service = $ensure ? {
150+
'present' => true,
151+
'absent' => false,
152+
}
153+
144154
systemd::unit_file { "github-actions-runner.${instance_name}.service":
145155
ensure => $ensure,
156+
enable => $enable_service,
157+
active => $active_service,
146158
content => epp('github_actions_runner/github-actions-runner.service.epp', {
147159
instance_name => $instance_name,
148160
root_dir => $github_actions_runner::root_dir,
@@ -154,23 +166,6 @@
154166
}),
155167
require => [File["${github_actions_runner::root_dir}/${instance_name}/configure_install_runner.sh"],
156168
Exec["${instance_name}-run_configure_install_runner.sh"]],
157-
notify => Service["github-actions-runner.${instance_name}.service"],
158-
}
159-
160-
$ensure_service = $ensure ? {
161-
'present' => running,
162-
'absent' => stopped,
163-
}
164-
165-
$enable_service = $ensure ? {
166-
'present' => true,
167-
'absent' => false,
168-
}
169-
170-
service { "github-actions-runner.${instance_name}.service":
171-
ensure => $ensure_service,
172-
enable => $enable_service,
173-
require => Class['systemd::systemctl::daemon_reload'],
174169
}
175170

176171
}

metadata.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
},
1515
{
1616
"name": "camptocamp/systemd",
17-
"version_requirement": ">= 1.1.1 < 3.0.0"
17+
"version_requirement": ">= 2.7.0 < 3.0.0"
1818
},
1919
{
2020
"name": "puppet-archive",

0 commit comments

Comments
 (0)