|
|
@ -27,7 +27,7 @@ DOCUMENTATION = '''
|
|
|
|
module: docker
|
|
|
|
module: docker
|
|
|
|
short_description: manage docker containers
|
|
|
|
short_description: manage docker containers
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- Manage the life cycle of docker containers.
|
|
|
|
- Manage the life cycle of docker containers. This module has a dependency on the docker-py python module.
|
|
|
|
options:
|
|
|
|
options:
|
|
|
|
count:
|
|
|
|
count:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
@ -133,7 +133,6 @@ options:
|
|
|
|
required: false
|
|
|
|
required: false
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
aliases: []
|
|
|
|
aliases: []
|
|
|
|
requirements: [ "docker-py" ]
|
|
|
|
|
|
|
|
author: Cove Schneider
|
|
|
|
author: Cove Schneider
|
|
|
|
'''
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
|
@ -183,7 +182,6 @@ Stop and remove all of the running tomcat containers:
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
import sys
|
|
|
|
import sys
|
|
|
|
import json
|
|
|
|
|
|
|
|
import docker.client
|
|
|
|
import docker.client
|
|
|
|
from requests.exceptions import *
|
|
|
|
from requests.exceptions import *
|
|
|
|
from urlparse import urlparse
|
|
|
|
from urlparse import urlparse
|
|
|
@ -282,7 +280,7 @@ class AnsibleDocker:
|
|
|
|
|
|
|
|
|
|
|
|
def do_create(count, params):
|
|
|
|
def do_create(count, params):
|
|
|
|
results = []
|
|
|
|
results = []
|
|
|
|
for i in range(count):
|
|
|
|
for _ in range(count):
|
|
|
|
result = self.client.create_container(**params)
|
|
|
|
result = self.client.create_container(**params)
|
|
|
|
self.increment_counter('created')
|
|
|
|
self.increment_counter('created')
|
|
|
|
results.append(result)
|
|
|
|
results.append(result)
|
|
|
|