Skip to content

Commit 2dbe639

Browse files
committed
guestfs: Fix the use of libvirt_uri
When using community.libvirt.virt, the libvirt URI is passed in as a module parameter. When invoking the "virsh" command, the URI has to be set via an environment variable, which I forgot to do when converting the guestfs bringup shell scripts to an Ansible playbook. Fixes: 45548d2 ("guestfs: Convert scripts/bringup_guestfs.sh to Ansible") Fixes: 9831f59 ("guestfs: Copy "network" tag steps to guestfs role") Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent fd202e0 commit 2dbe639

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

playbooks/roles/guestfs/tasks/bringup/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@
112112
register: passthrough_devices
113113

114114
- name: Attach PCIe passthrough devices to each target node
115+
environment:
116+
LIBVIRT_DEFAULT_URI: "{{ libvirt_uri }}"
115117
ansible.builtin.command:
116118
argv:
117119
- "virsh"

playbooks/roles/guestfs/tasks/bringup/network.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@
6464
become: true
6565
become_flags: 'su - -c'
6666
become_method: ansible.builtin.sudo
67+
environment:
68+
LIBVIRT_DEFAULT_URI: "{{ libvirt_uri }}"
6769
ansible.builtin.shell: virsh net-list | grep -q default
6870
register: libvirt_default_net
6971
ignore_errors: true
@@ -75,6 +77,8 @@
7577
become: true
7678
become_flags: 'su - -c'
7779
become_method: ansible.builtin.sudo
80+
environment:
81+
LIBVIRT_DEFAULT_URI: "{{ libvirt_uri }}"
7882
ansible.builtin.command:
7983
cmd: "virsh net-start default"
8084
changed_when: true

0 commit comments

Comments
 (0)