Skip to content

Instantly share code, notes, and snippets.

Adam Israel AdamIsrael

Block or report user

Report or block AdamIsrael

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
AdamIsrael /
Last active May 20, 2019
Installing Juju 2.0 on Centos7

Juju 2.0 on Centos7

Configure epel repository

yum -y install epel-release
yum repolist

Install LXD

AdamIsrael /
Created Sep 28, 2018
Example reactive charm to test register_trigger
from charms.reactive import when, when_not, set_flag
from charmhelpers.core.hookenv import log, config
from charms.reactive.flags import register_trigger
# Register a trigger so that we can respond to config.changed, even if
# it's being cleared by another handler
AdamIsrael / gist:7ead3157593f87b98de9
Created Mar 25, 2015
Generate yaml for haproxy charm
View gist:7ead3157593f87b98de9
#!/usr/bin/env python
import json
service = [
'service_name': 'demo',
'service_options': ['mode http', 'balance leastconn', 'option httpchk GET / HTTP/1.0'],
'server_options': ['maxconn 100'],
'servers': [
AdamIsrael /
Last active Apr 17, 2019
Ingest a charm into gitlab and perform some common review queue steps
#!/usr/bin/env python
Setup notes:
Git needs to be configured on the machine doing the ingestion.
git config --global "Administrator"
git config --global ""
In Gitlab:
View gist:91a55cd01a5a0423431ad3a67bc28737
juju-log: Connecting to controller... ws:// as admin/admin
Traceback (most recent call last):
File "", line 253, in <module>
File "", line 246, in main
if ns.login():
File "", line 122, in login
self.client = self.loop.run_until_complete(self.connect())
File "/usr/lib/python3.7/asyncio/", line 584, in run_until_complete
return future.result()
AdamIsrael / log.txt
Created Nov 21, 2018
OSM R5 Install backtrace
View log.txt
multipass@big-bowerbird:~$ wget
--2018-11-21 14:51:57--
Resolving (
Connecting to (||:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 858 [text/x-sh]
Saving to: ‘’ 100%[===================================================================================================================================================================>] 858 --.-KB/s in 0s
AdamIsrael /
Last active Jun 7, 2018
pylxd testing

An example of connecting to your local LXD daemon.

AdamIsrael /
Last active Jun 5, 2018
Pre-cache the LXD image used when launching Juju machines
# This script will create xenial (and trusty, et al) lxd images that will
# be used by the lxd provider in juju 2.1+ It is for use with the lxd
# provider for local development and preinstalls a common set of production
# packages.
# This is important, as between them, basenode and layer-basic install ~111
# packages, before we even get to any packages installed by your charm.
lxc launch ubuntu:16.04 charm-snap -c security.nesting=true -c security.privileged=true
lxc exec charm-snap -- apt update
lxc exec charm-snap -- apt install -y squashfuse
# Restart required to avoid 'Setup snap "core" (3748) security profiles (cannot setup udev for snap "core": cannot reload udev rules: exit status 2'
lxc restart charm-snap
lxc exec charm-snap -- snap install charm
lxc exec charm-snap -- sh -c "rm -rf charms/layers; mkdir -p charms/layers; cd charms/layers; charm create simple; cd simple; charm build"

INFO: Using default charm template (reactive-python). To select a different template, use the -t option.                                
AdamIsrael /
Last active Jun 15, 2017
Contributing to the Juju Documentation

Juju Documentation Virtual Sprint

Why participate?

Good documentation saves you time, and writing documentation makes you a better developer.

Who can participate?

Anyone! We're looking for feedback from developers, casual and new users alike.

You can’t perform that action at this time.