Skip to content

Commit

Permalink
Merge pull request #140 from jordiprats/master
Browse files Browse the repository at this point in the history
systemd::sysvwrapper configurable restart
  • Loading branch information
jordiprats authored Jun 7, 2019
2 parents ceb6b8a + 054fc3a commit 938d989
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 0.2.7

* configurable restart for **systemd::sysvwrapper**

## 0.2.6

* added support for **Debian 10**
Expand Down
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ group :system_tests do
gem 'beaker-rspec', '> 5', :require => false
gem 'beaker_spec_helper', :require => false
gem 'serverspec', :require => false
gem 'rspec', '< 3.2', :require => false if RUBY_VERSION =~ /^1\.8/
gem 'rspec-puppet', :require => false
gem 'metadata-json-lint', :require => false
gem 'rspec', '< 3.2', :require => false if RUBY_VERSION =~ /^1\.8/
gem 'rspec-puppet', :require => false
gem 'metadata-json-lint', :require => false
end
24 changes: 19 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,27 @@ systemd::service { 'tomcat7':
}
```

System-V compatibility mode. The following code is used in **eyp-mcaffee** to enable the ma service on CentOS 7
System-V compatibility mode. A slightly different versions of the following code is used in **eyp-docker** to ensure a given container is running on CentOS 7

```puppet
systemd::sysvwrapper { 'ma':
initscript => '/etc/init.d/ma',
notify => Service['ma'],
before => Service['ma'],
file { "/etc/init.d/dockercontainer_${container_id}":
ensure => 'present',
owner => 'root',
group => 'root',
mode => '0755',
content => file("${module_name}/container_init.sh"),
}
systemd::sysvwrapper { "dockercontainer_${container_id}":
initscript => "/etc/init.d/dockercontainer_${container_id}",
notify => Service["dockercontainer_${container_id}"],
before => Service["dockercontainer_${container_id}"],
}
service { "dockercontainer_${container_id}":
ensure => 'running',
enable => true,
require => File["/etc/init.d/dockercontainer_${container_id}"],
}
```

Expand Down
3 changes: 2 additions & 1 deletion manifests/sysvwrapper.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
$servicename = $name,
$check_time = '10m',
$wait_time_on_startup = '1s',
$restart = 'no',
) {

if versioncmp($::puppetversion, '4.0.0') >= 0
Expand Down Expand Up @@ -38,7 +39,7 @@
"${initscript}.sysvwrapper.status",
] ],
forking => true,
restart => 'no',
restart => $restart,
pid_file => "/var/run/${servicename}.sysvwrapper.pid",
}

Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eyp-systemd",
"version": "0.2.6",
"version": "0.2.7",
"author": "eyp",
"summary": "management of systemd services, services dropins, sockets, timers, timesyncd, journald, logind and resolved",
"license": "Apache-2.0",
Expand Down

0 comments on commit 938d989

Please sign in to comment.