-6

I need to install a jenkins on a server using a user jenkinsuser and group jenkinsgroup. so in my recipe I defined as

#group
group jenkinsgroup do
  system true
end
# creates user
user jenkinsuser do
  gid jenkinsgroup
  system true
end

but what will happen if the user and group exist already in node (where I am trying to install jenkins) Does my resource do nothing as a user and group exists and go for next steps or will it throw an error as user exists?

2
  • 2
    Why don't you try it? Wouldn't have taken longer than writing this, right? May 19 '17 at 16:49
  • 2
    With chef, you define the desired state (e.g. a group exists). Therefore, it does nothing, if the system is already in the desired state. May 19 '17 at 16:50
6

It does nothing. A huge part of the purpose of Chef is that converges are idempotent, meaning you can run them repeatedly with no cumulative effects. I highly recommend consulting the Chef documentation as it will provide an excellent foundation for understanding how and why Chef works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.