I had a requirment to do a certain action only given that a specific user exists. Looking at the following question Chef Users resource (check if exists?) I concluded that the following:
if node['etc']['passwd']['random']
would be a good method.
This actually worked when I tested it in kitchen, but when pushed to production this crushed on all servers with the error:
NoMethodError: undefined method `[]' for nil:NilClass
When using ohai from bash I do see etc: {...}
What exactly is happening here?