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/
Top comments (0)