From 962af0d7dce2b73707ad047238971b6107237f0a Mon Sep 17 00:00:00 2001 From: Nick Maludy Date: Fri, 22 May 2020 08:10:00 -0400 Subject: [PATCH] Fix bug where systemd was always assumed, if not windows --- CHANGELOG.md | 7 +++++++ manifests/generic.pp | 5 +++-- metadata.json | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e985810..99fbe1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. +## Release 0.1.1 + +**Bugfixes** + +* Change from using `$facts['os']['family']` to `$facts['service_provider']` from `puppetlabs/stdlib`. + This allows `service_autorestart::generic` to "do the right thing" when detecting systemd. + ## Release 0.1.0 **Features** diff --git a/manifests/generic.pp b/manifests/generic.pp index 2d8b8df..5a08233 100644 --- a/manifests/generic.pp +++ b/manifests/generic.pp @@ -4,12 +4,13 @@ # to tweak settings, you'll need to declare the `service_autorestart::windows` # or `service_autorestart::systemd` directly. define service_autorestart::generic () { - case $facts['os']['family'] { + case $facts['service_provider'] { 'windows': { service_autorestart::windows { $title: } } - default: { + 'systemd': { service_autorestart::systemd { $title: } } + default: {} } } diff --git a/metadata.json b/metadata.json index 939636e..5b513c4 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "encore-service_autorestart", - "version": "0.1.0", + "version": "0.1.1", "author": "Encore Technologies", "summary": "Puppet module to manage auto-restarting services (Windows and SystemD), and Windows Service Recovery options", "license": "Apache-2.0", @@ -8,6 +8,10 @@ "project_page": "https://github.com/EncoreTechnologies/puppet-service_autorestart", "issues_url": "https://github.com/EncoreTechnologies/puppet-service_autorestart/issues", "dependencies": [ + { + "name": "puppetlabs/stdlib", + "version_requirement": ">= 4.0.0 < 7.0.0" + }, { "name": "puppetlabs/inifile", "version_requirement": ">= 3.0.0 < 5.0.0"