diff --git a/docs/source/usage/01_usage.md b/docs/source/usage/01_usage.md index 1fb8030598..234477773d 100644 --- a/docs/source/usage/01_usage.md +++ b/docs/source/usage/01_usage.md @@ -42,6 +42,8 @@ are shared among multiple roles: - `cifmw_arch_automation_file`: (String) Name of the workflow automation file in the architecture repository. Defaults to `default.yaml` - `cifmw_architecture_scenario`: (String) The selected VA scenario to deploy. +- `cifmw_architecture_wait_condition`: (Dict) Structure defining custom wait_conditions for the automation. +- `cifmw_architecture_user_kustomize`: (Dict) Structure defining user provided kustomization for automation. - `cifmw_ceph_target`: (String) The Ansible inventory group where ceph is deployed. Defaults to `computes`. - `cifmw_run_tests`: (Bool) Specifies whether tests should be executed. Defaults to false. diff --git a/roles/kustomize_deploy/tasks/execute_step.yml b/roles/kustomize_deploy/tasks/execute_step.yml index c0a0769cf5..7541237991 100644 --- a/roles/kustomize_deploy/tasks/execute_step.yml +++ b/roles/kustomize_deploy/tasks/execute_step.yml @@ -185,18 +185,32 @@ ansible.builtin.command: cmd: "oc apply -f {{ _cr }}" - - name: "Run Wait Conditions for {{ stage.path }}" + - name: "Build Wait Conditions for {{ stage.path }}" when: - not cifmw_kustomize_deploy_generate_crs_only | bool + vars: + _stage_name: "stage_{{ stage_id }}" + _custom_conditions: >- + {{ + cifmw_architecture_wait_condition[_stage_name] | + default([]) + }} + ## TODO: remove "validations" once architecture is up-to-date + _commands: >- + {{ + (stage['wait_conditions'] | + default(stage['validations'])) + _custom_conditions + }} environment: KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}" PATH: "{{ cifmw_path }}" - ansible.builtin.command: - cmd: "{{ wait_condition }}" - ## TODO: remove "validations" once architecture is up-to-date - loop: "{{ stage['wait_conditions'] | default(stage['validations']) }}" - loop_control: - loop_var: wait_condition + block: + - name: "Run Wait Conditions for {{ stage.path }}" + ansible.builtin.command: + cmd: "{{ wait_condition }}" + loop: "{{ _commands }}" + loop_control: + loop_var: wait_condition - name: Stop after applying CRs if requested when: