1
0
Fork 0
mirror of https://github.com/containers/ansible-podman-collections.git synced 2026-02-04 07:11:49 +00:00

Fix idempotency for systemd keyword

Fix #936
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
This commit is contained in:
Sagi Shnaidman 2025-05-29 13:48:39 +03:00
parent ac5da409fe
commit dd013b8432
2 changed files with 38 additions and 0 deletions

View file

@ -1419,6 +1419,8 @@ class PodmanContainerDiff:
return self._diff_generic('sysctl', '--sysctl')
def diffparam_systemd(self):
if self.params['systemd'] is not None:
self.params['systemd'] = str(self.params['systemd']).lower()
return self._diff_generic('systemd', '--systemd')
def diffparam_timeout(self):

View file

@ -549,6 +549,42 @@
that:
- test37 is changed
- name: Run container with systemd
containers.podman.podman_container:
executable: "{{ test_executable | default('podman') }}"
image: "{{ idem_image }}"
name: idempotency
state: present
systemd: false
- name: Run container with same systemd
containers.podman.podman_container:
executable: "{{ test_executable | default('podman') }}"
image: "{{ idem_image }}"
name: idempotency
state: present
systemd: false
register: test38
- name: Check container with same systemd
assert:
that:
- test38 is not changed
- name: Run container with different systemd
containers.podman.podman_container:
executable: "{{ test_executable | default('podman') }}"
image: "{{ idem_image }}"
name: idempotency
state: present
systemd: always
register: test39
- name: Check container with different systemd
assert:
that:
- test39 is changed
- name: Remove dependent test container
containers.podman.podman_container:
executable: "{{ test_executable | default('podman') }}"