
This commit adds simple roles to manage: - libvirt service, domains, volumes, networks and pools. - redfish-emulator role installs sushy-tools from pip, together with support packages Please note, that libvirt roles are not meant to be completely idempotent, their main job is deploy temporary resources that for ci and gating purposes, to be tore down afterwards. Roles are specifically made to be simple to debug, and don't contain any complex logic to make them portable, flexible or idempotent. Change-Id: I2ff0138b5c95bea3445e242a2e5061651498f1ab
38 lines
966 B
YAML
38 lines
966 B
YAML
- block:
|
|
- name: Ensuring python3-pip and support packages are present
|
|
when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux'
|
|
fail:
|
|
msg: "CentoOS or RHEL is not currently supported"
|
|
|
|
- name: Ensuring python3-pip and support packages are present
|
|
become: true
|
|
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
|
|
apt:
|
|
name:
|
|
- python3-pip
|
|
- python3-libvirt
|
|
- python-libvirt
|
|
state: present
|
|
|
|
- name: Install sushy-tools
|
|
pip:
|
|
name: sushy-tools
|
|
executable: pip3
|
|
become: true
|
|
|
|
- name: install systemd sushy service unit
|
|
become: true
|
|
template:
|
|
src: sushy-tools.service.j2
|
|
dest: /etc/systemd/system/sushy-tools.service
|
|
notify:
|
|
- reload systemd configuration
|
|
- restart sushy-emulator
|
|
|
|
- name: start sushy-emulator service
|
|
become: true
|
|
service:
|
|
name: sushy-tools
|
|
state: started
|
|
enabled: true
|