Skip to content

Commit b594d11

Browse files
hjensasopenshift-merge-bot[bot]
authored andcommitted
Enable sushy-emulator in create-infra.yml
For adoption of the ironic service we need a Virtual BMC for spinning up test workloads on the OSP 17.x cloud, and to validate workload operations after adoption. This change ensure the controller is started at the end of create-infra, and does the neccecary steps to apply and validate the sushy-emulator running as a POD on the controller node. I have switched the use of `ansible.builtin.package` to `ansible.builtin.dnf` in some places to avoid issues with hostvars lookups raising undefined variable errors.
1 parent b794aa2 commit b594d11

File tree

4 files changed

+66
-9
lines changed

4 files changed

+66
-9
lines changed

create-infra.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,66 @@
7575
ansible.builtin.import_role:
7676
name: "libvirt_manager"
7777
tasks_from: "deploy_layout.yml"
78+
79+
- name: Gather ansible_user_id
80+
ansible.builtin.setup:
81+
gather_subset:
82+
- user_id
83+
- user_dir
84+
85+
- name: Ensure controllers vms are started and reachable
86+
when: groups.controllers | default([]) | length > 0
87+
vars:
88+
_cifmw_libvirt_manager_layout:
89+
vms:
90+
controllers:
91+
start: true
92+
disk_file_name: "dummy"
93+
cifmw_libvirt_manager_all_vms: >-
94+
{%- set vms = {} -%}
95+
{%- for vm in groups.controllers | default([]) -%}
96+
{%- set _ = vms.update({vm: 'controllers'}) -%}
97+
{%- endfor -%}
98+
{{ vms }}
99+
ansible_libvirt_pools: {}
100+
ansible.builtin.include_role:
101+
name: "libvirt_manager"
102+
tasks_from: "start_vms.yml"
103+
apply:
104+
delegate_to: "{{ cifmw_target_host | default('localhost') }}"
105+
106+
# This bootstraps the controller-0 node, and RedFish virtual BMC is
107+
# spawned if cifmw_use_sushy_emulator is enabled.
108+
- name: Bootstrap sushy-emulator (RedFish Virtual BMC) on controller-0
109+
when:
110+
- "'controllers' in groups"
111+
- "'controllers' in group_names"
112+
- cifmw_use_sushy_emulator | default(false) | bool
113+
delegate_to: controller-0
114+
become: true
115+
vars:
116+
cifmw_sushy_emulator_hypervisor_target: "{{ cifmw_target_host }}"
117+
cifmw_sushy_emulator_hypervisor_address: "{{ cifmw_target_host }}.utility"
118+
cifmw_sushy_emulator_install_type: podman
119+
cifmw_podman_user_linger: "zuul"
120+
block:
121+
- name: Run reproducer roles rhos_release tasks on controller-0
122+
ansible.builtin.include_role:
123+
name: reproducer
124+
tasks_from: rhos_release.yml
125+
126+
- name: Include role sushy_emulator
127+
ansible.builtin.include_role:
128+
name: sushy_emulator
129+
130+
- name: Generate baremetal-info fact
131+
vars:
132+
cifmw_sushy_emulator_uri: 'http://sushy.utility:8000'
133+
ansible.builtin.include_role:
134+
name: reproducer
135+
tasks_from: generate_bm_info.yml
136+
137+
- name: Verify connection to baremetal VMs via Sushy Emulator
138+
ansible.builtin.include_role:
139+
name: sushy_emulator
140+
tasks_from: verify.yml

roles/adoption_osp_deploy/tasks/main.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,10 @@
1717
- name: Validate 17.1 scenario definition
1818
ansible.builtin.import_tasks: validate_scenario.yml
1919

20-
- name: Ensure controller and undercloud vms are started and reachable
20+
- name: Ensure undercloud vms are started and reachable
2121
vars:
2222
_cifmw_libvirt_manager_layout:
2323
vms:
24-
controllers:
25-
start: true
26-
disk_file_name: "dummy"
2724
osp-underclouds:
2825
start: true
2926
disk_file_name: "dummy"
@@ -32,9 +29,6 @@
3229
{%- for vm in _vm_groups['osp-underclouds'] -%}
3330
{%- set _ = vms.update({vm: 'osp-underclouds'}) -%}
3431
{%- endfor -%}
35-
{%- for vm in _vm_groups['controllers'] -%}
36-
{%- set _ = vms.update({vm: 'controllers'}) -%}
37-
{%- endfor -%}
3832
{{ vms }}
3933
ansible_libvirt_pools: {}
4034
ansible.builtin.include_role:

roles/podman/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
- name: Ensure podman is installed
1818
become: true
19-
ansible.builtin.package:
19+
ansible.builtin.dnf:
2020
name: "{{ cifmw_podman_packages }}"
2121
state: present
2222

roles/sushy_emulator/tasks/main.yml

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

2323
- name: Install required packages
2424
become: true
25-
ansible.builtin.package:
25+
ansible.builtin.dnf:
2626
name: httpd-tools
2727
state: present
2828

0 commit comments

Comments
 (0)