Hi,
I'm totally new to chef and has zero knowledge in ruby. But my goal is to change specific Linux user password before it expires. I have found shadow resource which I hope can be used to determine when its time to change password for that one specific user. shadow resource says :
last_changes
A list of integers, indicating the number of days since Jan 1, 1970 since the password for each matching entry was changed.
Ensure all entries have changed their password in the last 90 days. (Probably want a filter on that)
describe shadow do
its('last_changes.min') { should be < Date.today - 90 - Date.new(1970,1,1) }
end
Is there any chance to use this for user resource as guard? Or somehow to get that number and set to some variable which could be later used in recipe ?
I'm currently stuck since have no idea what need to be read about to understand how this describe ... could be used.
Any hint or help will be appreciated.
Regards,
Giedrius