Skip to content
Snippets Groups Projects
Commit 82ba2d75 authored by nimrod's avatar nimrod
Browse files

- A different method to not remove the user used by Ansible currently (doesn't...

- A different method to not remove the user used by Ansible currently (doesn't rely on anible_user which is defined only in specific cases).
parent d6823c76
No related branches found
No related tags found
No related merge requests found
......@@ -10,3 +10,5 @@
user:
name: '{{ item }}'
state: absent
register: users_prune_users
failed_when: users_prune_users|failed and not 'is currently used' in users_prune_users.msg and not 'is currently logged in' in users_prune_users.msg
......@@ -17,4 +17,4 @@ users_unique_groups: '{{ users|selectattr("groups", "defined")|sum(attribute="gr
users_sudo_group: "{{ 'wheel' if ansible_os_family == 'OpenBSD' else 'sudo' }}"
users_unique_names: '{{ users|map(attribute="name")|list|union([ansible_user])|unique }}'
users_unique_names: '{{ users|map(attribute="name")|list|unique }}'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment