kollacli.common.ansible package

Submodules

kollacli.common.ansible.actions module

kollacli.common.ansible.actions.deploy(hostnames=[], serial_flag=False, verbose_level=1, servicenames=[])[source]
kollacli.common.ansible.actions.destroy_hosts(hostnames, destroy_type, verbose_level=1, include_data=False, remove_images=False)[source]

destroy containers on a set of hosts.

The containers on the specified hosts will be stopped or killed.

kollacli.common.ansible.actions.precheck(hostnames, verbose_level=1)[source]

run check playbooks on a set of hosts

kollacli.common.ansible.actions.reconfigure(verbose_level=1)[source]
kollacli.common.ansible.actions.stop_hosts(hostnames=[], verbose_level=1)[source]

stop containers on a set of hosts.

The containers on the specified hosts will be stopped or killed if the stop takes over 20 seconds.

kollacli.common.ansible.actions.upgrade(verbose_level=1, servicenames=[])[source]

kollacli.common.ansible.job module

class kollacli.common.ansible.job.AnsibleJob(cmd, deploy_id, print_output, inventory_path)[source]

Bases: object

class for running ansible commands

get_command_output()[source]

get command output

get final output text from command execution

get_error_message()[source]

“get error message

get_status()[source]

get process status

status: - None: running - 0: done, success - 1: done, error - 2: done, killed by user

json_load(string_var, raise_on_err=False)[source]
kill()[source]

kill job in progress

The process pid is owned by root, so that is not killable. Need to kill all its children.

run()[source]
wait()[source]

wait for job to complete

return status of job (see get_status for status values)

kollacli.common.ansible.playbook module

class kollacli.common.ansible.playbook.AnsiblePlaybook[source]

Bases: object

deploy_id = None
extra_vars = ''
flush_cache = True
groups = None
hosts = None
ignore_error_strings = None
include_passwords = True
inventory = None
playbook_path = ''
print_output = True
run()[source]
serial = False
services = None
verbose_level = 0

Module contents