DEV Community

Cover image for Adding the web-data user to another group with puppet
Julian
Julian

Posted on

Adding the web-data user to another group with puppet

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:

Latest comments (0)