aboutsummaryrefslogtreecommitdiff
path: root/ansible/library
diff options
context:
space:
mode:
authorSamYaple <sam@yaple.net>2016-01-01 03:44:57 +0000
committerSamYaple <sam@yaple.net>2016-01-04 10:57:54 +0000
commit9e2e5f914f7ae829958d4e6d7c69d2b4c7d0362f (patch)
treed131425df0498595b5da6c8566239b7df0d1553e /ansible/library
parent912ecd0dfc5be0eb152d33b375ce13c9df126f02 (diff)
downloadkolla-9e2e5f914f7ae829958d4e6d7c69d2b4c7d0362f.tar.gz
kolla-9e2e5f914f7ae829958d4e6d7c69d2b4c7d0362f.zip
Update kolla_docker documentation
Change-Id: Ic236371cdf545a09e8a3c9e41abd7eb82a3d8bb3 Partially-Implements: blueprint kolla-docker-module
Diffstat (limited to 'ansible/library')
-rw-r--r--ansible/library/kolla_docker.py129
1 files changed, 124 insertions, 5 deletions
diff --git a/ansible/library/kolla_docker.py b/ansible/library/kolla_docker.py
index b2006b435..bb1d8f957 100644
--- a/ansible/library/kolla_docker.py
+++ b/ansible/library/kolla_docker.py
@@ -17,15 +17,118 @@
DOCUMENTATION = '''
---
module: kolla_docker
-short_description: Module for controling Docker
+short_description: Module for controlling Docker
description:
- - A module targeting at controling Docker as used by Kolla.
+ - A module targeting at controlling Docker as used by Kolla.
options:
- example:
+ common_options:
description:
- - example
+ - A dict containing common params such as login info
+ required: False
+ type: dict
+ default: dict()
+ action:
+ description:
+ - The action the module should take
required: True
+ type: str
+ choices:
+ - create_volume
+ - pull_image
+ - remove_container
+ - remove_volume
+ - start_container
+ api_version:
+ description:
+ - The version of the api for docker-py to use when contacting docker
+ required: False
+ type: str
+ default: auto
+ auth_email:
+ description:
+ - The email address used to authenticate
+ required: False
+ type: str
+ auth_password:
+ description:
+ - The password used to authenticate
+ required: False
+ type: str
+ auth_registry:
+ description:
+ - The registry to authenticate to
+ required: False
+ type: str
+ auth_username:
+ description:
+ - The username used to authenticate
+ required: False
+ type: str
+ detach:
+ description:
+ - Detach from the container after it is created
+ required: False
+ default: True
+ type: bool
+ name:
+ description:
+ - Name of the container or volume to manage
+ required: False
+ type: str
+ environment:
+ description:
+ - The environment to set for the container
+ required: False
+ type: dict
+ image:
+ description:
+ - Name of the docker image
+ required: False
+ type: str
+ pid_mode:
+ description:
+ - Set docker pid namespace
+ required: False
+ type: str
+ default: None
+ choices:
+ - host
+ privileged:
+ description:
+ - Set the container to privileged
+ required: False
+ default: False
+ type: bool
+ remove_on_exit:
+ description:
+ - When not detaching from container, remove on successful exit
+ required: False
+ default: True
type: bool
+ restart_policy:
+ description:
+ - Determine what docker does when the container exits
+ required: False
+ type: str
+ choices:
+ - never
+ - on-failure
+ - always
+ restart_retries:
+ description:
+ - How many times to attempt a restart if restart_policy is set
+ type: int
+ default: 10
+ volumes:
+ description:
+ - Set volumes for docker to use
+ required: False
+ type: list
+ volumes_from:
+ description:
+ - Name or id of container(s) to use volumes from
+ required: True
+ type: list
author: Sam Yaple
'''
@@ -34,7 +137,23 @@ EXAMPLES = '''
tasks:
- name: Start container
kolla_docker:
- example: False
+ image: ubuntu
+ name: test_container
+ action: start_container
+ - name: Remove container
+ kolla_docker:
+ name: test_container
+ action: remove_container
+ - name: Pull image without starting container
+ kolla_docker:
+ action: pull_container
+ image: private-registry.example.com:5000/ubuntu
+ - name: Create named volume
+ action: create_volume
+ name: name_of_volume
+ - name: Remove named volume
+ action: remove_volume
+ name: name_of_volume
'''
import os