Merge "Allow set tty for containers"

This commit is contained in:
Zuul 2018-12-07 09:30:57 +00:00 committed by Gerrit Code Review
commit f1be7033b0
6 changed files with 20 additions and 2 deletions

View File

@ -173,6 +173,12 @@ options:
- running
- exited
- paused
tty:
description:
- Allocate TTY to container
required: False
default: False
type: bool
author: Sam Yaple
'''
@ -639,6 +645,7 @@ class DockerWorker(object):
'image': self.params.get('image'),
'name': self.params.get('name'),
'volumes': volumes,
'tty': self.params.get('tty'),
}
def create_container(self):
@ -842,7 +849,8 @@ def generate_module():
tls_cacert=dict(required=False, type='str'),
volumes=dict(required=False, type='list'),
volumes_from=dict(required=False, type='list'),
dimensions=dict(required=False, type='dict', default=dict())
dimensions=dict(required=False, type='dict', default=dict()),
tty=dict(required=False, type='bool', default=False),
)
required_if = [
['action', 'pull_image', ['image']],

View File

@ -14,6 +14,7 @@ opendaylight_services:
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
dimensions: "{{ opendaylight_dimensions }}"
tty: True
haproxy:
opendaylight_api:
enabled: "{{ enable_opendaylight }}"

View File

@ -12,6 +12,7 @@
volumes: "{{ service.volumes }}"
privileged: "{{ service.privileged | default(False) }}"
dimensions: "{{ service.dimensions }}"
tty: "{{ service.tty }}"
when:
- kolla_action != "config"
- service.enabled | bool

View File

@ -217,6 +217,7 @@
privileged: "{{ item.value.privileged | default(False) }}"
volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}"
tty: "{{ item.value.tty }}"
register: check_opendaylight_containers
when:
- kolla_action != "config"

View File

@ -0,0 +1,5 @@
---
features:
- |
Added new parameter in kolla_docker to support configuring
TTY in containers, value is False by default

View File

@ -84,7 +84,8 @@ class ModuleArgsTest(base.BaseTestCase):
tls_cacert=dict(required=False, type='str'),
volumes=dict(required=False, type='list'),
volumes_from=dict(required=False, type='list'),
dimensions=dict(required=False, type='dict', default=dict())
dimensions=dict(required=False, type='dict', default=dict()),
tty=dict(required=False, type='bool', default=False),
)
required_if = [
['action', 'pull_image', ['image']],
@ -133,6 +134,7 @@ FAKE_DATA = {
'image': 'myregistrydomain.com:5000/ubuntu:16.04',
'name': 'test_container',
'volumes': None,
'tty': False,
},
'images': [