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 On Wed, May 14, 2014 at 1:34 AM, eliran shlomo <[email protected]>wrote: > 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. > > > > -- > 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/ad28d01f-fabc-4fc1-aa80-795bb1579a4e%40googlegroups.com<https://groups.google.com/d/msgid/puppet-users/ad28d01f-fabc-4fc1-aa80-795bb1579a4e%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Kent Brede -- 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/CA%2BnSE3_a1KM4KTtAjR3Wj6xHV9og_7nQtnyizUv2MvvmSNpDKQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
