ruby - Chef Users resource (check if exists?) -
I know how to create user resources:
user supports "random" Is: management_home = & gt; True comment "random user" UID 1234 GID "user" home "/ home / random" shell "/ bin / bash" password "$ 1 $ J JSVHSL V $ SJS CJVERprint NN4 JHDD." End But I'm not sure how to use Chef to list existing users on the current node. I looked at the inspection of node [: users] while running chef-client, but only node [: current_user] is available to me whether a regular user is present or not, to ask if there is a regular user, Is there a way in a cook recipe?
I am in a situation where I should not / should not make a user (due to company rules, but I definitely do not want to proceed with the establishment of other things defined in my kitchen book, Unless xyz users are already present.)
Ohi asks users on your system :
if node ['etc.'] ['passwd'] ['random'] #doo deployed end Od>>
Comments
Post a Comment