shepherd.actions package

Submodules

shepherd.actions.ansible module

The ansible action handles generating a custom inventory file and running the supplied playbook on the stack instances. This also includes cloning the playbook down from a remote url if supplied instead of a path and installing the requirements from a requirements.yml file if one is found in the playbook directory.

The ansible action takes a 1. playbook name 2. a path or url for the playbook location 3. a vault_pass or a vault_key_file if your playbook

has a vault in it.
  1. tags or skip_tags to modify what tasks in the playbook run.
  2. extra_vars for variables that need to be passed in and
  3. opt_flags to add any extra flags to the ansible command.
  4. name of the stack to run on.
TODO:
  • Provide an option to supply a dict for mapping instance tags to groups in the inventory file that are used in the playbook.
  • Tests.
  • Provide a sample playbook repo with a requirements.yml file
class shepherd.actions.ansible.Ansible[source]

Bases: shepherd.common.plugins.Action

build_inventory(stack)[source]
install_playbook(**kwargs)[source]

Validates that self._playbook is a valid path or url. If it is a url git clone to /tmp. If it has a requires file install dependencies.

install_requirements()[source]
run(config, **kwargs)[source]

Run the ansible playbook on all hosts in the stack.

Args:
kwargs (dict): a dictionary of settings.
Notes:
  • Default naming for the inventory files use:

    [tag_stack_name_{stack_name}]
    {all instance ips}
    
    [tag_local_name_{local_name}]
    {instance ip}
    
    ...
    
validate(**kwargs)[source]

Validates the kwargs with the schema file.

Args:
kwargs (dict): a dictionary of settings.

shepherd.actions.create module

class shepherd.actions.create.CreateStack[source]

Bases: shepherd.common.plugins.Action

run(config, **kwargs)[source]

shepherd.actions.destroy module

class shepherd.actions.destroy.DestroyStack[source]

Bases: shepherd.common.plugins.Action

run(config, **kwargs)[source]

Module contents