Skip to content

Commit 57739ff

Browse files
claudia-lolarocky Cloud User
authored andcommitted
changes to libvirt_vm role to replace use of xml file
1 parent 870672e commit 57739ff

File tree

5 files changed

+17
-105
lines changed

5 files changed

+17
-105
lines changed

etc/kayobe/environments/stackhpc-baremetal/ansible/baremetal-1-check-bmc-up.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,16 @@
5858
validate_certs: false
5959
timeout: 10
6060

61-
#TODO(ClaudiaWatson): add an optional BMC reboot into the flow
62-
- name: Reboot BMC
63-
community.general.redfish_command:
64-
category: Manager
65-
command: PowerReboot
66-
username: "{{ ironic_redfish_username }}"
67-
password: "{{ ironic_redfish_password }}"
68-
when:
69-
- kayobe_bmc_up == ""
70-
- ironic_redfish_username is defined
61+
# #TODO(ClaudiaWatson): add an optional BMC reboot into the flow
62+
# - name: Reboot BMC
63+
# community.general.redfish_command:
64+
# category: Manager
65+
# command: PowerReboot
66+
# username: "{{ ironic_redfish_username }}"
67+
# password: "{{ ironic_redfish_password }}"
68+
# when:
69+
# - kayobe_bmc_up == ""
70+
# - ironic_redfish_username is defined
7171

7272
- name: Check BMC back up again
7373
ansible.builtin.uri:

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

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@
3434
name: stackhpc.libvirt-vm
3535
vars:
3636
libvirt_vm_arch: x86_64
37+
libvirt_vm_default_uuid_deterministic: true
3738
libvirt_vms:
3839
- state: present
3940
name: "{{ inventory_hostname }}"
40-
uuid: "{{ uuid }}"
41+
# uuid: "{{ uuid }}"
4142
memory_mb: '4660'
4243
vcpus: '2'
4344
cpu_mode: 'host-model'
@@ -46,10 +47,10 @@
4647
- name: '{{ inventory_hostname }}.qcow2'
4748
device: 'disk'
4849
format: 'qcow2'
49-
# capacity: '20GB'
50+
capacity: '20GB'
5051
pool: 'default'
51-
file_path: '/var/lib/libvirt/images/{{ inventory_hostname }}.qcow2'
52-
type: 'file'
52+
# file_path: '/var/lib/libvirt/images/{{ inventory_hostname }}.qcow2'
53+
# type: 'file'
5354
interfaces:
5455
- network: 'default'
5556
source:
@@ -59,26 +60,3 @@
5960
autostart: false
6061
boot_firmware: uefi
6162
delegate_to: localhost
62-
63-
- name: Discover Virtual Baremetal UUID
64-
ansible.builtin.command: "virsh domuuid {{ inventory_hostname }}"
65-
register: vm_uuid_result
66-
delegate_to: localhost
67-
68-
- name: Persist UUID fact
69-
ansible.builtin.set_fact:
70-
uuid: "{{ vm_uuid_result.stdout }}"
71-
delegate_to: "{{ inventory_hostname }}"
72-
delegate_facts: true
73-
74-
- name: Ensure host_vars directory exists
75-
ansible.builtin.file:
76-
path: "{{ inventory_dir }}/host_vars/{{ inventory_hostname }}"
77-
state: directory
78-
delegate_to: localhost
79-
80-
- name: Write UUID to host_vars
81-
ansible.builtin.copy:
82-
dest: "{{ inventory_dir }}/host_vars/{{ inventory_hostname }}/uuid.yml"
83-
content: "uuid: {{ vm_uuid_result.stdout }}\n"
84-
delegate_to: localhost

etc/kayobe/environments/stackhpc-sushy-baremetal/ansible/sushy-emulator.yml

Lines changed: 0 additions & 66 deletions
This file was deleted.

etc/kayobe/environments/stackhpc-sushy-baremetal/ansible/sushyemud.service.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Description=Virtual Redfish BMC service
33

44
[Service]
5-
ExecStart=/opt/kayobe/venvs/sushy/bin/sushy-emulator -i 192.168.33.3 -p 34343 --config /etc/sushy/sushy.conf
5+
ExecStart=/opt/kayobe/venvs/sushy/bin/sushy-emulator -i 192.168.33.3 -p 34343 --config /etc/sushy/sushy.conf --debug
66

77
[Install]
88
WantedBy=multi-user.target default.target

etc/kayobe/environments/stackhpc-sushy-baremetal/inventory/group_vars/sushy-libvirt/ironic

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22

3-
ironic_redfish_system_id: "{{ '/redfish/v1/Systems/' + hostvars[inventory_hostname]['uuid'] }}"
3+
ironic_redfish_system_id: "{{ '/redfish/v1/Systems/' + (inventory_hostname | to_uuid) }}"
44

55
redifsh_address: "http://192.168.33.3:34343"
66
ironic_redfish_address: "192.168.33.3:34343"

0 commit comments

Comments
 (0)