Just out of curiosity, do you know if ohai actually scans the file, or uses the getpwent utility or API to do it?
The difference is that getpwent would also pick up users coming from Active Directory, LDAP etc., depending on you nssswitch.conf configuration.
Our values: Privacy, Liberty, Justice
On Wednesday, March 25, 2015 at 8:02 AM, ANGELA EBIRIM wrote:
Does anyone know how to extract the list of current users on a node?
I’ve been interrogating the OHAI attributes of a node (I’m sure it would be a node attribute) but can’t find it.
Ohai fetches the data as etc/passwd, i.e., it should be under node[“etc”][“passwd”].
BTW, you can just run
ohai on the command line to see all the data it produces. It’s quite a lot but you can scan it to find the data you’re looking for. You can also filter the command line output by passing the path to the attributes you want if you know them, e.g.,
ohai etc/passwd prints just the passwd data.