summaryrefslogtreecommitdiffstats
path: root/qa/qa_scripts/openstack/execs/libvirt-secret.sh
blob: 75e9e91a0c7e978eca8a75da9718c39a0061bc6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env bash
set -f

#
# Generate a libvirt secret on the Openstack node. 
#
openstack_node=${1}
uuid=`uuidgen`
cat > secret.xml <<EOF
<secret ephemeral='no' private='no'>
  <uuid>${uuid}</uuid>
  <usage type='ceph'>
    <name>client.cinder secret</name>
  </usage>
</secret>
EOF
sudo virsh secret-define --file secret.xml
sudo virsh secret-set-value --secret ${uuid} --base64 $(cat client.cinder.key)
echo ${uuid}