Assumptions: the charm name is fluentd
Register an account on launchpad, if you don't already have one. You'll need the name later in the process.
- Create a launchpad branch of the deployable charm
[~/charms/layers/fluentd] $ charm build| set -ex | |
| REGISTRY_INGRESS_IP=10.73.177.23 | |
| REGISTRY_INGRESS_HOSTNAME=registry.$REGISTRY_INGRESS_IP.xip.io | |
| REQ_CN=10.73.177.126 | |
| # if [ ! -e $REGISTRY_INGRESS_HOSTNAME.key ]; then | |
| # echo '{"CN":"'$REGISTRY_INGRESS_HOSTNAME'","hosts":[""],"key":{"algo":"rsa","size":2048}}' | cfssl gencert -config=ca-config.json -ca=ca.pem -ca-key=ca-key.pem -hostname="$REGISTRY_INGRESS_HOSTNAME" - | cfssljson -bare $REGISTRY_INGRESS_HOSTNAME | |
| # fi |
| @when('leadership.is_leader') | |
| def add_leader_config(): | |
| render_master_config() | |
| @when_not('leadership.is_leader') | |
| def add_slave_config(): | |
| render_slave_config() | |
| @when('leadership.is_leader') |
| services: | |
| rabbitmq-server: | |
| charm: cs:trusty/rabbitmq-server | |
| options: | |
| management_plugin: 'true' | |
| to: | |
| - lxc:10 | |
| ceilometer: | |
| charm: ceilometer | |
| options: |
Place the vagrant file in your $CHARM_DIR root. This may move at a later date, but for internal testing, just put it there and stop fighting me on this.
Also fetch the supporting juju-vagrant-setup.sh script - this is the driver behind the vagrant automation until we find a better process to execute the code. Embedding bash inline in a yaml file is supported: but the yaml parser chokes if you have #'s inline. It interprets the rest of the line as a comment regardless of scope. end. of. story.
| def validate_database_relationship(): | |
| #Connect to the sentrys and fetch the transmitted details | |
| sent_config = d.sentry.unit['mysql/0'].relation('db', 'owncloud:db') | |
| #Connect to owncloud's sentry and read the configuration PHP file | |
| prod_config = d.sentry.unit['owncloud/0'].file_contents('/var/www/owncloud/config/config.php') | |
| cfg_to_check = {'dbuser': 'user', 'dbpass': 'password', 'dbhost': 'host'} | |
| for cfg_file_key, juju_cfg_key in cfg_to_check.items(): | |
| #Search the return string of the config for the transmit values | |
| if prod_config.find("'%s' => '%s'" % (cfg_file_key, sent_config[juju_cfg_key]) == -1: |
| #!/usr/bin/python3 | |
| import amulet | |
| d = amulet.Deployment() | |
| d.add('mysql') | |
| d.add('wordpress', units=3) | |
| d.relate('mysql:db', 'wordpress:db') | |
| d.configure('wordpress', tuning='bare') |
| #!/bin/bash | |
| juju-log "Adding Canonical Partner repository" | |
| RELEASE_CODE=`lsb_release -sc` | |
| add-apt-repository "deb http://archive.canonical.com/ ${RELEASE_CODE} partner" | |
| apt-get update | |
| apt-get -y install -qq --no-install-recommends debconf-utils | |
| echo "sun-java6-plugin shared/accepted-sun-dlj-v1-1 boolean true" | debconf-set-selections |
| <html> | |
| <head> | |
| <style type="text/css"> | |
| .border{ | |
| border: 2px solid #000; | |
| width: 605px; | |
| overflow: hidden; | |
| } | |
| .steps { | |
| border: 1px dashed #c0c0c0; |
| function EmbedVid(someID) | |
| { | |
| html = $('#embed-template').clone(); | |
| html.attr('flashvars','value="file=upload/' + someID + '.flv&image=images/vidThumbs/' + someID + '.jpg"'); | |
| html.find('embed').attr('flashvars','file=upload/' + someID + '.flv&image=images/vidThumbs/' + someID + '.jpg"'); | |
| // better clear the video holder | |
| $('#video-holder').empty(); | |
| $('#video-holder').append(html); | |
| } |