123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- # 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: Check existence of awx and grafana on management station
- block:
- - name: Check AWX instance
- command: awx --version
- changed_when: false
- - name: Check grafana service
- command: kubectl get svc -n grafana
- register: grafana_svc_register
- failed_when: "'grafana' not in grafana_svc_register.stdout"
- changed_when: false
- rescue:
- - name: AWX and grafana needs to be installed
- fail:
- msg: "{{ control_plane_installation_required }}"
- - name: Saving management station os
- set_fact:
- mgmt_os: "{{ ansible_facts['distribution'] | lower }}"
- - block:
- - name: Fetch SElinux mode
- command: sestatus
- register: sestatus_current
- changed_when: false
- - name: Check SELinux status
- debug:
- msg: "{{ selinux_warning }}"
- when: '"SELinux status: disabled" in sestatus_current.stdout_lines'
- - name: Set SElinux to permissive mode
- command: setenforce 0
- when: '"SELinux status: enabled" in sestatus_current.stdout_lines'
- when: os_supported_leap not in mgmt_os
- - name: Check that the telemetry_base_vars.yml exists
- stat:
- path: "{{ base_vars_file }}"
- register: stat_result
- - name: Fail if telemetry_base_vars.yml file doesn't exist
- fail:
- msg: "{{ fail_msg_base_vars }}"
- when: not stat_result.stat.exists
- - name: Check that telemetry_login_vars.yml exists
- stat:
- path: "{{ login_vars_file }}"
- register: stat_result
- - name: Fail if telemetry_login_vars.yml file doesn't exist
- fail:
- msg: "{{ fail_msg_login_vars }}"
- when: not stat_result.stat.exists
- - name: Check that control_plane/login_vars.yml exists
- stat:
- path: "{{ ctrl_plane_login_vars_filename }}"
- register: stat_result
- - name: Fail if control_plane/login_vars.yml file doesn't exist
- fail:
- msg: "{{ ctrl_plane_fail_msg_login_vars }}"
- when: not stat_result.stat.exists
- - name: Install openshift using pip3
- pip:
- name: "{{ item }}"
- state: present
- executable: pip3
- with_items: "{{ pip_packages }}"
- - name: Install sqldb collection
- command: ansible-galaxy collection install "{{ mysqldb_collection_name }}"
- changed_when: false
|