On Tue, 5 Oct 2021 at 14:20, dulhaver via Ansible Project
<[email protected]> wrote:
>
> I have targets who have set a user pw to expire and I want to switch the 
> expiration off with  `sudo chage -l stepuser`.
>
> this seems to work with a task like this:
>
> - name: switch off pw expiration for stepuser
>   shell:
>     cmd: chage -M -1 stepuser
>   become: yes
>
> Beind quite new to ansible I am wondering whether this is the right approach 
> for such or anything else would be more suitable way (I can not identify any 
> convincing paramter in the user module though)?

https://docs.ansible.com/ansible/latest/collections/ansible/builtin/user_module.html#parameter-expires
is pretty convincing to me.
See the 3rd last example on that page:

- name: Starting at Ansible 2.6, modify user, remove expiry time
  ansible.builtin.user:
    name: james18
    expires: -1



-- 
Dick Visser
Trust & Identity Service Operations Manager
GÉANT

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAL8fbwO0VV7NNBNfoxDJdFi2_68-%2BmiRW_32JuiVUMkP2c7Xmg%40mail.gmail.com.

Reply via email to