Last active
August 29, 2015 14:15
-
-
Save mikemccracken/74a909a886e0bc6f0097 to your computer and use it in GitHub Desktop.
a script to swap out the glance-simplestreams-sync charm and deploy a new one
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# TO use this to TEST: | |
# 1. run cloud-installer and wait until everything is up, including letting the default charm pull down an image (or an error if you require proxies) | |
# 2. connect to the install host (multi) or top container (single) | |
# 3. juju ssh nova-cloud-controller/0 | |
# 3a. source /tmp/openstack-admin* | |
# 3b. glance image-list (there should be one or zero) | |
# 3c. if there's an image, glance image-delete <that image's ID> | |
# 4. clone this script on the juju host | |
# 5. run this script and wait to see if the sync charm succeeds. | |
# set HTTP-proxy manually or do this | |
#source ~/.juju-proxy | |
export JUJU_HOME=~/.cloud-install/juju | |
juju destroy-service glance-simplestreams-sync | |
# status --format=online is only in 1.21 and later: | |
#STATUS=$(juju status glance-simplestreams-sync --format=oneline) | |
STATUS=$(juju status glance-simplestreams-sync | grep units) | |
until [ "x$STATUS" == "x" ]; do | |
echo "waiting for old service to die, status: $STATUS" | |
STATUS=$(juju status glance-simplestreams-sync | grep units) | |
sleep 2 | |
done | |
wget -O master.tar.gz https://api.github.com/repos/Ubuntu-Solutions-Engineering/glance-simplestreams-sync-charm/tarball/proxy-wrapper | |
# NOTE: edit distro: | |
rm -rf local-charms | |
mkdir -p local-charms/trusty/ | |
tar -C local-charms -zxf master.tar.gz | |
mv local-charms/Ubuntu-Solutions-Engineering-glance-simplestreams-sync-charm* local-charms/trusty/glance-simplestreams-sync | |
juju deploy --to lxc:1 --repository=local-charms local:trusty/glance-simplestreams-sync --config ~/.cloud-install/charmconf.yaml | |
juju add-relation glance-simplestreams-sync keystone | |
juju add-relation glance-simplestreams-sync rabbitmq-server |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tested and glance syncs the images:
http://paste.ubuntu.com/10586917/