diff --git a/CHANGELOG.md b/CHANGELOG.md index 701a507..cab913b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 0.2.7 + +* configurable restart for **systemd::sysvwrapper** + ## 0.2.6 * added support for **Debian 10** diff --git a/Gemfile b/Gemfile index 93c71a5..96c5722 100644 --- a/Gemfile +++ b/Gemfile @@ -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 diff --git a/README.md b/README.md index a052547..84a28fb 100644 --- a/README.md +++ b/README.md @@ -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}"], } ``` diff --git a/manifests/sysvwrapper.pp b/manifests/sysvwrapper.pp index 3d99bb9..153ff8c 100644 --- a/manifests/sysvwrapper.pp +++ b/manifests/sysvwrapper.pp @@ -3,6 +3,7 @@ $servicename = $name, $check_time = '10m', $wait_time_on_startup = '1s', + $restart = 'no', ) { if versioncmp($::puppetversion, '4.0.0') >= 0 @@ -38,7 +39,7 @@ "${initscript}.sysvwrapper.status", ] ], forking => true, - restart => 'no', + restart => $restart, pid_file => "/var/run/${servicename}.sysvwrapper.pid", } diff --git a/metadata.json b/metadata.json index c353426..ad4608e 100644 --- a/metadata.json +++ b/metadata.json @@ -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",