Fix kolla_docker module
Change-Id: I7df734cf15eba1af4da92f9c4ef12cc761442ca1
This commit is contained in:
parent
e9dd15967b
commit
5e54663e20
@ -89,6 +89,12 @@ options:
|
||||
- The command to execute in the container
|
||||
required: False
|
||||
type: str
|
||||
container_engine:
|
||||
description:
|
||||
- Name of container engine to use
|
||||
required: False
|
||||
type: str
|
||||
default: docker
|
||||
detach:
|
||||
description:
|
||||
- Detach from the container after it is created
|
||||
@ -284,6 +290,7 @@ def generate_module():
|
||||
auth_registry=dict(required=False, type='str'),
|
||||
auth_username=dict(required=False, type='str'),
|
||||
command=dict(required=False, type='str'),
|
||||
container_engine=dict(required=False, type='str'),
|
||||
detach=dict(required=False, type='bool', default=True),
|
||||
labels=dict(required=False, type='dict', default=dict()),
|
||||
name=dict(required=False, type='str'),
|
||||
@ -360,6 +367,7 @@ def generate_module():
|
||||
'api_version': 'auto',
|
||||
'graceful_timeout': 10,
|
||||
'client_timeout': 120,
|
||||
'container_engine': 'docker',
|
||||
}
|
||||
|
||||
new_args = module.params.pop('common_options', dict()) or dict()
|
||||
|
@ -2,6 +2,7 @@
|
||||
- name: Ensuring the containers up
|
||||
become: true
|
||||
kolla_docker:
|
||||
common_options: "{{ docker_common_options }}"
|
||||
name: "{{ item.name }}"
|
||||
action: "get_container_state"
|
||||
register: container_state
|
||||
@ -28,6 +29,7 @@
|
||||
- name: Containers config strategy
|
||||
become: true
|
||||
kolla_docker:
|
||||
common_options: "{{ docker_common_options }}"
|
||||
name: "{{ item.name }}"
|
||||
action: "get_container_env"
|
||||
register: container_envs
|
||||
@ -38,6 +40,7 @@
|
||||
- name: Remove the containers
|
||||
become: true
|
||||
kolla_docker:
|
||||
common_options: "{{ docker_common_options }}"
|
||||
name: "{{ item[0]['name'] }}"
|
||||
action: "remove_container"
|
||||
register: remove_containers
|
||||
@ -56,6 +59,7 @@
|
||||
- name: Restart containers
|
||||
become: true
|
||||
kolla_docker:
|
||||
common_options: "{{ docker_common_options }}"
|
||||
name: "{{ item[0]['name'] }}"
|
||||
action: "restart_container"
|
||||
when:
|
||||
|
@ -37,6 +37,7 @@
|
||||
- name: Stop and remove nova_libvirt container
|
||||
become: true
|
||||
kolla_docker:
|
||||
common_options: "{{ docker_common_options }}"
|
||||
action: "stop_and_remove_container"
|
||||
name: nova_libvirt
|
||||
when: container_facts['nova_libvirt'] is defined
|
||||
@ -44,6 +45,7 @@
|
||||
- name: Remove nova_libvirt Docker volumes
|
||||
become: true
|
||||
kolla_docker:
|
||||
common_options: "{{ docker_common_options }}"
|
||||
action: "remove_volume"
|
||||
name: "{{ item }}"
|
||||
loop:
|
||||
|
@ -7,6 +7,7 @@
|
||||
- name: "Cleaning out old Swift containers"
|
||||
become: true
|
||||
kolla_docker:
|
||||
common_options: "{{ docker_common_options }}"
|
||||
name: "{{ item }}"
|
||||
action: "stop_container"
|
||||
with_items:
|
||||
|
@ -32,6 +32,7 @@
|
||||
- name: Ensuring the containers up
|
||||
become: true
|
||||
kolla_docker:
|
||||
common_options: "{{ docker_common_options }}"
|
||||
name: "{{ item.name }}"
|
||||
action: "get_container_state"
|
||||
register: container_state
|
||||
@ -58,6 +59,7 @@
|
||||
- name: Containers config strategy
|
||||
become: true
|
||||
kolla_docker:
|
||||
common_options: "{{ docker_common_options }}"
|
||||
name: "{{ item.name }}"
|
||||
action: "get_container_env"
|
||||
register: container_envs
|
||||
@ -68,6 +70,7 @@
|
||||
- name: Remove the containers
|
||||
become: true
|
||||
kolla_docker:
|
||||
common_options: "{{ docker_common_options }}"
|
||||
name: "{{ item[0]['name'] }}"
|
||||
action: "remove_container"
|
||||
register: remove_containers
|
||||
@ -88,6 +91,7 @@
|
||||
- name: Restart containers
|
||||
become: true
|
||||
kolla_docker:
|
||||
common_options: "{{ docker_common_options }}"
|
||||
name: "{{ item[0]['name'] }}"
|
||||
action: "restart_container"
|
||||
when:
|
||||
|
@ -31,6 +31,7 @@
|
||||
- name: Gracefully shutdown swift services in storage nodes
|
||||
become: true
|
||||
kolla_docker:
|
||||
common_options: "{{ docker_common_options }}"
|
||||
action: "stop_container"
|
||||
name: "{{ item.name }}"
|
||||
when: inventory_hostname in groups[item.group]
|
||||
@ -48,6 +49,7 @@
|
||||
- name: Gracefully shutdown swift proxy services in proxy nodes
|
||||
become: true
|
||||
kolla_docker:
|
||||
common_options: "{{ docker_common_options }}"
|
||||
action: "stop_container"
|
||||
name: "swift_proxy_server"
|
||||
when: inventory_hostname in groups['swift-proxy-server']
|
||||
|
@ -2,6 +2,7 @@
|
||||
- name: Check tacker container
|
||||
become: true
|
||||
kolla_docker:
|
||||
common_options: "{{ docker_common_options }}"
|
||||
action: "compare_container"
|
||||
name: "{{ item.value.container_name }}"
|
||||
image: "{{ item.value.image }}"
|
||||
|
@ -14,6 +14,7 @@
|
||||
service: "{{ tacker_services[service_name] }}"
|
||||
become: true
|
||||
kolla_docker:
|
||||
common_options: "{{ docker_common_options }}"
|
||||
action: "stop_and_remove_container"
|
||||
name: "{{ service.container_name }}"
|
||||
when:
|
||||
@ -25,6 +26,7 @@
|
||||
service: "{{ tacker_services[service_name] }}"
|
||||
become: true
|
||||
kolla_docker:
|
||||
common_options: "{{ docker_common_options }}"
|
||||
action: "stop_and_remove_container"
|
||||
name: "{{ service.container_name }}"
|
||||
when:
|
||||
|
@ -153,6 +153,7 @@ def get_DockerWorker(mod_param, docker_api_version='1.40'):
|
||||
'api_version': 'auto',
|
||||
'graceful_timeout': 10,
|
||||
'client_timeout': 120,
|
||||
'container_engine': 'docker',
|
||||
}
|
||||
|
||||
new_args = module.params.pop('common_options', dict()) or dict()
|
||||
|
@ -60,6 +60,7 @@ class ModuleArgsTest(base.BaseTestCase):
|
||||
auth_registry=dict(required=False, type='str'),
|
||||
auth_username=dict(required=False, type='str'),
|
||||
command=dict(required=False, type='str'),
|
||||
container_engine=dict(required=False, type='str'),
|
||||
detach=dict(required=False, type='bool', default=True),
|
||||
labels=dict(required=False, type='dict', default=dict()),
|
||||
name=dict(required=False, type='str'),
|
||||
|
Loading…
x
Reference in New Issue
Block a user