X-Git-Url: https://gerrit.nordix.org/gitweb?p=infra%2Fstack%2Fkubernetes.git;a=blobdiff_plain;f=playbooks%2Froles%2Fbootstrap-swconfig%2Ftasks%2Fmain.yaml;fp=playbooks%2Froles%2Fbootstrap-swconfig%2Ftasks%2Fmain.yaml;h=5f64622930ed63605e0174d8312f2aac7304dbbe;hp=46db541181f2b863868479fd9b8f135750e5760f;hb=d7c1e7673b19be3c8ee33283762aba19a606b6cd;hpb=bfdd3d8ef9d2aa002bab69ebd36f971df3918146 diff --git a/playbooks/roles/bootstrap-swconfig/tasks/main.yaml b/playbooks/roles/bootstrap-swconfig/tasks/main.yaml index 46db541..5f64622 100644 --- a/playbooks/roles/bootstrap-swconfig/tasks/main.yaml +++ b/playbooks/roles/bootstrap-swconfig/tasks/main.yaml @@ -17,9 +17,18 @@ # 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: @@ -57,14 +66,6 @@ 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 @@ -74,7 +75,7 @@ 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"