This commit is contained in:
Cory Hawkless 2020-07-30 17:13:29 +09:30
commit 57fee762a3
2 changed files with 32 additions and 0 deletions

26
tasks/main.yml Normal file
View File

@ -0,0 +1,26 @@
- name: Check if libvirt RBD secret set
command: virsh secret-get-value {{ openstack_rbd_secret_uuid }}
register: virsh_secret_result
changed_when: false
failed_when: false
tags: libvirt-secret
- name: Generate libvirt RBD secret definition
template:
src: templates/rbd_secret.xml.j2
dest: /tmp/secret.xml
# when: virsh_secret_result.rc != 0
ignore_errors: yes
tags: libvirt-secret
- name: Define libvirt RBD secret
command: virsh secret-define /tmp/secret.xml
# when: virsh_secret_result.rc != 0
ignore_errors: yes
tags: libvirt-secret
- name: Set libvirt RBD secret
command: virsh secret-set-value {{ openstack_rbd_secret_uuid }} {{ openstack_rbd_secret_key }}
# when: virsh_secret_result.rc != 0
ignore_errors: yes
tags: libvirt-secret

View File

@ -0,0 +1,6 @@
<secret ephemeral='no' private='no'>
<uuid>{{openstack_rbd_secret_uuid}}</uuid>
<usage type='ceph'>
<name>client.openstack secret</name>
</usage>
</secret>