I am using augeas to update the PAM configuration (ie: to LDAP enable my
systems).
Here is a snippet of what I am doing to add required modules, etc.
"auth-pam_succeed":
context =>
"/files/etc/pam.d/system-auth",
changes => [
"ins 100000 after
*[type=''auth''][module=''pam_unix.so'']",
"set 100000/type auth",
"set 100000/control
requisite",
"set 100000/module
pam_succeed_if.so",
"set 100000/argument[1] uid",
"set 100000/argument[2]
>=",
"set 100000/argument[3] 500",
"set 100000/argument[4]
quiet",
],
onlyif => "match
*[type=''auth''][module=''pam_succeed_if.so'']
size == 0";
"auth-pam_ldap":
context =>
"/files/etc/pam.d/system-auth",
changes => [
"ins 100000 after
*[type=''auth''][module=''pam_succeed_if.so'']",
"set 100000/type auth",
"set 100000/control
sufficient",
"set 100000/module
pam_ldap.so",
"set 100000/argument
use_first_pass"
],
onlyif => "match
*[type=''auth''][module=''pam_ldap.so''] size ==
0",
require => Augeas[
"auth-pam_succeed" ];
"account-pam_access":
context =>
"/files/etc/pam.d/system-auth",
changes => [
"ins 100000 after
*[type=''account''][module=''pam_unix.so'']",
"set 100000/type account",
"set 100000/control required",
"set 100000/module
pam_access.so",
],
onlyif => "match
*[type=''account''][module=''pam_access.so'']
size == 0";
** these augeas calls repeat for each module I need to add **
My question is, is there a simpler way to do what I am doing. Meaning can I
combine all these seperate calls into one? What about the onlyif statements,
is there another way that these can be accomplished. Basically, I need to
insert the module, at a defined place, if needed.
Also would be nice to explicitly set the arguments. Right now the only way I
can think to do that is to add another augeas check to check the options and
update if needed.
Thanks
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.