From 37ae64b1df1db7ff42a1b6483f7a0bda51cc3220 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Tue, 11 Jun 2019 13:30:55 -0400 Subject: [PATCH] Improve libvirt key handling --- roles/pvc/tasks/libvirt.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/roles/pvc/tasks/libvirt.yml b/roles/pvc/tasks/libvirt.yml index 8b349b0..dcf6a6a 100644 --- a/roles/pvc/tasks/libvirt.yml +++ b/roles/pvc/tasks/libvirt.yml @@ -20,12 +20,16 @@ - ceph-secret.xml notify: restart libvirtd +- name: get ceph libvirt secret key + command: ceph auth get-key client.libvirt + register: libvirt_key + - name: define ceph secret command: virsh secret-define /etc/libvirt/ceph-secret.xml ignore_errors: true -- name: set ceph secret value - command: virsh secret-set-value --secret {{ ceph_storage_secret_uuid }} --base64 {{ ceph_storage_secret_key }} +- name: set ceph libvirt secret value + command: virsh secret-set-value --secret {{ ceph_storage_secret_uuid }} --base64 {{ libvirt_key.stdout }} ignore_errors: true - name: configure libvirt for listening