ceph/qa/qa_scripts/openstack/execs/libvirt-secret.sh
Alan Somers 3aae5ca6fd scripts: fix bash path in shebangs
/bin/bash is a Linuxism.  Other operating systems install bash to
different paths.  Use /usr/bin/env in shebangs to find bash.

Signed-off-by: Alan Somers <asomers@gmail.com>
2017-07-27 13:24:26 -06:00

20 lines
422 B
Bash
Executable File

#!/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}