From 6f15cd093a4d3721d2770d4d7329e171598b579d Mon Sep 17 00:00:00 2001 From: Rafael Guterres Jeffman Date: Fri, 15 Aug 2025 16:18:53 -0300 Subject: [PATCH] ansible-lint: Fix Jinja error A task in 'roles/ipaclient/tasks/install.yml' uses logic that ansible-lint and jinja are unable to evaluate due to missing type. By refactoring the task the tools are able to evaluate the task. --- roles/ipaclient/tasks/install.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/ipaclient/tasks/install.yml b/roles/ipaclient/tasks/install.yml index ca56be3d..7191cece 100644 --- a/roles/ipaclient/tasks/install.yml +++ b/roles/ipaclient/tasks/install.yml @@ -181,10 +181,10 @@ - name: Install - Store the previously obtained OTP no_log: yes + when: result_ipaclient_get_otp.host is defined ansible.builtin.set_fact: ipaadmin_orig_password: "{{ ipaadmin_password | default(omit) }}" - ipaadmin_password: "{{ result_ipaclient_get_otp.host.randompassword - if result_ipaclient_get_otp.host is defined }}" + ipaadmin_password: "{{ result_ipaclient_get_otp.host.randompassword | default(omit) }}" rescue: - name: Install - Report error for OTP generation ansible.builtin.debug: