# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
-- name: Set distribution
+- name: Set deploy scenario
set_fact:
- distro: "{{ ansible_distribution | lower }}{{ ansible_distribution_version | replace('.','') }}"
+ deploy_scenario: "{{ lookup('env', 'DEPLOY_SCENARIO') | default('k8-multus-plugins', true) }}"
+
+- name: Log deploy scenario to console
+ debug:
+ msg: 'Set deploy scenario to {{ deploy_scenario }}'
+
+- name: Fail if the deploy scenario is not valid for stack '{{ stack_type }}'
+ fail:
+ msg: "'{{ deploy_scenario }}' is not valid for stack '{{ stack_type }}'"
+ when: deploy_scenario not in scenarios
- name: Log distribution to console
debug:
msg: "'{{ installer_type }}' is not a valid installer for stack '{{ stack_type }}'"
when: installer_type not in installers
-- name: Log deploy scenario to console
- debug:
- msg: 'Set deploy scenario to {{ deploy_scenario }}'
-
-- name: Fail if the deploy scenario is not valid for stack '{{ stack_type }}'
- fail:
- msg: "'{{ deploy_scenario }}' is not valid for stack '{{ stack_type }}'"
- when: deploy_scenario not in scenarios
# NOTE (fdegir): as we determine things dynamically, we need to record variables in order
# for them to become available subsequent tasks, roles, playbooks
state: present
create: true
block: |
- distro: "{{ distro }}"
+ deploy_scenario: "{{ deploy_scenario }}"
provisioner_type: "{{ provisioner_type }}"
installer_type: "{{ installer_type }}"
marker: "# {mark} ANSIBLE MANAGED BLOCK engine-kubernetes"