From 90f2d667da8b8c8b183fc120e19db0875a463449 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Jeanneret?= Date: Mon, 27 Jun 2022 14:47:51 +0200 Subject: [PATCH] podman-4.1.1 renames Healthcheck to Health MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Cédric Jeanneret --- .../module_utils/podman/podman_container_lib.py | 16 ++++++++++------ plugins/modules/podman_container.py | 10 ++++++++++ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/plugins/module_utils/podman/podman_container_lib.py b/plugins/module_utils/podman/podman_container_lib.py index 3605cac2..0825093a 100644 --- a/plugins/module_utils/podman/podman_container_lib.py +++ b/plugins/module_utils/podman/podman_container_lib.py @@ -59,11 +59,11 @@ generate_systemd=dict(type='dict', default={}), gidmap=dict(type='list', elements='str'), group_add=dict(type='list', elements='str', aliases=['groups']), - healthcheck=dict(type='str'), - healthcheck_interval=dict(type='str'), - healthcheck_retries=dict(type='int'), - healthcheck_start_period=dict(type='str'), - healthcheck_timeout=dict(type='str'), + healthcheck=dict(type='str', aliases=['health_cmd']), + healthcheck_interval=dict(type='str', aliases=['health_interval']), + healthcheck_retries=dict(type='int', aliases=['health_retries']), + healthcheck_start_period=dict(type='str', aliases=['health_start_period']), + healthcheck_timeout=dict(type='str', aliases=['health_timeout']), hostname=dict(type='str'), http_proxy=dict(type='bool'), image_volume=dict(type='str', choices=['bind', 'tmpfs', 'ignore']), @@ -907,9 +907,13 @@ def diffparam_healthcheck(self): # the "test" key is a list of 2 items where the first one is # "CMD-SHELL" and the second one is the actual healthcheck command. before = self.info['config']['healthcheck']['test'][1] + elif 'health' in self.info['config']: + before = self.info['config']['health']['test'][1] else: before = '' - after = self.params['healthcheck'] or before + after = self.params.get('health', + self.params.get('healthcheck', + None)) or before return self._diff_update_and_compare('healthcheck', before, after) # Because of hostname is random generated, this parameter has partial idempotency only. diff --git a/plugins/modules/podman_container.py b/plugins/modules/podman_container.py index 2d76ae13..556ccf14 100644 --- a/plugins/modules/podman_container.py +++ b/plugins/modules/podman_container.py @@ -374,29 +374,39 @@ description: - Set or alter a healthcheck command for a container. type: str + aliases: + - health_cmd healthcheck_interval: description: - Set an interval for the healthchecks (a value of disable results in no automatic timer setup) (default "30s") type: str + aliases: + - health_interval healthcheck_retries: description: - The number of retries allowed before a healthcheck is considered to be unhealthy. The default value is 3. type: int + aliases: + - health_retries healthcheck_start_period: description: - The initialization time needed for a container to bootstrap. The value can be expressed in time format like 2m3s. The default value is 0s type: str + aliases: + - health_start_period healthcheck_timeout: description: - The maximum time allowed to complete the healthcheck before an interval is considered failed. Like start-period, the value can be expressed in a time format such as 1m22s. The default value is 30s type: str + aliases: + - health_timeout hostname: description: - Container host name. Sets the container host name that is available