Skip to content

dariko/ansible-module-docker_stack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

docker_stack ansible module

This ansible module deploys/deprovisions docker stacks invoking the docker stack command on the target node.

module parameters

parameter name required default description

name

yes

stack name

state

yes

stack status (present or absent)

prune

no

If true will add the --prune option to the docker command.

compose_yaml

no

string containing the yaml definition of the stack

compose_file

no

path on the module executing node of a file containing.

compose_yaml OR compose_file parameters required

return value

The module returns a variable docker_stack_spec_diff which contains the differences between the Spec field of the stack services before and after applying the new stack definition.
For example, deleting removing the environment variables from a service named test_service in a stack named test_stack with this task:

-   name: test service
    run_once: yes
    docker_stack:
        state: present
        name: test_stack
        compose_yaml:
            version: '3'
            services:
                test_service:
                    image: alpine:latest

will return:

changed: [test_host] => {
    "changed": true,
    "docker_stack_specs_diff": "{'test_stack_test_service': {u'TaskTemplate': {u'ContainerSpec': {delete: [u'Env']}}}}",
    "invocation": {
        "module_args": {
            "compose_file": null,
            "compose_yaml": "{'services': {'test_service': {'image': 'alpine:latest'}}, 'version': '3'}",
            "name": "test_stack",
            "state": "present"
        }
    }
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages