Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecation warning in service.pp #153

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 3 additions & 23 deletions manifests/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -72,41 +72,21 @@
$allow_isolate = undef,
) {

if($type!=undef and $forking==true)
if($type != undef and $forking == true)
{
fail('Incompatible options: type / forking')
}

if($type != 'oneshot' and is_array($execstart) and count($execstart) > 1)
if($type != 'oneshot' and $execstart.is_a(Array) and count($execstart) > 1)
{
fail('Incompatible options: There are multiple execstart values and Type is not "oneshot"')
}

if($type != 'oneshot' and is_array($execstop) and count($execstop) > 1)
if($type != 'oneshot' and $execstop.is_a(Array) and count($execstop) > 1)
{
fail('Incompatible options: There are multiple execstop values and Type is not "oneshot"')
}

# TODO: puppet4 / puppet 6 compatibility
# if(size($unset_env_vars)>0)
# {
# if(defined($::eyp_systemd_release))
# {
# $systemd_release=0+$::eyp_systemd_release
#
# if($systemd_release < 235)
# {
# fail("ERROR: UnsetEnvironment is not available for systemd < 235 - current release: ${systemd_release}")
# }
# }
# }

# if($restart!=undef)
# {
# # Takes one of no, on-success, on-failure, on-abnormal, on-watchdog, on-abort, or always.
# validate_re($restart, [ '^no$', '^on-success$', '^on-failure$', '^on-abnormal$', '^on-watchdog$', '^on-abort$', '^always$'], "Not a supported restart type: ${restart} - Takes one of no, on-success, on-failure, on-abnormal, on-watchdog, on-abort, or always")
# }

include ::systemd

concat { "/etc/systemd/system/${servicename}.service":
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 3.8.0"
"version_requirement": ">= 4.0.0"
}
]
}