Juju Gui - Wily

by jbthechamp83
3 deployments · 2 still active · last rev. 9 months ago

Preconfigured with manual usage of juju gui - be sure to set your fqdn

Compatible with: No distros currently supported
# <UDF name="fqdn" Label="Fully Qualified Domain Name" />
# <UDF name="console_password" Label="Juju admin console password" />
# Juju bootstrap for Linode.  Ubuntu 15.10 tested.  Configured for Manual Provision.
# Copyright (c) 2015 James Barlow <james@dockerd.io>.
# My ref: https://www.linode.com/?r=6bc13d37a6384afa18b7ba182e355e40a12e10c0
logger System Installing Juju

source <ssinclude StackScriptID=1>

system_set_hostname "$FQDN"

apt-get update && apt-get -y install python-software-properties && add-apt-repository -y ppa:juju/stable && apt-get update && apt-get -y install juju-core && apt-get -y upgrade

logger System Create the juju user
groupadd juju && useradd -d /home/juju -g juju -m -s /bin/bash juju

logger System Give the user juju temp full access
echo 'juju ALL=NOPASSWD: ALL' > /etc/sudoers.d/juju
chmod 0440 /etc/sudoers.d/juju

logger System Generate SSH keys
su -l -c 'ssh-keygen -t rsa -b 2048 -f ~/.ssh/id_rsa -N ""' juju
su -l -c 'cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys2' juju

logger System Generate juju config
su -l -c 'juju generate-config' juju
su -l -c 'juju switch manual' juju

logger System Update environments.yaml for our needs
su -l -c "sed -i \"/type\: manual$/ a\        admin-secret: $CONSOLE_PASSWORD\" ~/.juju/environments.yaml" juju
su -l -c "sed -i \"s/somehost.example.com/$FQDN/\" ~/.juju/environments.yaml" juju

logger System Bootstrap
su -l -c 'juju bootstrap' juju

#If you don't want the GUI, disable this
logger System Installing juju gui
su -l -c 'juju deploy cs:wily/juju-gui --to 0' juju
su -l -c 'juju expose juju-gui' juju

logger System Remove juju from sudo
rm -f /etc/sudoers.d/juju

logger System Stack script juju install complete