Adding the web-data user to another group with puppet

c33s

Julian

Posted on January 27, 2019

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:

💖 💪 🙅 🚩
c33s
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.

Related