From 62cf304edef637a7a062079fcc2bb36e13591691 Mon Sep 17 00:00:00 2001 From: Wes Hayutin Date: Tue, 17 Jan 2017 16:29:37 -0500 Subject: [PATCH] virtualbmc setup is not working in devmode.sh Some workflows like devmode will not have facts collected on the virthost e.g. devmode.sh. This occurs when quickstart.sh is invoked multiple times. Do not rely on facts to get the uuid of the non_root_user, instead delegate to the virthost and get the uuid and set a fact. Closes-Bug: #1657248 Change-Id: I5d087983b1794c10c311bc44b162428c2cc7e476 --- roles/undercloud-deploy/tasks/configure-vbmc.yml | 15 ++++++++++++++- roles/undercloud-setup/meta/main.yaml | 2 ++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 roles/undercloud-setup/meta/main.yaml diff --git a/roles/undercloud-deploy/tasks/configure-vbmc.yml b/roles/undercloud-deploy/tasks/configure-vbmc.yml index 4e022d6c4..a1c764552 100644 --- a/roles/undercloud-deploy/tasks/configure-vbmc.yml +++ b/roles/undercloud-deploy/tasks/configure-vbmc.yml @@ -8,10 +8,23 @@ use: yum become: true +# the non_root_user id is not in the facts of the virthost when +# executed in devmode. To be safe let's delegate to the virthost +# and obtain the uuid of the non_root_user +- name: get virthost non_root_user userid + shell: id -u {{ non_root_user }} + register: non_root_user_uid + delegate_to: virthost + +- name: set fact on non_root_user_uid + set_fact: + non_root_user_uid: "{{ non_root_user_uid.stdout }}" + - name: Create the Virtual BMCs when: release not in ['liberty', 'mitaka', 'newton'] command: > - vbmc add {{item.name}} --port {{item.virtualbmc_port}} --libvirt-uri "qemu+ssh://{{ non_root_user }}@{{ networks[0].address }}/session?socket=/run/user/{{ hostvars[groups['virthost'][0]].non_root_user_uid }}/libvirt/libvirt-sock&keyfile=/root/.ssh/id_rsa_virt_power&no_verify=1&no_tty=1" + vbmc add {{item.name}} --port {{item.virtualbmc_port}} --libvirt-uri + "qemu+ssh://{{ non_root_user }}@{{ networks[0].address }}/session?socket=/run/user/{{ non_root_user_uid }}/libvirt/libvirt-sock&keyfile=/root/.ssh/id_rsa_virt_power&no_verify=1&no_tty=1" with_items: "{{ overcloud_nodes }}" become: true become_user: root diff --git a/roles/undercloud-setup/meta/main.yaml b/roles/undercloud-setup/meta/main.yaml new file mode 100644 index 000000000..11d75570b --- /dev/null +++ b/roles/undercloud-setup/meta/main.yaml @@ -0,0 +1,2 @@ +dependencies: + - extras-common \ No newline at end of file