I am trying set user accounts to expired using ansible playbook. Unfortunately, ansible creates the user and expires it if the user is not present, with following code. How do I make changes only to user account account that is present?
- name: Lock accounts
when: ansible_os_family != "AIX"
user:
name: "{{ item }}"
expires: 1541453077
with_items: "{{ users }}"