Allow set tty for containers
This change adds support to comfigure tty, it was enabled by default but a recent patch removed it. Some services such as Karaf in opendaylight requires a TTY during startup. Closes-Bug: #1806662 Change-Id: Ia4335523b727d0e45505cbb1efb40ccf04c27db7
This commit is contained in:
parent
ef3df55228
commit
846c15d8e1
@ -173,6 +173,12 @@ options:
|
|||||||
- running
|
- running
|
||||||
- exited
|
- exited
|
||||||
- paused
|
- paused
|
||||||
|
tty:
|
||||||
|
description:
|
||||||
|
- Allocate TTY to container
|
||||||
|
required: False
|
||||||
|
default: False
|
||||||
|
type: bool
|
||||||
author: Sam Yaple
|
author: Sam Yaple
|
||||||
'''
|
'''
|
||||||
|
|
||||||
@ -639,6 +645,7 @@ class DockerWorker(object):
|
|||||||
'image': self.params.get('image'),
|
'image': self.params.get('image'),
|
||||||
'name': self.params.get('name'),
|
'name': self.params.get('name'),
|
||||||
'volumes': volumes,
|
'volumes': volumes,
|
||||||
|
'tty': self.params.get('tty'),
|
||||||
}
|
}
|
||||||
|
|
||||||
def create_container(self):
|
def create_container(self):
|
||||||
@ -842,7 +849,8 @@ def generate_module():
|
|||||||
tls_cacert=dict(required=False, type='str'),
|
tls_cacert=dict(required=False, type='str'),
|
||||||
volumes=dict(required=False, type='list'),
|
volumes=dict(required=False, type='list'),
|
||||||
volumes_from=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 = [
|
required_if = [
|
||||||
['action', 'pull_image', ['image']],
|
['action', 'pull_image', ['image']],
|
||||||
|
@ -14,6 +14,7 @@ opendaylight_services:
|
|||||||
- "/etc/localtime:/etc/localtime:ro"
|
- "/etc/localtime:/etc/localtime:ro"
|
||||||
- "kolla_logs:/var/log/kolla/"
|
- "kolla_logs:/var/log/kolla/"
|
||||||
dimensions: "{{ opendaylight_dimensions }}"
|
dimensions: "{{ opendaylight_dimensions }}"
|
||||||
|
tty: True
|
||||||
haproxy:
|
haproxy:
|
||||||
opendaylight_api:
|
opendaylight_api:
|
||||||
enabled: "{{ enable_opendaylight }}"
|
enabled: "{{ enable_opendaylight }}"
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
volumes: "{{ service.volumes }}"
|
volumes: "{{ service.volumes }}"
|
||||||
privileged: "{{ service.privileged | default(False) }}"
|
privileged: "{{ service.privileged | default(False) }}"
|
||||||
dimensions: "{{ service.dimensions }}"
|
dimensions: "{{ service.dimensions }}"
|
||||||
|
tty: "{{ service.tty }}"
|
||||||
when:
|
when:
|
||||||
- kolla_action != "config"
|
- kolla_action != "config"
|
||||||
- service.enabled | bool
|
- service.enabled | bool
|
||||||
|
@ -217,6 +217,7 @@
|
|||||||
privileged: "{{ item.value.privileged | default(False) }}"
|
privileged: "{{ item.value.privileged | default(False) }}"
|
||||||
volumes: "{{ item.value.volumes }}"
|
volumes: "{{ item.value.volumes }}"
|
||||||
dimensions: "{{ item.value.dimensions }}"
|
dimensions: "{{ item.value.dimensions }}"
|
||||||
|
tty: "{{ item.value.tty }}"
|
||||||
register: check_opendaylight_containers
|
register: check_opendaylight_containers
|
||||||
when:
|
when:
|
||||||
- kolla_action != "config"
|
- kolla_action != "config"
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
Added new parameter in kolla_docker to support configuring
|
||||||
|
TTY in containers, value is False by default
|
@ -84,7 +84,8 @@ class ModuleArgsTest(base.BaseTestCase):
|
|||||||
tls_cacert=dict(required=False, type='str'),
|
tls_cacert=dict(required=False, type='str'),
|
||||||
volumes=dict(required=False, type='list'),
|
volumes=dict(required=False, type='list'),
|
||||||
volumes_from=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 = [
|
required_if = [
|
||||||
['action', 'pull_image', ['image']],
|
['action', 'pull_image', ['image']],
|
||||||
@ -133,6 +134,7 @@ FAKE_DATA = {
|
|||||||
'image': 'myregistrydomain.com:5000/ubuntu:16.04',
|
'image': 'myregistrydomain.com:5000/ubuntu:16.04',
|
||||||
'name': 'test_container',
|
'name': 'test_container',
|
||||||
'volumes': None,
|
'volumes': None,
|
||||||
|
'tty': False,
|
||||||
},
|
},
|
||||||
|
|
||||||
'images': [
|
'images': [
|
||||||
|
Loading…
Reference in New Issue
Block a user