Adding the web-data user to another group with puppet
Julian
Posted on January 27, 2019
this blog post is mainly a note to myself for future reference.
profile::nginx
...
# the user is not created here. lets say the user is prepared here.
@user { 'www-data':
# groups => ['somegroup'],
gid => '33',
membership => minimum,
}
...
profile::other_profile_which_needs_to_add_the_group
# here the user is created aka realized but with the extra group `mynewgroup` added.
User <| title == 'www-data' |> { groups +> "mynewgroup" }
@@
means the resource is exported. also see https://puppet.com/docs/puppet/5.3/lang_exported.html
@@user { 'www-data':
...
}
@
means the resource is virtual. also see https://puppet.com/docs/puppet/5.3/lang_virtual.html
@user { 'www-data':
...
}
further reading:
- https://serverfault.com/questions/416254/adding-an-existing-user-to-a-group-with-puppet
- https://tickets.puppetlabs.com/browse/PUP-7541
- https://blog.scottlowe.org/2013/02/08/modifying-virtual-user-resources-in-puppet/
- https://ttboj.wordpress.com/2013/05/14/overriding-attributes-of-collected-exported-resources/
cover image by Gaby Stein aka steinchen https://pixabay.com/en/stage-boards-wood-theater-233085/
💖 💪 🙅 🚩
Julian
Posted on January 27, 2019
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.