Skip to content

Instantly share code, notes, and snippets.

View adam-stokes's full-sized avatar
🦧

Adam Stokes adam-stokes

🦧
  • North Carolina
  • 05:20 (UTC -04:00)
View GitHub Profile
def container_run(name, cmd, nowait=False):
""" run command in container
:param str name: name of container
:param str cmd: command to run
"""
ip = container_ip(name)
cmd = "sudo -H -u {3} TERM=xterm256-color ssh -t -q " \
"-l ubuntu -o \"StrictHostKeyChecking=no\" " \
"-o \"UserKnownHostsFile=/dev/null\" " \
# Copied from lp:landscape-charm /config/landscape-deployments.yaml
# and then:
# # charm no longer requires a license file
# sed -e 's/license-file$/\/dev\/null/g' -i landscape-deployments.yaml
#
# Users who want to use the landscape installer should:
# # $CONTENTS here is what is in https://pastebin.canonical.com/112787/
# # for now. When landscape is released, we can make this something public.
# sed -e 's/include-file:\/\/repo-file/$CONTENTS/g' -i landscape-deployments.yaml
_common:
# Copied from lp:landscape-charm /config/landscape-deployments.yaml
# and then:
# # charm no longer requires a license file
# sed -e 's/license-file$/\/dev\/null/g' -i landscape-deployments.yaml
#
# Users who want to use the landscape installer should:
# # $CONTENTS here is what is in https://pastebin.canonical.com/112787/
# # for now. When landscape is released, we can make this something public.
# sed -e 's/include-file:\/\/repo-file/$CONTENTS/g' -i landscape-deployments.yaml
_common:
# Copied from lp:landscape-charm /config/landscape-deployments.yaml
# and then:
# # charm no longer requires a license file
# sed -e 's/license-file$/\/dev\/null/g' -i landscape-deployments.yaml
#
# Users who want to use the landscape installer should:
# # $CONTENTS here is what is in https://pastebin.canonical.com/112787/
# # for now. When landscape is released, we can make this something public.
# sed -e 's/include-file:\/\/repo-file/$CONTENTS/g' -i landscape-deployments.yaml
_common:
language: python
python:
- 3.4
notifications:
email: false
cache: apt
before_install:
- "sudo add-apt-repository -y ppa:cloud-installer/experimental"
- "sudo apt-get update"
install:
@adam-stokes
adam-stokes / config-single.yaml
Created January 27, 2015 18:28
single config for openstack installer
headless: false
install_only: false
install_type: Single
openstack_password: pass
upstream_deb: openstack_0.21-0ubuntu1_all.deb
# vlan config
bucket:
&myinterfaces |
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
@adam-stokes
adam-stokes / config.yaml
Last active August 29, 2015 14:15
OpenStack Installer - Single install mode with custom VM constraints
install_type: Single
placements:
controller:
assignments:
LXC:
- nova-cloud-controller
- glance
- glance-simplestreams-sync
- openstack-dashboard
- juju-gui
diff --git a/cloudinstall/placement/controller.py b/cloudinstall/placement/controller.py
index 939d1a7..805a7e9 100644
--- a/cloudinstall/placement/controller.py
+++ b/cloudinstall/placement/controller.py
@@ -167,7 +167,8 @@ class PlacementController:
def charm_classes(self):
cl = [m.__charm_class__ for m in
load_charms(self.config.getopt('charm_plugin_dir'))
- if not m.__charm_class__.disabled]
+ if not m.__charm_class__.disabled and not
def update(self):
for cc in self.controller.charm_classes():
if self.machine:
if not satisfies(self.machine, cc.constraints)[0] \
or not self.controller.is_assigned(cc, self.machine):
self.remove_service_widget(cc)
continue
if self.unplaced_only: