diff --git a/plugins/module_utils/podman/common.py b/plugins/module_utils/podman/common.py index 0e9ed5b..93d0d19 100644 --- a/plugins/module_utils/podman/common.py +++ b/plugins/module_utils/podman/common.py @@ -46,6 +46,8 @@ def generate_systemd(module, module_params, name): command.extend(['--no-header']) if sysconf.get('names', True): command.extend(['--name']) + if sysconf.get("new"): + command.extend(["--new"]) if sysconf.get('container_prefix') is not None: command.extend(['--container-prefix=%s' % sysconf['container_prefix']]) if sysconf.get('pod_prefix') is not None: diff --git a/plugins/modules/podman_container.py b/plugins/modules/podman_container.py index f6748c3..7071f4b 100644 --- a/plugins/modules/podman_container.py +++ b/plugins/modules/podman_container.py @@ -351,6 +351,13 @@ options: container/pod and the prefix. The default is "-" (dash). type: str required: false + new: + description: + - Create containers and pods when the unit is started instead of + expecting them to exist. The default is "false". + Refer to podman-generate-systemd(1) for more information. + type: bool + default: false gidmap: description: - Run the container in a new user namespace using the supplied mapping.