123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- # Copyright 2022 Dell Inc. or its subsidiaries. All Rights Reserved.
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- ---
- - name: Initialize variables
- set_fact:
- mngmnt_network_container_status: false
- tags: init
- - name: Check mngmnt_network_container status on the machine
- command: kubectl get pods -n network-config
- register: mngmnt_network_container_result
- failed_when: false
- changed_when: false
- tags: init
- - name: Validate if mngmnt_network is present if device_config is false
- set_fact:
- mngmnt_network_container_status: true
- when: "'mngmnt-network-container' in mngmnt_network_container_result.stdout"
- tags: init
- - name: Validate if mngmnt_network is present if device_config is false
- assert:
- that: device_config_support != false
- success_msg: "{{ mgmnt_device_fail }}"
- fail_msg: "{{ mgmnt_device_fail }}"
- when: mngmnt_network_container_status
- tags: validate
- - name: Assert value of idrac_support if mngmnt_network container needed
- assert:
- that: idrac_support == true
- success_msg: "{{ idrac_support_valid }}"
- fail_msg: " {{ failed_idrac_support }}"
- when: device_config_support
- tags: validate
- - block:
- - name: Assert ethernet_switch_support
- assert:
- that: ethernet_switch_support == true or ethernet_switch_support == false
- success_msg: "{{ ethernet_switch_support_success_msg }}"
- fail_msg: "{{ ethernet_switch_support_fail_msg }}"
- tags: validate
- - name: Assert ib_switch_support
- assert:
- that: ib_switch_support == true or ib_switch_support == false
- success_msg: "{{ ib_switch_support_success_msg }}"
- fail_msg: "{{ ib_switch_support_fail_msg }}"
- tags: validate
- - name: Assert powervault_support
- assert:
- that: powervault_support == true or powervault_support == false
- success_msg: "{{ powervault_support_success_msg }}"
- fail_msg: "{{ powervault_support_fail_msg }}"
- tags: validate
- when: device_support_status
- - block:
- - name: Check value of ethernet_switch_support when not device_config_support
- assert:
- that: ethernet_switch_support == true
- success_msg: "{{ ethernet_device_config }}"
- failed_when: false
- tags: validate
- - name: Set ethernet_switch_support when not device_config_support
- set_fact:
- ethernet_switch_support: false
- tags: init
- - name: Check value of ib_switch_support when not device_config_support
- assert:
- that: ib_switch_support == true
- success_msg: "{{ ib_device_config }}"
- failed_when: false
- tags: validate
- - name: Set ib_switch_support when not device_config_support
- set_fact:
- ib_switch_support: false
- tags: init
- - name: Check value of powervault_support when not device_config_support
- assert:
- that: powervault_support == true
- success_msg: "{{ pv_device_config }}"
- failed_when: false
- tags: validate
- - name: Set powervault_support when not device_config_support
- set_fact:
- powervault_support: false
- tags: init
- when: not device_support_status
|