Refactor Ansible actions to improve host inventory handling
This commit is contained in:
@@ -14,13 +14,13 @@
|
||||
loop: "{{ login_users }}"
|
||||
|
||||
- name: Disable password expiration
|
||||
command: chage -M -1 "{{ item.username }}"
|
||||
ansible.builtin.command: chage -M -1 "{{ item.username }}"
|
||||
become: yes
|
||||
when: item.password_expiration is defined and not item.password_expiration
|
||||
loop: "{{ login_users }}"
|
||||
|
||||
- name: Disable password login
|
||||
command: passwd -d "{{ item.username }}"
|
||||
ansible.builtin.command: passwd -d "{{ item.username }}"
|
||||
become: yes
|
||||
when: item.password_disabled is defined and item.password_disabled
|
||||
loop: "{{ login_users }}"
|
||||
|
||||
Reference in New Issue
Block a user