Some quick updates

* Updating to use -a instead of --application
* use -r for jq, and not use sed
This commit is contained in:
Arif Ali 2022-03-14 12:04:57 +00:00
parent d05853ff71
commit 5695de6e99
Signed by: arif
GPG Key ID: 369608FBA1353A70
2 changed files with 23 additions and 14 deletions

View File

@ -4,26 +4,27 @@ juju_status_json=$(juju status --format json)
# ldap
for i in `seq 1 3`; do
ldap_ip=$(echo $juju_status_json | jq .applications[\"ldap-domain${i}\"].units[][\"public-address\"] | sed s/\"//g)
ldap_ip=$(echo $juju_status_json | jq -r .applications[\"ldap-domain${i}\"].units[][\"public-address\"])
juju config keystone-ldap-domain${i} ldap-server=ldap://${ldap_ip}
done
# landscape
landscape_ip=$(echo $juju_status_json | jq .applications[\"landscape-haproxy\"].units[][\"public-address\"] | sed s/\"//g)
landscape_ip=$(echo $juju_status_json | jq -r .applications[\"landscape-haproxy\"].units[][\"public-address\"])
juju run --all "echo ${landsape_ip} landscape.example.com | sudo tee -a /etc/hosts"
# fix ceilometer, so that it can get to keystone
juju run --application ceilometer "echo 10.0.1.216 keystone.example.com | sudo tee -a /etc/hosts"
juju run-action ceilometer/0 ceilometer-upgrade
juju run -a ceilometer "echo 10.0.1.216 keystone.example.com | sudo tee -a /etc/hosts"
juju run-action ceilometer/leader ceilometer-upgrade
# ensure openstack-service-checks can get to keystone
juju run --application openstack-service-checks "echo 10.0.1.216 keystone.example.com | sudo tee -a /etc/hosts"
juju run --application openstack-service-checks "echo 10.0.1.216 keystone-internal.example.com | sudo tee -a /etc/hosts"
juju run -a openstack-service-checks "echo 10.0.1.216 keystone.example.com | sudo tee -a /etc/hosts"
juju run -a openstack-service-checks "echo 10.0.1.216 keystone-internal.example.com | sudo tee -a /etc/hosts"
# ensure ceph-osd can get to vault
juju run --application ceph-osd "echo 10.0.1.222 vault.example.com | sudo tee -a /etc/hosts"
juju run --application ceph-osd "echo 10.0.1.222 vault-internal.example.com | sudo tee -a /etc/hosts"
juju run -a ceph-osd "echo 10.0.1.222 vault.example.com | sudo tee -a /etc/hosts"
juju run -a ceph-osd "echo 10.0.1.222 vault-internal.example.com | sudo tee -a /etc/hosts"
# Ensure heat domain, role and users have been set up
juju run-action --wait heat/leader domain-setup

View File

@ -2,14 +2,22 @@
# This is when landscape-haproxy the cert is SELFSIGNED. This will ensure that landscape will work
landscape_crt=$(juju run --application landscape-haproxy 'sudo openssl x509 -in /var/lib/haproxy/default.pem' | base64)
juju config landscape-client ssl-public-key="base64:${landscape_crt}"
juju config landscape-client-bionic ssl-public-key="base64:${landscape_crt}"
# And yes, this needs to use the IP address, otherwise the the registration will fail
landscape_ip=$(juju run --application landscape-haproxy 'unit-get private-address')
juju config landscape-client url="https://${landscape_ip}/message-system" ping-url="http://${landscape_ip}/ping"
juju config landscape-client-bionic url="https://${landscape_ip}/message-system" ping-url="http://${landscape_ip}/ping"
# May need to restart all the landscape-clients
#juju run --application landscape-client 'sudo systemctl restart landscape-client.service'
juju_status=$(mktemp)
juju status --format json > "${juju_status}"
clients=$(jq -r ".applications | to_entries[] | select(.value[\"charm-name\"] == \"landscape-client\") | .key" "${juju_status}")
for client in ${clients} ; do
juju config ${client} --reset ssl-public-key,url,ping-url
juju config ${client} ssl-public-key="base64:${landscape_crt}" \
url="https://${landscape_ip}/message-system" \
ping-url="http://${landscape_ip}/ping"
juju run -a ${client} 'sudo systemctl restart landscape-client.service'
done