File_line match

328 views
Skip to first unread message

eliran shlomo

unread,
May 14, 2014, 2:34:49 AM5/14/14
to puppet...@googlegroups.com
Hi,
I'm trying to replace line inside a file with file_line.

 file_line { 'password policy change':
    ensure => present,
    path    => '/tmp/test',
    match => 'password.*requisite.*cracklib\.so.*',
    line     => 'password        requisite
  pam_cracklib.so retry=3 minlen=8 difok=5 dcredit=-1 lcredit=-1 ucredit=-1 ocredit=-1'
 }

but it keeping failing
Error: Failed to apply catalog: Validation of File_line[password policy change] failed: When providing a 'match' parameter, the value must be a regex that matches against the value of your 'line' parameter at /etc/puppet/environments/common/pci/manifests/init.pp:20

Please advice.

 

Kenton Brede

unread,
May 14, 2014, 9:06:41 AM5/14/14
to puppet...@googlegroups.com
I tested this and the match is working OK.  What I got from what you posted is the following:

Error: Failed to apply catalog: Validation of File_line[password policy change] failed: When providing a 'match' parameter, the value must be a regex that matches against the value of your 'line' parameter at /etc/puppet/modules/test_module/manifests/init.pp:14
Wrapped exception:

When providing a 'match' parameter, the value must be a regex that matches against the value of your 'line' parameter

Once I took the line break out of the "line  =>" you posted, the change worked fine.


line     => 'password        requisite        pam_cracklib.so retry=3 minlen=8 difok=5 dcredit=-1 lcredit=-1 ucredit=-1 ocredit=-1'


Kent


--
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 puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/ad28d01f-fabc-4fc1-aa80-795bb1579a4e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Kent Brede




Stefan Heijmans

unread,
May 14, 2014, 10:02:12 AM5/14/14
to puppet...@googlegroups.com
Hi,
 
how about using augeasprovider to manage PAM?
 
Stefan
 
Reply all
Reply to author
Forward
0 new messages