Refactor Ansible actions to improve host inventory handling

This commit is contained in:
2024-10-06 18:06:37 +02:00
parent cc30dd522a
commit 748b8ff7e2
19 changed files with 174 additions and 24 deletions
+2 -2
View File
@@ -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 }}"