Investigate why the 'state' does not as expected.

This commit is contained in:
Andrea Dell'Amico 2024-03-20 16:37:14 +01:00
parent 9c56ea11ca
commit 6eb16b2490
Signed by: adellam
GPG Key ID: 147ABE6CEB9E20FF
1 changed files with 4 additions and 4 deletions

View File

@ -42,7 +42,7 @@
- name: Manage the users of a system
tags: users
block:
- name: Manage the creation or deletion of users
- name: Manage the creation or removal of the default set of users
ansible.builtin.user:
name: "{{ item.login }}"
group: "{{ item.group | default(omit) }}"
@ -79,12 +79,12 @@
loop: '{{ users_system_users }}'
when:
- item.admin is defined and item.admin
- item.state is not defined or item.state != "present"
- item.state is not defined and item.state != "present"
- name: Manage additional users
tags: users
block:
- name: Create additional users
- name: Manage the creation of removal of additional users
ansible.builtin.user:
name: "{{ item.login }}"
group: "{{ item.group | default(omit) }}"
@ -121,7 +121,7 @@
loop: '{{ users_system_users_adjunct }}'
when:
- item.admin is defined and item.admin
- item.state is not defined or item.state != "present"
- item.state is not defined and item.state != "present"
- name: Configure passwordless sudo
tags: ['users', 'sudo_wheel']