@jcbollinger:
Thank you so much. Sometimes when you've been looking at code a while you
just can't see the obvious. I started with code you created in another post
and finished it with your help. Here's the finished code:
class replacepattern {
define replace($file,$pattern,$newstring){
exec { "replace pattern with newstring in ${file}":
command => "sed -i \'s|${pattern}|${newstring}|g\' '${file}'",
onlyif => "test -e ${file}",
refresh => 'true',
provider => 'posix',
logoutput => false, } } }
and in site.pp:
include ::replacepattern
::replacepattern::replace { "common-auth":
file => "/etc/pam.d/common-auth",
pattern => "minimum_uid=1000",
newstring => "minimum_uid=400", }
@John Gelnaw:
My manager and I took you advice and changed our strategy to replace the
minimum to 400 (OSX starts at 500).
And I really like your code but I can't figure out a file to subscribe to.
I might just have to create one.
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/41b72a63-c963-4caf-9568-5ee2eeed26b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.