Closed Feandil closed 10 years ago
Similar code produces the same error for me as well:
pam { 'Enable pam_tally2 on accounts':
ensure => present,
service => 'sshd',
type => 'account',
control => 'required',
module => 'pam_tally2.so',
}
Adding an empty arguments string does seem to bypass the problem.
Interestingly I get a different error if I try and actually add arguments. Using the following code:
pam { 'Set tally2 entry on auth':
ensure => present,
service => 'sshd',
type => 'auth',
control => 'required',
module => 'pam_tally2.so',
arguments => ['onerr=fail', 'deny=5', 'unlock_time=3600'],
}
Produces the following error:
Debug: Puppet::Type::Pam::ProviderAugeas: Save failure details:
/augeas/files/etc/pam.d/sshd/error/path = /files/etc/pam.d/sshd/12
/augeas/files/etc/pam.d/sshd/error/lens = /usr/share/augeas/lenses/dist/pam.aug:58.21-.51:
/augeas/files/etc/pam.d/sshd/error/message = Failed to match
{ /optional/ }?{ /type/ = /auth|session|account|password/ }{ /control/ = /\\[[^]\001-\004\n#]*\\]|[^\001-\004\t [][^\001-\004\t ]*/ }{ /module/ = /[^\001-\004\t\n #]+/ }{ /argument/ = /[^\001-\004\t\n #]+/ }*({ /#comment/ = /[^\001-\004\t\n\r ][^\001-\004\n]*[^\001-\004\t\n\r ]|[^\001-\004\t\n\r ]/ } | ())
with tree
{ "type" = "auth" } { "control" = "required" } { "module" = "pam_tally2.so" } { "argument" = "onerr=fail deny=5 unlock_time=3600" }
Error: /Stage[main]/***::***/Pam[Set tally2 entry on auth]: Could not evaluate: Failed to save Augeas tree to file. See debug logs for details.
This is using the current Master branch as of a few hours ago and Puppet 3.6.1. If I can provide any further information please let me know.
Thank you.
Attached code should fix this issue.
@raphink The attached code fixes does indeed fix the issue, thank you.
The following code breaks puppet:
Here is the error:
Adding a ''arguments => []'' works: