Skip to content

Commit 716c556

Browse files
Scott Cabrinhaekohl
authored andcommitted
Add Amazon 2018 to osreleasemajor for agent_restart_command
Amazon Linux now has a 2018 release date on their AMIs: ``` # cat /etc/issue Amazon Linux AMI release 2018.03 Kernel \r on an \m # facter -p os { architecture => "x86_64", family => "RedHat", hardware => "x86_64", name => "Amazon", release => { full => "2018.03", major => "2018", minor => "03" }, selinux => { enabled => false } } ``` So, when not specifying $agent_restart_command, we get this: ``` Error: /Stage[main]/Puppet::Agent::Service::Systemd/Service[puppet-run.timer]: Provider systemd is not functional on this host ```
1 parent 143199e commit 716c556

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

manifests/params.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,15 +307,15 @@
307307
# PSBM is a CentOS 6 based distribution
308308
# it reports its $osreleasemajor as 2, not 6.
309309
# thats why we're matching for '2' in both parts
310-
# Amazon Linux is like RHEL6 but reports its osreleasemajor as 2017.
310+
# Amazon Linux is like RHEL6 but reports its osreleasemajor as 2017 or 2018.
311311
$osreleasemajor = regsubst($::operatingsystemrelease, '^(\d+)\..*$', '\1') # workaround for the possibly missing operatingsystemmajrelease
312312
$agent_restart_command = $osreleasemajor ? {
313-
/^(2|5|6|2017)$/ => "/sbin/service ${service_name} reload",
313+
/^(2|5|6|2017|2018)$/ => "/sbin/service ${service_name} reload",
314314
'7' => "/usr/bin/systemctl reload-or-restart ${service_name}",
315315
default => undef,
316316
}
317317
$unavailable_runmodes = $osreleasemajor ? {
318-
/^(2|5|6|2017)$/ => ['systemd.timer'],
318+
/^(2|5|6|2017|2018)$/ => ['systemd.timer'],
319319
default => [],
320320
}
321321
}

0 commit comments

Comments
 (0)