Skip to content

Commit

Permalink
Fix sushy_emulator integration in reproducer
Browse files Browse the repository at this point in the history
It's a followup of openstack-k8s-operators#1753.
We get rid of realpath filter which resolves the path using the
controller's filesystem [1]. When the filesystems don't match between
the controller and the remote machine, we might hit somme issues.
For instance, when running controller on a Fedora CoreOS system,
the `/home` gets resolved as `/var/home` by realpath, leading to
incorrect path in remote machine.
Without `realpath`, we end up with the `..` in the path which is
a bit uggly but we keep the consistency.

Also, we set the hypervisor ansible user used as the emulator libvirt
user in order to have a more dynamic configuration, otherwise it fails
by default if hypervisor ansible user is not `zuul` (i.e default user).

[1] https://docs.ansible.com/ansible/latest/collections/ansible/builtin/realpath_filter.html#synopsis
  • Loading branch information
jcapiitao committed Jun 6, 2024
1 parent 327f2db commit 7db5155
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions roles/reproducer/molecule/crc_layout/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
cifmw_reproducer_repositories:
- src: "{{ lookup('env', 'HOME') }}/src/github.com/openstack-k8s-operators/ci-framework"
dest: "/home/zuul/src/github.com/openstack-k8s-operators/"
cifmw_sushy_emulator_hypervisor_target: controller-0
cifmw_libvirt_manager_configuration:
vms:
compute:
Expand Down Expand Up @@ -98,6 +99,9 @@
</network>
tasks:
- debug:
var: "{{ hostvars['instance'] }}"

- name: Load networking definition from scenario file
ansible.builtin.include_vars:
file: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/ci-framework/scenarios/reproducers/networking-definition.yml"
Expand Down
3 changes: 2 additions & 1 deletion roles/reproducer/tasks/configure_controller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
cifmw_sushy_emulator_sshkey_path: >-
{{
[_ctl_reproducer_basedir, '../.ssh/sushy_emulator-key'] |
path_join | realpath
path_join
}}
cifmw_podman_user_linger: "zuul"
cifmw_sushy_emulator_libvirt_user: "{{ hostvars[cifmw_sushy_emulator_hypervisor_target].ansible_user }}"
block:
- name: Ensure directories exist
ansible.builtin.file:
Expand Down
6 changes: 6 additions & 0 deletions roles/sushy_emulator/tasks/collect_details.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@
_sushy_url: "http://sushy-emulator.{{ _ingress_domain.stdout }}"
when: cifmw_sushy_emulator_install_type == 'ocp'

- debug:
var: "{{ hostvars['controller-0'] }}"

- debug:
var: "{{ hostvars[cifmw_sushy_emulator_hypervisor_target] }}"

- name: Create ssh key for Sushy Emulator
register: _sushy_emulator_key
community.crypto.openssh_keypair:
Expand Down

0 comments on commit 7db5155

Please sign in to comment.