Update MOTD with MOSK access data
Also install openstack clients on seed node
MOSSUST-122
Change-Id: Ie49523beb64aa771bab774433d53a8af03e4397b
diff --git a/bm_mcc_mosk/mcc_seed_2401_userdata.yaml b/bm_mcc_mosk/mcc_seed_2401_userdata.yaml
index 4a17192..503e018 100644
--- a/bm_mcc_mosk/mcc_seed_2401_userdata.yaml
+++ b/bm_mcc_mosk/mcc_seed_2401_userdata.yaml
@@ -106,7 +106,12 @@
sudo cp /home/ubuntu/.ssh/authorized_keys /home/regional/.ssh/authorized_keys
sudo chmod 600 /home/regional/.ssh/authorized_keys
sudo chown -R regional:regional /home/regional
- apt-get ${APT_OPTS} -y install bridge-utils docker.io ipmitool wget golang-cfssl jq
+ apt-get ${APT_OPTS} -y install bridge-utils docker.io ipmitool wget golang-cfssl jq python3-pip
+ pip install yq virtualenv
+ virtualenv openstack_clients
+ source openstack_clients/bin/activate
+ pip install python-openstackclient python-heatclient
+ deactivate
usermod -aG docker ubuntu
echo "Sending wait_condition signal"
diff --git a/bm_mcc_mosk/seed/do_deploy_mcc_mgmt.sh b/bm_mcc_mosk/seed/do_deploy_mcc_mgmt.sh
index 022632b..3ecc3de 100755
--- a/bm_mcc_mosk/seed/do_deploy_mcc_mgmt.sh
+++ b/bm_mcc_mosk/seed/do_deploy_mcc_mgmt.sh
@@ -79,3 +79,5 @@
echo r00tme | /root/kaas-bootstrap/container-cloud bootstrap user add --username root --roles global-admin,management-admin,reader,writer,operator --kubeconfig kubeconfig --password-stdin
/root/kaas-bootstrap/bin/kind delete cluster -n clusterapi
unset KUBECONFIG
+
+bash /root/bm_mcc_mosk/utils/update_bash_autocompletion_kaas.sh
\ No newline at end of file
diff --git a/bm_mcc_mosk/utils/update_bash_autocompletion_kaas.sh b/bm_mcc_mosk/utils/update_bash_autocompletion_kaas.sh
new file mode 100755
index 0000000..1e5e23e
--- /dev/null
+++ b/bm_mcc_mosk/utils/update_bash_autocompletion_kaas.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+filepath=/etc/bash_completion.d/kaas
+cat > ${filepath} <<EOF
+PATH=${PATH}:~/kaas-bootstrap/bin
+if [ -f ~/.kube/kind-config-clusterapi ] ; then export KUBECONFIG=~/.kube/kind-config-clusterapi ; fi
+if [ -f ~/kubeconfig ]; then export KUBECONFIG=~/kubeconfig ; fi
+if [ -f ~/bootstrap/dev/kubeconfig ]; then export KUBECONFIG=~/bootstrap/dev/kubeconfig; fi
+if [ -f ~/child.kubeconfig ]; then export KUBECONFIG=~/child.kubeconfig; fi
+if [[ -f ~/clouds.yaml && -f /usr/local/bin/yq ]] ; then
+ export OS_CLOUD=admin
+ OS_USERNAME=$(yq .clouds.admin.auth.username clouds.yaml)
+ OS_PASSWORD=$(yq .clouds.admin.auth.password clouds.yaml)
+ OS_AUTH_URL=$(yq .clouds.admin.auth.auth_url clouds.yaml)
+fi
+
+echo
+echo "KUBECONFIG=${KUBECONFIG}"
+echo "kubectl=$(which kubectl)"
+echo
+echo "OS_USERNAME=${OS_USERNAME}"
+echo "OS_PASSWORD=${OS_PASSWORD}"
+echo
+[[ -f ~/openstack_clients/bin/activate ]] && echo "OpenStack shell clients at 'source ~/openstack_clients/bin/activate'"
+echo
+echo "Horizon at ${OS_AUTH_URL/keystone/horizon}"
+echo
+EOF