Ejemplo n.º 1
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.º 2
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.º 3
0
def main():
    _, rc = juju("status -m lxd:default", fail_ok=True)
    if rc == 0:
        juju("kill-controller lxd -y")
    bootstrap('lxd')
    juju("upgrade-gui ~/Downloads/jujugui-2.1.1.tar.bz2")
    juju("gui")
Ejemplo n.º 4
0
def main(controller):
    clean(controller)
    bootstrap(controller, params={
        'to': 'zoe.maas',
        'keep-broken': '',
        #'config': 'bootstrap-timeout=2000',
    })
    juju('deploy mysql')
Ejemplo n.º 5
0
def main():
    controller = 'maas-proxied'
    #juju destroy-environment -y maas-proxied ; juju bootstrap --upload-tools && juju deploy mysql
    if bootstrapped(controller):
        juju("kill-controller -y {}".format(controller))
        time.sleep(3)
    bootstrap(controller)
    juju('set-model-config http-proxy=192.168.0.22')
    juju('deploy mysql')
Ejemplo n.º 6
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.º 7
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.º 8
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.º 9
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.º 10
0
def main(controller, series):
    clean(controller)
    bootstrap(controller, params={
        'bootstrap-series': series
    })

    juju('switch {}:controller'.format(controller))
    juju('enable-ha')

    return

    juju_bin = run('which juju', quiet=True).rstrip()
    run('cp {} /tmp'.format(juju_bin), quiet=True)
    run('cp {}d /tmp'.format(juju_bin), quiet=True)

    out = juju('add-user testuser', quiet=True)
    for line in out.splitlines():
        if re.search('juju register', line):
            cmd = line
            break

    sudo('/tmp/juju {}'.format(cmd), user='******')
    sudo('/tmp/juju ensure-availability', user='******')
Ejemplo n.º 11
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.º 12
0
def main():
    controller = 'maas-precise'
    clean(controller)
    bootstrap(controller, params={'to': 'zoe.maas'})
Ejemplo n.º 13
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.º 14
0
def main(controller, cloud, series):
    clean(controller)
    bootstrap(controller, cloud, params={
        'bootstrap-series': series
    })
    wait()