lqueryvg/ansible-role-chage

Pseudonyms for options

Closed this issue · 3 comments

Just looking at this module as a way of expiring user accounts. I absolutely understand why you are using params like sp_lstchg etc (man 3 shadow), but it doesn't feel like it is in the spirit of "Ansible is Simple IT Automation" and "Automation For Everyone" (marketing blurb lifted directly from the Ansible site). I'm championing Ansible as the future of a project I'm working on and trying to encourage its use amongst a bunch of hard core bash programmers is challenging enough!

Could I suggest adding more human readable options? expires, last_change, min_age, max_age, warning, inactive, etc?

@cpmills1975 this seems like a perfectly reasonable request. I will take a look at implementing this. I believe the Ansible module library code already supports option "aliases" so I think it should be fairly easy.

Regarding your suggested names, I wonder if it would be better to make them match the options used by the chage command. This will make it more familiar to your Linux / bash people and avoids another layer of mental translation for everyone to make.

I.e.

        sp_lstchg = 'lastday'
        sp_min    = 'mindays'
        sp_max    = 'maxdays'
        sp_warn   = 'warndays'
        sp_inact  = 'inactive'
        sp_expire = 'expiredate'

More than happy with your suggested aliases. Just something easier to remember than sp_lstchg etc.

@cpmills1975 , aliases have now been added as requested...

Code changes FYI... f8a8109...f9d32ba