Is there a better way to do this?
augeas { 'add_allow_users':
context => '/files/etc/ssh/sshd_config',
changes => [
'set AllowUsers/1 alice',
'set AllowUsers/2 bob',
'set AllowUsers/3 charlie',
...
],
notify => Service['ssh'],
}
https://www.redhat.com/archives/augeas-devel/2013-March/msg00032.html
I wanted to use something like this:
$usergroup_a = 'alice bob'
$usergroup_b = 'charlie'
Yes there is:
http://augeasproviders.com/documentation/examples.html#sshd_config_provider
or using a ERB template:
http://projects.puppetlabs.com/projects/1/wiki/puppet_augeas#Templating+complex+changes/commands