Skip to content

Commit 200d6f6

Browse files
committed
split sushy playbook in two, added tasks to create baremetal playbook to discover uuid
1 parent 895022b commit 200d6f6

File tree

3 files changed

+76
-0
lines changed

3 files changed

+76
-0
lines changed

etc/kayobe/environments/stackhpc-sushy-baremetal/ansible/create-virtual-baremetal.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,15 @@
5050
autostart: false
5151
boot_firmware: uefi
5252
delegate_to: localhost
53+
54+
- name: Discover Virtual Baremetal UUID
55+
ansible.builtin.command:
56+
cmd: "sudo virsh domuuid {{ inventory_hostname }}"
57+
register: sushy_uuid
58+
failed_when:
59+
- sushy_uuid.rc != 0
60+
changed_when: false
61+
62+
- name: Set uuid fact
63+
ansible.builtin.set_fact:
64+
uuid: "{{ sushy_uuid.stdout }}"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
- name: Set up Sushy Host
3+
hosts: "{{ sushy_host | default('localhost') }}"
4+
become: true
5+
gather_facts: false
6+
tasks:
7+
- name: Install package dependencies
8+
ansible.builtin.dnf:
9+
name:
10+
- qemu-kvm
11+
- libvirt
12+
- libvirt-devel
13+
- python3-devel
14+
state: present
15+
16+
- name: Start and enable the QEMU service
17+
ansible.builtin.systemd_service:
18+
name: virtqemud
19+
state: started
20+
enabled: true
21+
22+
- name: Start and enable the virtual storage service
23+
ansible.builtin.systemd_service:
24+
name: virtstoraged
25+
state: started
26+
enabled: true
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
- name: Ensure Sushy Emulator is deployed
3+
hosts: "{{ sushy_host | default('localhost') }}"
4+
become: true
5+
gather_facts: false
6+
tasks:
7+
- name: Create Sushy configuration directory
8+
ansible.builtin.file:
9+
path: /etc/sushy
10+
state: directory
11+
12+
- name: Template Sushy configuration
13+
ansible.builtin.template:
14+
src: "{{ sushy_directory }}/sushy.conf.j2"
15+
dest: "/etc/sushy/sushy.conf"
16+
17+
- name: Enable Rocky devel repository
18+
community.general.dnf_config_manager:
19+
name: devel
20+
state: enabled
21+
- name: Create Sushy virtualenv
22+
ansible.builtin.pip:
23+
name:
24+
- libvirt-python
25+
- sushy-tools
26+
virtualenv: /opt/kayobe/venvs/sushy
27+
virtualenv_command: python3 -m venv
28+
29+
- name: Template Sushy service unit file
30+
ansible.builtin.template:
31+
src: "{{ sushy_directory }}/sushyemud.service.j2"
32+
dest: "/etc/systemd/system/sushyemud.service"
33+
34+
- name: Start and enable the Sushy Emulator service
35+
ansible.builtin.systemd_service:
36+
name: sushyemud
37+
state: started
38+
enabled: true

0 commit comments

Comments
 (0)