Skip to content

Commit 96f70cd

Browse files
users.yaml: Only update facts once
1 parent 6dcb7e7 commit 96f70cd

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

tasks/users.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@
1414
dest: "/etc/ansible/facts.d/users.fact"
1515
content: "{{ system.users.keys() | list | to_json }}"
1616

17-
- name: Update facts
18-
when: users_fact_installed.changed
19-
changed_when: yes
20-
ansible.builtin.setup: {}
21-
2217
- name: Compare the user variables with the users fact on the system
2318
ansible.builtin.set_fact:
2419
old_users_var: "{{ (ansible_local.users | default([]) | difference(system.users.keys() | list)) + system.users_delete }}"
@@ -81,6 +76,6 @@
8176
loop_control:
8277
label: "{{ item.key }}"
8378

84-
- name: Sync the list of current users to the target host
79+
- name: Update facts
8580
changed_when: users_created.changed or users_deleted.changed
8681
ansible.builtin.setup: {}

0 commit comments

Comments
 (0)