Maintenance: GitLab GKE platform upgrade and software upgrade on Friday Oct. 22 at 9 p.m. Service may not be available between 9 p.m. and 9:20 p.m.

Commit c69f4739 authored by Adam Lewenberg's avatar Adam Lewenberg
Browse files

add path attribtues to exec resources in several places

parent e03c5185
release/005.001 (2016-12-07)
Add "path" attributes to several exec resources. This will be required
in the next version of Puppet [adamhl].
release/005.000 (2016-11-21)
This release has a number of breaking changes.
......
......@@ -50,6 +50,7 @@ define base::postfix::map(
# both because a command with a creates stanza won't run even if notified
# if that file already exists.
exec { "${command} ${type}:${name} initial":
path => '/bin:/usr/sbin:/usr/bin',
command => "${command} ${type}:${name}",
creates => "${name}.db",
require => [ File[$name], File['/etc/postfix/main.cf'],
......@@ -57,6 +58,7 @@ define base::postfix::map(
}
exec { "${command} ${type}:${name}":
refreshonly => true,
path => '/bin:/usr/sbin:/usr/bin',
command => "${command} ${type}:${name}",
require => [ File['/etc/postfix/main.cf'], Package['postfix'] ],
}
......
......@@ -25,6 +25,7 @@ define base::postfix::recipient(
case $ensure {
'absent': {
exec { "rm-recipient-${name}":
path => '/bin:/usr/sbin:/usr/bin',
command => "sed -i -e '/^${name}/d' ${file}",
onlyif => "grep ${pattern} ${file}",
notify => Exec["postmap hash:${file}"]
......@@ -33,12 +34,14 @@ define base::postfix::recipient(
default: {
$line = "${name} ${ensure}"
exec { "add-recipient-${name}":
path => '/bin:/usr/sbin:/usr/bin',
command => "echo '${line}' >> ${file}",
unless => "grep ${pattern} ${file}",
require => Package['postfix'],
notify => Exec["postmap hash:${file}"],
}
exec { "fix-recipient-${name}":
path => '/bin:/usr/sbin:/usr/bin',
command => "sed -i -e 's/^${name}..*\$/${line}/' ${file}",
unless => "grep '^${line}\$' ${file}",
require => Exec["add-recipient-${name}"],
......
......@@ -19,6 +19,7 @@ define base::sysctl($ensure) {
case $ensure {
absent: {
exec { "rm-sysctl-$name":
path => '/bin:/usr/sbin:/usr/bin',
command => "sed -i -e '/^$name/d' $filename",
onlyif => "grep '^[^#]' $filename | grep ^$name"
}
......@@ -26,11 +27,13 @@ define base::sysctl($ensure) {
default: {
$line = "$name = $ensure"
exec { "add-sysctl-$name":
path => '/bin:/usr/sbin:/usr/bin',
command => "echo '$line' >> $filename",
unless => "grep '^$name' $filename",
notify => Exec["reload sysctl.conf"]
}
exec { "fix-sysctl-$name":
path => '/bin:/usr/sbin:/usr/bin',
command => "sed -i -e '/^$name/d' $filename; echo '$line' >> $filename",
unless => "grep '^$name[[:space:]]*=[[:space:]]*$ensure' $filename",
require => Exec["add-sysctl-$name"],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment