From 7bfaee6e72914e8650780a5f152e13ec43a83f0e Mon Sep 17 00:00:00 2001 From: Moritz 'e1mo' Fromm Date: Thu, 10 Dec 2020 19:26:18 +0100 Subject: [PATCH] Fix tasks from failing in check_mode By applying `check_mode: no` to the tasks collecting the current locale and bash path, those tasks will be executed in the check mode and subsequent tasks reyling on those won't fail. See https://docs.ansible.com/ansible/latest/user_guide/playbooks_checkmode.html#enforcing-or-preventing-check-mode-on-tasks for reference. --- tasks/locale.yml | 1 + tasks/user.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/tasks/locale.yml b/tasks/locale.yml index 41ab97d..e03ba54 100644 --- a/tasks/locale.yml +++ b/tasks/locale.yml @@ -6,6 +6,7 @@ - name: Get current locale and language configuration command: localectl status register: locale_status + check_mode: no changed_when: false - name: Parse 'LANG' from current locale and language configuration diff --git a/tasks/user.yml b/tasks/user.yml index e8b13b6..7eee81d 100644 --- a/tasks/user.yml +++ b/tasks/user.yml @@ -10,6 +10,7 @@ - name: get bash's path command: which bash register: bash_path + check_mode: no changed_when: false - name: create user