Skip to content

Commit 59879ee

Browse files
committed
Do not test if {{ playbook_dir }}/remediate.yml to avoid complexity
1 parent 6dc58b6 commit 59879ee

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

tests/tasks/common_upgrade_tasks.yml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -69,20 +69,13 @@
6969
- "{{ __leapp_reports_controller_dir }}/{{ inventory_hostname }}/{{ __leapp_report_txt | basename }}"
7070
- "{{ __leapp_reports_controller_dir }}/{{ inventory_hostname }}/{{ __leapp_report_json | basename }}"
7171

72-
# Note: We cannot use ansible.builtin.import_playbook here because import_playbook
73-
# can only be used at the playbook level, not in task files. Therefore, we execute
74-
# the generated playbook using ansible-playbook command with the same intontory
75-
# as the parent playbook.
76-
- name: common_upgrade_tasks | Run remediation using generated playbook
77-
ansible.builtin.command: >-
78-
ansible-playbook
79-
-i {{ inventory_file }}
80-
--become
81-
{{ playbook_dir }}/remediate.yml
82-
delegate_to: localhost
83-
run_once: true
84-
environment: "{{ ansible_env | default({}) }}"
85-
changed_when: true
72+
# Not running from {{ playbook_dir }}/remediate.yml because we cannot use
73+
# ansible.builtin.import_playbook here. import_playbook # can only be used
74+
# at the playbook level, not in task files.
75+
- name: common_upgrade_tasks | Include remediate role
76+
ansible.builtin.include_role:
77+
name: infra.leapp.remediate
78+
public: true
8679

8780
- name: common_upgrade_tasks | Gather verify remediation tasks
8881
ansible.builtin.find:

0 commit comments

Comments
 (0)