mirror of
https://github.com/containers/ansible-podman-collections.git
synced 2026-02-04 07:11:49 +00:00
Add support for timezones in containers (#262)
* Remove choices for cgroups * Add timezone parameter to container module
This commit is contained in:
parent
a7629a89db
commit
bcdaa9f825
2 changed files with 18 additions and 4 deletions
|
|
@ -22,7 +22,7 @@ ARGUMENTS_SPEC_CONTAINER = dict(
|
|||
cap_drop=dict(type='list', elements='str'),
|
||||
cgroup_parent=dict(type='path'),
|
||||
cgroupns=dict(type='str'),
|
||||
cgroups=dict(type='str', choices=['default', 'disabled']),
|
||||
cgroups=dict(type='str'),
|
||||
cidfile=dict(type='path'),
|
||||
cmd_args=dict(type='list', elements='str'),
|
||||
conmon_pidfile=dict(type='path'),
|
||||
|
|
@ -115,6 +115,7 @@ ARGUMENTS_SPEC_CONTAINER = dict(
|
|||
subuidname=dict(type='str'),
|
||||
sysctl=dict(type='dict'),
|
||||
systemd=dict(type='str'),
|
||||
timezone=dict(type='str'),
|
||||
tmpfs=dict(type='dict'),
|
||||
tty=dict(type='bool'),
|
||||
uidmap=dict(type='list', elements='str'),
|
||||
|
|
@ -555,6 +556,9 @@ class PodmanModuleParams:
|
|||
c += ['--tmpfs', ':'.join(tmpfs)]
|
||||
return c
|
||||
|
||||
def addparam_timezone(self, c):
|
||||
return c + ['--tz=%s' % self.params['timezone']]
|
||||
|
||||
def addparam_tty(self, c):
|
||||
return c + ['--tty=%s' % self.params['tty']]
|
||||
|
||||
|
|
@ -1171,6 +1175,11 @@ class PodmanContainerDiff:
|
|||
after = signals[after.lower()]
|
||||
return self._diff_update_and_compare('stop_signal', before, after)
|
||||
|
||||
def diffparam_timezone(self):
|
||||
before = self.info['config'].get('timezone')
|
||||
after = self.params['timezone']
|
||||
return self._diff_update_and_compare('timezone', before, after)
|
||||
|
||||
def diffparam_tty(self):
|
||||
before = self.info['config']['tty']
|
||||
after = self.params['tty']
|
||||
|
|
|
|||
|
|
@ -125,9 +125,6 @@ options:
|
|||
The disabled option will force the container to not create CGroups,
|
||||
and thus conflicts with CGroup options cgroupns and cgroup-parent.
|
||||
type: str
|
||||
choices:
|
||||
- default
|
||||
- disabled
|
||||
cidfile:
|
||||
description:
|
||||
- Write the container ID to the file
|
||||
|
|
@ -643,6 +640,14 @@ options:
|
|||
description:
|
||||
- Run container in systemd mode. The default is true.
|
||||
type: str
|
||||
timezone:
|
||||
description:
|
||||
- Set timezone in container. This flag takes area-based timezones,
|
||||
GMT time, as well as local, which sets the timezone in the container to
|
||||
match the host machine.
|
||||
See /usr/share/zoneinfo/ for valid timezones.
|
||||
Remote connections use local containers.conf for defaults.
|
||||
type: str
|
||||
tmpfs:
|
||||
description:
|
||||
- Create a tmpfs mount. For example tmpfs
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue