DEV Community

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

Posted on

2 1

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:

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay