Skip to content

Commit

Permalink
Fix Ansible error when ansible_user is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
medanthelinium committed Oct 19, 2022
1 parent 65ccad9 commit 7b8dcf4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tasks/users.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
This is very dangerous and will most likely break your system.
- name: Fail if the current Ansible user is about to get deleted
when: ansible_user in old_users_var
when: (ansible_user | default("")) in old_users_var
ansible.builtin.fail:
msg: |
User {{ ansible_user }} can not be removed, since it's being used to run the current Ansible playbook
Expand Down

0 comments on commit 7b8dcf4

Please sign in to comment.