---
# This task takes nodes prepaired and deploys cockpit, ovirt deployment and scripts cluster initilization. ONLY RUN THIS ON FIRST NODE OF CLUSTER
# v0.001 20210222
# file: /roles/task_hci_setup.yml
# Documentation
- name: Check if rpm ovirt-release44 is already installed
yum:
list: ovirt-release44
register: yum_list
- name: Conditionally do next thing
debug:
msg: "ovirt-release44 Not installed"
when: yum_list.results | selectattr("yumstate", "match", "installed") | list | length == 0
# Add oVirt Repo manual.
- name: Download oVirt Repo RPM
get_url:
dest: ~/ovirt-release44.rpm
mode: '0440'
when: yum_list.results | selectattr("yumstate", "match", "installed") | list | length == 0
- name: Install Python3 as this is needed for oVirt.
yum:
name:
- python3
state: latest
become: true
- name: For some reason install of oVirt Repo fails as package so have to run as shell
command: "rpm -ivh ~/ovirt-release44.rpm"
when: yum_list.results | selectattr("yumstate", "match", "installed") | list | length == 0
- name: With new oVirt repo.. install rest of HCI dependancies
yum:
name:
- cockpit-ovirt-dashboard
- vdsm-gluster
- ovirt-host
- ovirt-ansible-roles
- ovirt-ansible-infra
state: latest
become: true
# Set variable for first node in cluster list to set as ignition master
- name: Only on first node thor deploy ovirt-engine-appliance
yum:
name:
- ovirt-engine-appliance
state: latest
become: true
when: "'{{ hci_ignition_node }}' in inventory_hostname"
# on local ansible host install galaxy modules
# Broken: I need a means to check if installed. If so .. don't install again.
# - name: Install Galaxy Modules on local ansible host
# local_action:
# module: shell
# _raw_params: ansible-galaxy install oVirt.ovirt-ansible-roles
# # when: <check for something to show galaxy installed module
- name: Start cockpit service
service:
name=cockpit
state=started
enabled=yes
when: "'{{ hci_ignition_node }}' in inventory_hostname"
################################
####### HCI Deploy #############
################################