> /*test.yaml:*/
> user_group:
> - productsupport
> - mondev
>
> /*stage.yaml:*/
> user_group:
> - productsupport
> - idreport
>
>
>
> but then I cannot figure out how I can use user_group to create the
> group of users. Any help/pointer?
> Just one thing to note: changing anything in the users module not really
> an option for me but I'm open to any suggestion(s) if it makes thing
> even better.
>
> Best!
Hi Sans,
I have code available[1] that does exactly this. You could put a level
in hiera.yaml such as
- environments/%{environment}
and then in each file (environments/stage.yaml and
environments/test.yaml) put the users that should be realized.
Though coding aside, from a sysadmin standpoint why you are doing this
seems quite odd. I would recommend realizing all the users in all
environments, which is effectively what happens when you use a directory
service, and then lock down which users can access the system depending
on the environment. If you go that route, check out my pam module[2].
Instead of describing users in different levels of hiera, you would
describe them all in one level of hiera and at the environment level you
would put what groups are allowed to login.
[1] -
https://github.com/ghoneycutt/puppet-module-common#commonmkuser-define
[2] -
https://github.com/ghoneycutt/puppet-module-pam/#allowed_users
BR,
-g
--
Garrett Honeycutt
@learnpuppet
Puppet Training with LearnPuppet.com
Mobile:
+1.206.414.8658