File tree Expand file tree Collapse file tree 3 files changed +30
-17
lines changed
etc/kayobe/environments/stackhpc-sushy-baremetal
inventory/group_vars/sushy-libvirt Expand file tree Collapse file tree 3 files changed +30
-17
lines changed Original file line number Diff line number Diff line change 3737 libvirt_vms :
3838 - state : present
3939 name : " {{ inventory_hostname }}"
40- xml_file : " {{ sushy_directory }}/vbmc-node.xml.j2"
40+ memory_mb : ' 4657'
41+ vcpus : ' 2'
42+ # xml_file: "{{ sushy_directory }}/vbmc-node.xml.j2"
4143 volumes :
4244 - name : ' {{ inventory_hostname }}.qcow2'
4345 device : ' disk'
5254 delegate_to : localhost
5355
5456 - 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
57+ ansible.builtin.command : " virsh domuuid {{ inventory_hostname }}"
58+ register : vm_uuid_result
59+ delegate_to : localhost
6160
62- - name : Set uuid fact
61+ - name : Persist UUID fact
6362 ansible.builtin.set_fact :
64- uuid : " {{ sushy_uuid.stdout }}"
63+ uuid : " {{ vm_uuid_result.stdout }}"
64+ delegate_to : " {{ inventory_hostname }}"
65+ delegate_facts : true
66+
67+ - name : Ensure host_vars directory exists
68+ ansible.builtin.file :
69+ path : " {{ inventory_dir }}/host_vars/{{ inventory_hostname }}"
70+ state : directory
71+ delegate_to : localhost
72+
73+ - name : Write UUID to host_vars
74+ ansible.builtin.copy :
75+ dest : " {{ inventory_dir }}/host_vars/{{ inventory_hostname }}/uuid.yml"
76+ content : " uuid: {{ vm_uuid_result.stdout }}\n "
77+ delegate_to : localhost
Original file line number Diff line number Diff line change 55 gather_facts : false
66 tasks :
77 - name : Install package dependencies
8- ansible.builtin.dnf :
9- name :
10- - qemu-kvm
11- - libvirt
12- - libvirt-devel
13- - python3-devel
14- state : present
8+ ansible.builtin.dnf :
9+ name :
10+ - qemu-kvm
11+ - libvirt
12+ - libvirt-devel
13+ - python3-devel
14+ state : present
1515
1616 - name : Start and enable the QEMU service
1717 ansible.builtin.systemd_service :
Original file line number Diff line number Diff line change 11---
22
3- ironic_redfish_system_id: "{{ '/redfish/v1/Systems/' + inventory_hostname | to_uuid }}"
3+ ironic_redfish_system_id: "{{ '/redfish/v1/Systems/' + hostvars[ inventory_hostname]['uuid'] }}"
44
55redifsh_address: "http://192.168.33.3:34343"
66ironic_redfish_address: "192.168.33.3:34343"
You can’t perform that action at this time.
0 commit comments