我在使用以下 Puppet 清单时遇到问题,该清单旨在启用passwdqc
RHEL-6 系统上的pam 模块(使用 Puppet 0.25.5 和 augeas 0.7.2):
augeas { 'authconfig':
context => '/files/etc/sysconfig/authconfig',
changes => [
'set USEPASSWDQC yes',
'set USECRACKLIB no',
],
notify => Exec['authconfig-all'],
}
exec { 'authconfig-all':
command => '/usr/sbin/authconfig --updateall',
refreshonly => true,
}
Run Code Online (Sandbox Code Playgroud)
如果我运行此清单,它似乎成功完成:
info: Applying configuration version '1311189237'
notice: //Augeas[authconfig]/returns: executed successfully
info: //Augeas[authconfig]: Scheduling refresh of Exec[authconfig-all]
notice: //Exec[authconfig-all]: Triggering 'refresh' from 1 dependencies
Run Code Online (Sandbox Code Playgroud)
但如果我检查目标文件,更改尚未应用:
# egrep 'PASSWDQC|CRACKLIB' /etc/sysconfig/authconfig
USECRACKLIB=yes
USEPASSWDQC=no
Run Code Online (Sandbox Code Playgroud)
如果我notify => ...
从清单中删除该行,它会完全按预期工作。也就是说,鉴于此:
augeas { …
Run Code Online (Sandbox Code Playgroud)