Inject log-driver for podman containers
Currently, docker daemon runtime has a default --log-driver set to journald. Podman lack of daemon prevent such a global application, meaning we have to set that driver for each and every container when we either create or run them. Notes: - podman only supports "json-file", and it's not even a json. - docker json-file doesn't support "path" option, making this output unusable in the end: logs end in /var/lib/docker/containers/ID/ID-json.log Related-Bug: #1814897 Change-Id: Ia613fc3812aa34376c3fe64c21abfed51cfc9cab
This commit is contained in:
parent
94203f0447
commit
edfe180634
@ -29,6 +29,13 @@
|
||||
selevel: s0
|
||||
tags:
|
||||
- host_config
|
||||
- name: Create /var/log/containers/stdouts directory
|
||||
file:
|
||||
path: /var/log/containers/stdouts
|
||||
state: directory
|
||||
selevel: s0
|
||||
tags:
|
||||
- host_config
|
||||
- name: Create /var/lib/tripleo-config directory
|
||||
file:
|
||||
path: /var/lib/tripleo-config
|
||||
|
@ -409,6 +409,7 @@ def mp_puppet_config(*args):
|
||||
'--env', 'NO_ARCHIVE=%s' % os.environ.get('NO_ARCHIVE', ''),
|
||||
'--env', 'STEP=%s' % os.environ.get('STEP', '6'),
|
||||
'--env', 'NET_HOST=%s' % os.environ.get('NET_HOST', 'false'),
|
||||
'--log-driver', 'json-file',
|
||||
'--volume', '/etc/localtime:/etc/localtime:ro',
|
||||
'--volume', '%s:/etc/config.pp:ro' % tmp_man.name,
|
||||
'--volume', '/etc/puppet/:/tmp/puppet-etc/:ro',
|
||||
@ -423,6 +424,11 @@ def mp_puppet_config(*args):
|
||||
if privileged:
|
||||
common_dcmd.push('--privileged')
|
||||
|
||||
if container_cli == 'podman':
|
||||
logging = ['--log-opt',
|
||||
'path=/var/log/containers/stdouts/%s.log' % uname]
|
||||
common_dcmd.extend(logging)
|
||||
|
||||
|
||||
dcmd = common_dcmd + cli_dcmd
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user