<p>It does nothing. A huge part of the purpose of Chef is that converges are <em><a href="https://en.wiktionary.org/wiki/idempotent" rel="noreferrer">idempotent</a></em>, meaning you can run them repeatedly with no cumulative effects. I highly recommend consulting the <a href="https://docs.chef.io/" rel="noreferrer">Chef documentation</a> as it will provide an excellent foundation for understanding how and why Chef works.</p>

CC BY-SA 3.0
2017-05-19T19:14:24.910Z
2017-05-19T19:14:24.910Z
Adrian
<p>I need to install a jenkins on a server using a user jenkinsuser and group jenkinsgroup. so in my recipe I defined as </p>

<pre><code>#group
group jenkinsgroup do
  system true
end
# creates user
user jenkinsuser do
  gid jenkinsgroup
  system true
end
</code></pre>

<p>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?</p>

CC BY-SA 3.0
2017-05-19T16:49:03.030Z
Why don't you try it? Wouldn't have taken longer than writing this, right?
StephenKing
CC BY-SA 3.0
2017-05-19T16:50:31.933Z
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.
StephenKing
<chef>
User management using chef
pandey
# User management using chef

(Asked by: username_0 on 2017-05-19)

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?

**Tags:** chef

> **Comments:**
> **username_1**: Why don't you try it? Wouldn't have taken longer than writing this, right?  
> **username_1**: 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.  

---

## 1 answers

### Answer by username_2 on 2017-05-19. Score: 6

It does nothing. A huge part of the purpose of Chef is that converges are *[idempotent](https://en.wiktionary.org/wiki/idempotent)*, meaning you can run them repeatedly with no cumulative effects. I highly recommend consulting the [Chef documentation](https://docs.chef.io/) as it will provide an excellent foundation for understanding how and why Chef works.


---

