thinkingmonster
thinkingmonster

Reputation: 5413

How to find that if a user is present on the nodes using chef

Is there any search pattern by which we can find that a particular user is present on which nodes using chef.I looked around the knife search patterns and didn't found any way. This task however is very simple with use of ansible.

Upvotes: 0

Views: 269

Answers (1)

Tensibai
Tensibai

Reputation: 15784

There's a lot of attributes populated by ohai. see this and this

You can see a list of attributes with knife node show NODENAME -l

The search documentation is here

And it says each key is indexed at top level, users are under node['etc']['passwd'] attribute so the command you're looking for is knife search node 'passwd:username'

Upvotes: 3

Related Questions