nuka.hosts

Host

class nuka.hosts.HostGroup[source]

A dict like object to group hosts

class nuka.hosts.Host(*args, **kwargs)[source]

A host. Used by tasks as target

Docker

class nuka.hosts.DockerCompose(project_name=None, compose_file=None)[source]

A HostGroup that use the docker-compose.yml to provide some hosts:

>>> hosts = DockerCompose(project_name='myproject')
boot()[source]

launch docker-compose up and setup all containers

destroy()[source]

launch docker-compose down

class nuka.hosts.DockerContainer(hostname=None, image='bearstech/nukai:latest', **kwargs)[source]

By default the image will be bearstech/nukai:latest which is the latest debian with python3 installed but you can use whatever you want. We also provide a bunch of nukai(mages)

>>> host = DockerContainer(
...     hostname='myhost',
...     image='bearstech/nukai:debian-jessie-python3')
boot()[source]

boot the host

destroy()[source]

destroy the host

private_ip

return host’s private ip

public_ip

return host’s private ip

Vagrant

class nuka.hosts.Vagrant(**kwargs)[source]

A host configured using vagrant ssh-config

Libcloud

class nuka.hosts.Cloud(provider=None, driver_args=None, create=True, use_sudo=False)[source]

A HostGroup of cloud hosts

destroy()[source]

Destroy all hosts in the group

from_compose(project_name=None, filename='docker-compose.yml')[source]

Return a host group with hosts names extracted from compose file

get_node(hostname, **kwargs)[source]

Return a Host. Create it if needed

get_or_create_node(hostname, **kwargs)[source]

Return a Host. Create it if needed