This file contains hidden or 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
@when('pgsql.connected') | |
@when_not('data-api.database.requested') | |
def request_postgresql_database(pgsql): | |
"""Request PGSql DB | |
""" | |
conf = config() | |
status_set('maintenance', 'Requesting database for data-api') | |
pgsql.set_database(conf.get('db-name', 'data_api')) |
This file contains hidden or 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
wget https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img | |
qemu-img create -f qcow2 ub1.img 50G | |
sudo virt-resize --format qcow2 --output-format qcow2 --expand /dev/sda1 xenial-server-cloudimg-amd64-disk1.img | |
ub1.img | |
This file contains hidden or 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
*.img | |
*.raw |
This file contains hidden or 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
*.img | |
*.raw |
This file contains hidden or 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
# $ cat user-data | |
# #cloud-config | |
# password: mysecret | |
# chpasswd: { expire: False } | |
# ssh_pwauth: True | |
# $ cat meta-data | |
# instance-id: juju-controller-0 | |
# local-hostname: juju-controller-0 |
This file contains hidden or 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
series: xenial | |
applications: | |
newcharm: | |
charm: "cs:~jamesbeedy/newcharm-6" | |
num_units: 2 | |
annotations: | |
"gui-x": "714" | |
"gui-y": "362.5" | |
to: | |
- "0" |
This file contains hidden or 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
from charmhelpers.core.hookenv import network_get | |
from charms.reactive import set_flag, clear_flag | |
from charms.reactive import Endpoint | |
class HttpProvides(Endpoint): | |
def configure(self, port, interface_name): | |
""" | |
Configure the HTTP relation by providing a port and interface_name. |
This file contains hidden or 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
function show_juju_env { | |
local model | |
local controller | |
model=`juju whoami --format json | jq -r '.["model"]'` | |
controller=`juju whoami --format json | jq -r '.["controller"]'` | |
printf "%s:%s" "$controller" "$model" | |
} | |
export PS1="[\[\e\[\033[01;32m\]\$(show_juju_env)\[\e[0m\]]\n${PS1}"; |
This file contains hidden or 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
haproxy: | |
ssl_key: | | |
------- BASE64 ENCODED PRIVATE SSL KEY ---- | |
... | |
--------------- END KEY ------------------- | |
ssl_cert: | | |
---- BASE 64 ENCODED PRIVATE SSL CERT ----- | |
... | |
----------------- END CERT ---------------- |
This file contains hidden or 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 | |
set -e | |
model="`juju models --format json | jq -r '.["current-model"]'`" | |
users=`juju show-model $model --format json | model=$model jq '.[env.model]["users"]' | jq -r 'keys[] as $k | "\($k)"'` | |