From 99c98a7bc8c6df2f1444f8fbde206d676439c97c Mon Sep 17 00:00:00 2001 From: Jordi Prats Date: Wed, 22 May 2019 12:36:55 +0200 Subject: [PATCH 1/3] align --- Gemfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 From 42c60280e0eadb6e58630ba182fdd50e8848a25c Mon Sep 17 00:00:00 2001 From: Jordi Prats Date: Fri, 7 Jun 2019 12:31:09 +0200 Subject: [PATCH 2/3] canvi example --- README.md | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) 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}"], } ``` From 054fc3af34676980192c80e6b3de38b026c0d83f Mon Sep 17 00:00:00 2001 From: Jordi Prats Date: Fri, 7 Jun 2019 12:35:00 +0200 Subject: [PATCH 3/3] systemd::sysvwrapper configurable restart --- CHANGELOG.md | 4 ++++ manifests/sysvwrapper.pp | 3 ++- metadata.json | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) 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/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",