Skip to content

Commit 9910161

Browse files
Update user check
1 parent 66669b8 commit 9910161

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

powerdns_setup.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,19 +215,18 @@
215215
- hostvars[inventory_hostname]['health_check_enabled'] | default(false)
216216

217217
- name: PREFLIGHT - Check if healthcheck user exists
218-
ansible.builtin.getent:
219-
database: passwd
220-
key: healthcheck
218+
ansible.builtin.command: id -u healthcheck
221219
register: healthcheck_user_check
222220
failed_when: false
221+
changed_when: false
223222
when:
224223
- hostvars[inventory_hostname]['health_check_enabled'] | default(false)
225224

226225
- name: PREFLIGHT - Set PM2 migration fact
227226
ansible.builtin.set_fact:
228227
needs_pm2_migration: "{{ pm2_installed.rc == 0 and pm2_healthchecker_running.rc == 0 }}"
229228
pm2_systemd_enabled: "{{ pm2_systemd_service.status.LoadState | default('not-found') != 'not-found' }}"
230-
healthcheck_user_exists: "{{ healthcheck_user_check.failed is defined and not healthcheck_user_check.failed }}"
229+
healthcheck_user_exists: "{{ healthcheck_user_check.rc == 0 }}"
231230
when:
232231
- hostvars[inventory_hostname]['health_check_enabled'] | default(false)
233232

0 commit comments

Comments
 (0)