コード例 #1
0
ファイル: install_maas.py プロジェクト: frobware/jujuWand
def main():
    runner = Runner('maas.yaml')
    settings = runner.settings

    set_maas_defaults(runner, settings)

    ppas = [
        'ppa:maas/stable',
    ]
    shelly.install_ppas(ppas)
    packages = [
        'maas',
        'wsmancli',
        'amtterm',
        'simplestreams',
        'ubuntu-cloudimage-keyring',
        'apache2',
    ]
    shelly.install_packages(packages)

    if not os.path.islink('/usr/local/bin/amttool'):
        runner.sudo('ln -s {pdu_path}/amttool /usr/local/bin/amttool')

    setup_maas_server(runner, settings)
    setup_mirror(runner)
    setup_network(runner, settings)
    wait_for_quiet(90)
    setup_maas_nodes(runner, settings)

    setup_maas_fabrics(runner)

    runner.save_settings()
コード例 #2
0
ファイル: install_maas.py プロジェクト: dooferlad/jujuWand
def set_maas_defaults(r, settings):
    shelly.install_packages(['debconf-utils'])
    deb_config = [
        'maas-cluster-controller	maas-cluster-controller/maas-url	string	http://{ipaddress}/MAAS',
        'maas-region-controller-min	maas/default-maas-url	string	{ipaddress}',
    ]

    f = tempfile.NamedTemporaryFile(mode='w', delete=False)
    for cfg in deb_config:
        f.write(cfg.format(**settings) + '\n')
    f.close()

    r.sudo('debconf-set-selections ' + f.name)
    os.unlink(f.name)
コード例 #3
0
ファイル: install_maas.py プロジェクト: dooferlad/jujuWand
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('--version', default=1.9, type=float)
    args = parser.parse_args()

    runner = Runner('maas.yaml')
    settings = runner.settings

    set_maas_defaults(runner, settings)

    if args.version > 1.8:
        ppas = [
            'ppa:maas/stable',
        ]
        try:
            shelly.install_ppas(ppas)
        except subprocess.CalledProcessError:
            print("Couldn't find a MAAS PPA for this distro. Continuing without...")

    packages = [
        'maas',
        'wsmancli',
        'amtterm',
        'simplestreams',
        'ubuntu-cloudimage-keyring',
        'apache2',

        # Not strictly needed, but, well, I need them.
        'bwm-ng',
        'nethogs',
        'htop',
        'byobu',
    ]
    shelly.install_packages(packages)

    if not os.path.islink('/usr/local/bin/amttool'):
        runner.sudo('ln -s {pdu_path}/amttool /usr/local/bin/amttool')

    setup_maas_server(runner, settings)
    setup_dns_and_keys(runner)
    setup_mirror(runner)
    setup_network(runner, settings)

    wait_for_boot_resources(runner)
    print('waiting for quiet...')
    wait_for_quiet(90)
    print('lets import some nodes!')

    setup_maas_nodes(runner, settings)

    if args.version > 1.8:
        setup_maas_fabrics(runner)

    runner.save_settings()

    if args.version <= 1.8:
        print(dedent("""
              !!! You *must* set up:\n
               * The default route in the MAAS network
               * Upstream DNS
               * Your SSH key(s)
              """))