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.
This commit is contained in:
Rafael Guterres Jeffman
2025-08-15 16:18:53 -03:00
parent 52f7f7848e
commit 6f15cd093a

View File

@@ -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: