46100f03c7
Change-Id: I1c7f3892a03536d94064da1722751eb6683da451 Signed-off-by: Dimitrios Markou <dimitrios.markou@att.com>
42 lines
1.0 KiB
Bash
Executable File
42 lines
1.0 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Utility to execute OpenStack CLI using Heat container.
|
|
# This is an example, and should be adjusted to ones needs.
|
|
#
|
|
# Usage: openstack endpoint list
|
|
|
|
set -e
|
|
|
|
OS_CLOUD_CFG=${HOME}/.openstack/clouds.yaml
|
|
|
|
: ${TERM_OPTS:=-it}
|
|
|
|
: ${OSH_KEYSTONE_URL:='https://identity-sw.atlantafoundry.com/v3'}
|
|
: ${OSH_REGION_NAME:='airship-seaworthy'}
|
|
: ${OSH_ADMIN_PASSWD:='password123'}
|
|
|
|
if [ ! -f $OS_CLOUD_CFG ]; then
|
|
echo " => Creating OpenStack client config"
|
|
mkdir -p ~/.openstack
|
|
tee $OS_CLOUD_CFG << EOF
|
|
clouds:
|
|
openstack_helm:
|
|
region_name: '${OSH_REGION_NAME}'
|
|
identity_api_version: 3
|
|
auth:
|
|
username: 'admin'
|
|
password: '${OSH_ADMIN_PASSWD}'
|
|
project_name: 'admin'
|
|
project_domain_name: 'default'
|
|
user_domain_name: 'default'
|
|
auth_url: '${OSH_KEYSTONE_URL}'
|
|
EOF
|
|
fi
|
|
|
|
exec sudo docker run --rm ${TERM_OPTS} --net host \
|
|
-v $(pwd):/target \
|
|
-v ${OS_CLOUD_CFG}:/etc/openstack/clouds.yaml:ro \
|
|
-e OS_CLOUD=openstack_helm \
|
|
docker.io/openstackhelm/heat:ocata openstack "$@"
|
|
|