Ejemplo n.º 1
0
def deploy(bootstrap_node_name, bundle_charm):
    if not bootstrapped():
        juju('bootstrap --upload-tools --to "{}"'.format(
              bootstrap_node_name))
    wait()
    juju('deploy ' + bundle_charm)
    wait()
Ejemplo n.º 2
0
def main():
    controller = 'maas'  # bundle specifies series, so leave it unset.
    clean(controller)
    bootstrap(controller, params={'to': 'mal.maas'})
    deploy_bundle('openstack-base', 42)
    wait()
    pprint(status())
Ejemplo n.º 3
0
def main(controller, series):
    clean(controller)
    bootstrap(controller, params={
        'bootstrap-series': series
    })

    #juju('deploy /home/dooferlad/charms/builds/resource-get-test')
    juju('deploy /home/dooferlad/charms/builds/resource-get-test --resource '
         'aresource=/home/dooferlad/a-file.bin')
    wait()
Ejemplo n.º 4
0
def main():
    vlans = [
        VLAN('internal', '192.168.10.0/24', 10, 'enp2s0.10'),
        VLAN('public', '192.168.11.0/24', 11, 'enp2s0.11'),
        VLAN('db', '192.168.12.0/24', 12, 'enp2s0.12'),
    ]

    bundle_charm = 'charms/mediawiki/bundle.yaml'

    bootstrap_node = maas_setup(vlans, bundle_charm)
    deploy('maas', 'maas', bootstrap_node, bundle_charm)
    wait()
    check(vlans, bundle_charm)
Ejemplo n.º 5
0
def main(stop, controller, hosts, guests, wait_between_guests, deploy):
    clean(controller)
    bootstrap(controller)

    wait()
    for i in range(hosts):
        juju('add-machine')
    wait()

    first = True
    for j in range(guests):
        for i in range(hosts):
            if not deploy:
                juju('add-machine lxd:{}'.format(i))

            else:
                # Deploy the Ubuntu charm instead of just adding a machine
                if first:
                    juju('deploy ubuntu --to lxd:{}'.format(i))
                    first = False
                else:
                    juju('add-unit ubuntu --to lxd:{}'.format(i))

        if wait_between_guests:
            wait()

    wait()

    if stop:
        clean(controller)
Ejemplo n.º 6
0
def main():
    controllers = ['maas-trusty', 'maas-xenial', 'maas-precise']

    # first kill everything
    for controller in controllers + ['maas']:
        clean(controller)

    # now boot on everything
    for controller in controllers:
        bootstrap(controller, params={'to': 'zoe.maas'})
        # bootstrap(controller, params={'to': 'mal.maas'})
        juju('add-machine')
        wait()
        pprint(status())
        clean(controller)
Ejemplo n.º 7
0
def main():
    controller = 'maas-xenial'  # bundle specifies series, so leave it unset.
    clean(controller)
    bootstrap(controller, params={'to': 'mal.maas'})

    wait()

    machines = 1
    containers = 2

    if machines > 1:
        juju('add-machine -n {}'.format(machines-1))
    for i in range(machines):
        for j in range(containers):
            juju('add-machine lxc:{}'.format(i))

    wait()
Ejemplo n.º 8
0
def main(stop):
    controller = 'lxd'
    clean(controller)
    bootstrap(controller)

    wait()

    juju('add-model foo')
    juju('add-model bar')

    machines = 1
    containers = 2

    for i in range(machines):
        juju('add-machine -m foo')
        juju('add-machine -m bar')
        for j in range(containers):
            juju('add-machine -m foo lxd:{}'.format(i))
            juju('add-machine -m bar lxd:{}'.format(i))

    wait()
    if stop:
        juju('destroy-controller {} --destroy-all-models -y'.format(controller))
        clean(controller)
Ejemplo n.º 9
0
def main(controller, cloud, series):
    clean(controller)
    bootstrap(controller, cloud, params={
        'bootstrap-series': series,
        'to': 'wash.maas',
    })
    wait()

    # Since this is Juju 2.0 and we can't co-host (well, it isn't preferable)
    # add a machine (i.e. machine 0 in the default model).
    juju('add-machine mal.maas')
    wait()
    juju('add-machine lxd:0')
    wait()
Ejemplo n.º 10
0
def deploy(controller_name, cloud, bootstrap_node_name, bundle_charm):
    bootstrap(controller_name, cloud, bootstrap_node_name)
    
    juju('deploy ' + bundle_charm)
    wait()
Ejemplo n.º 11
0
#!/usr/bin/python

import wand

wand.wait(True)
Ejemplo n.º 12
0
    services = status()['services']
    for service in services.values():
        for unit in service['units']:
            for relation in service['relations'].keys():
                address = service_address(unit, relation)

                found = False
                for vlan in vlans:
                    if ipaddress.IPv4Address(address) in vlan.network.hosts():
                        print(unit, relation, address, 'in', vlan.name)
                        found = True
                        continue

                if not found:
                    print(unit, relation, address, 'not in a VLAN')


if __name__ == '__main__':
    vlans = [
        VLAN('internal', '192.168.10.0/24', 10, 'enp2s0.10'),
        VLAN('public', '192.168.11.0/24', 11, 'enp2s0.11'),
        VLAN('db', '192.168.12.0/24', 12, 'enp2s0.12'),
    ]

    bundle_charm = 'charms/mediawiki/bundle.yaml'

    #bootstrap_node = maas_setup(vlans, bundle_charm)
    #deploy(bootstrap_node, bundle_charm)
    wait()
    check(vlans)
Ejemplo n.º 13
0
def main(controller, cloud, series):
    clean(controller)
    bootstrap(controller, cloud, params={
        'bootstrap-series': series
    })
    wait()