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 ce0f0c2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
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_id }}"
block:
- name: Ensure directories exist
ansible.builtin.file:
Expand Down
1 change: 1 addition & 0 deletions roles/sushy_emulator/molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
ansible.builtin.add_host:
name: "{{ cifmw_sushy_emulator_hypervisor_target }}"
ansible_host: "{{ hostvars['instance']['ansible_default_ipv4']['address'] }}"
ansible_user: zuul

- name: "Add host key to {{ cifmw_sushy_emulator_hypervisor_target }}"
ansible.builtin.shell:
Expand Down
3 changes: 3 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,9 @@
_sushy_url: "http://sushy-emulator.{{ _ingress_domain.stdout }}"
when: cifmw_sushy_emulator_install_type == 'ocp'

- 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 ce0f0c2

Please sign in to comment.