Skip to content

Commit

Permalink
using camptocamp/systemd module for systemd service reload
Browse files Browse the repository at this point in the history
  • Loading branch information
KoenDierckx committed Nov 22, 2017
1 parent 604d6da commit b0de321
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
1 change: 1 addition & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ fixtures:
archive: "https://github.com/voxpupuli/puppet-archive.git"
staging: "https://github.com/voxpupuli/puppet-staging.git"
stdlib: "https://github.com/puppetlabs/puppetlabs-stdlib.git"
systemd: "https://github.com/camptocamp/puppet-systemd.git"
24 changes: 12 additions & 12 deletions manifests/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
#
# Install confluence, See README.md for more.
#
class confluence::service(
class confluence::service (
$service_file_location = $confluence::params::service_file_location,
$service_file_template = $confluence::params::service_file_template,
$service_lockfile = $confluence::params::service_lockfile,
$refresh_systemd = $confluence::params::refresh_systemd,
) {
) {

if($refresh_systemd) {
include ::systemd::systemctl::daemon_reload
}

file { $service_file_location:
content => template($service_file_template),
mode => '0755',
}

if $refresh_systemd {
exec { 'systemctl_reload_confluence':
command => 'systemctl daemon-reload',
path => '/bin:/sbin:/usr/bin:/usr/sbin',
refreshonly => true,
subscribe => File[$service_file_location],
before => Service['confluence'],
}
notify => [
$refresh_systemd ? {
true => Class['systemd::systemctl::daemon_reload'],
default => undef
}
],
}

if $confluence::manage_service {
Expand Down
4 changes: 4 additions & 0 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
"issues_url": "https://github.com/voxpupuli/puppet-confluence/issues",
"description": "Atlassian confluence",
"dependencies": [
{
"name": "camptocamp/systemd",
"version_requirement": ">= 1.0.0 < 2.0.0"
},
{
"name": "puppet/archive",
"version_requirement": ">= 1.0.0 < 2.0.0"
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
on host, puppet('module', 'install', 'puppetlabs-postgresql'), acceptable_exit_codes: [0, 1]
on host, puppet('module', 'install', 'puppet-staging'), acceptable_exit_codes: [0, 1]
on host, puppet('module', 'install', 'puppetlabs-stdlib'), acceptable_exit_codes: [0, 1]
on host, puppet('module', 'install', 'camptocamp-systemd'), acceptable_exit_codes: [0, 1]
end
end
end

0 comments on commit b0de321

Please sign in to comment.