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

165 commits

Author SHA1 Message Date
Sergey
6ee2f3891b
Add inventory plugins for buildah and podman (#963)
Add inventory plugins for buildah and podman, unit tests and functional CI tests.
---------

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-08-13 16:48:50 +03:00
Sergey
8f0bc79e6f
Fix podman_image correct delimiter logic for version@digest tags (#960)
Fix incorrect image URL formation when using separate name and tag parameters
where the tag contains a digest. Previously, tags like "8-bookworm@sha256:..."
would incorrectly use "@" as the delimiter between name and tag, resulting in
malformed URLs like "docker.io/valkey/valkey@8-bookworm@sha256:...".
The issue was in ImageRepository.delimiter logic which used substring matching
("sha256" in tag) instead of checking for pure digest format.
Changes:
  - Fix delimiter selection in ImageRepository.__init__() to only use "@" for
    pure digests starting with "sha256:", not any tag containing "sha256"
  - Add comprehensive unit tests covering all delimiter scenarios
  - Add integration tests with real digest validation and edge cases
  - Ensure proper URL formation: name:tag@digest vs name@digest

Before: docker.io/valkey/valkey@8-bookworm@sha256:abc123 (broken)
After:  docker.io/valkey/valkey:8-bookworm@sha256:abc123 (correct)

Fixes #947
Generated with [Claude Code](https://claude.ai/code)

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-08-05 23:05:17 +03:00
Sergey
e37123e06f
Rewrite podman_image and add tests (#957)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-08-04 16:28:35 +03:00
Sergey
f2e813671a
Run black -l 120 on all files, again (#943)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-06-26 13:24:44 +03:00
lucas-benedito
6ff93e7559
podman_container_lib: Added checks for volume opts (#941)
* podman_container_lib: Added checks for volume opts

Changed the diffparam_volume function to include the volume mount opts.

Signed-off-by: Lucas Benedito <lbenedit@redhat.com>

* Add test for volume mount options

Signed-off-by: Lucas Benedito <lbenedit@redhat.com>

---------

Signed-off-by: Lucas Benedito <lbenedit@redhat.com>
2025-06-22 12:17:32 +03:00
Sergey
4c682e170c
Run black -l 120 on all Python files to unify the style (#939)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-06-15 18:25:48 +03:00
Sergey
11cc00e6ca
Fix idempotency for systemd keyword (#937)
Fix #936

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-05-29 14:16:09 +03:00
Sergey
8a57012970
Fix None values in LogOpt in Quadlet (#933)
Fix #914

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-05-12 12:50:49 +03:00
Sergey
2c040aa346
Set custom tmpfs idempotency (#932)
Fix #918

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-05-12 12:20:02 +03:00
Sergey
5ea945dffe
Handle image arguments in podman_container (#931)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-05-11 18:38:49 +03:00
Evgeni Golov
6946a0bcbd
correctly quote labels and environment variables for quadlets (#920)
Fixes: #807

Signed-off-by: Evgeni Golov <evgeni@golov.de>
2025-04-14 14:47:20 +03:00
Sergey
47767dab21
Remove docker protocol when inspecting image (#901)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-02-17 15:17:47 +02:00
Popkornium18
a45d94d503
Fix idempotency for containers with env vars containing MAX_SIZE (#893)
Signed-off-by: Popkornium18 <mail@popkornium18.de>
2025-01-19 20:34:26 +02:00
Sergey
64e4247347
Don't pull image when state is absent or pull=never (#889)
fix #888
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-01-08 15:38:03 +02:00
Sergey
7fa610a416
Convert DNS domain search to a list (#881)
Fix #880

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-12-13 20:34:17 +02:00
Sergey
4d3009fda9
Don't check image availability in Quadlet (#872)
Fix #871
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-10-27 20:35:45 +02:00
QCU
309893047d
fix: quadlet cmd_args append mistake (#869)
Signed-off-by: QCU <qcu266@gmail.com>
2024-10-22 15:51:13 +03:00
Guillaume HOUDMON
2deadf069a
Add quadlet file mode option to specify file permission (#867)
* Add quadlet file mode option

Signed-off-by: ghoudmon <guillaume@houdmon.com>

* Fix file mode only change test

Signed-off-by: ghoudmon <guillaume@houdmon.com>

---------

Signed-off-by: ghoudmon <guillaume@houdmon.com>
2024-10-22 15:20:26 +03:00
InsideTheVoid
1bdf437d09
Fix typo in quadlet generator (#868)
This typo prevents the quadlet generator from picking up
--cpus and --platform options.

Signed-off-by: InsideTheVoid <824767+InsideTheVoid@users.noreply.github.com>
2024-10-15 13:33:03 +03:00
Sergey
d4977eae0a
Fix max_size idempotency issue (#862)
Fix #843
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-10-11 22:28:19 +03:00
Thomas Preindl
8daec72a04
Add missing parameters for podman container quadlet (#847)
* Revert "Add group_add parameter for podman quadlet (#827)"

This reverts commit 4f24eced99.

Signed-off-by: Thomas Preindl <tompre@users.noreply.github.com>

* Add 'group_add' to 'GroupAdd' parameter mapping for podman container quadlet

Signed-off-by: Thomas Preindl <tompre@users.noreply.github.com>

* Add 'cgroups' to 'CgroupsMode' parameter mapping for podman container quadlet

Signed-off-by: Thomas Preindl <tompre@users.noreply.github.com>

* Fix 'etc_hosts' to 'AddHost' parameter mapping for podman container quadlet

Signed-off-by: Thomas Preindl <tompre@users.noreply.github.com>

* Fix 'network_aliases' to 'NetworkAlias' parameter mapping for podman container quadlet

Signed-off-by: Thomas Preindl <tompre@users.noreply.github.com>

* Fix 'stop_signal' to 'StopSignal' parameter mapping for podman container quadlet

Signed-off-by: Thomas Preindl <tompre@users.noreply.github.com>

* Add 'cpus' parameter mapping for podman container quadlet

Signed-off-by: Thomas Preindl <tompre@users.noreply.github.com>

* Add 'platform' parameter mapping for podman container quadlet

Signed-off-by: Thomas Preindl <tompre@users.noreply.github.com>

* Add 'log_opt' to 'LogOpt' parameter mapping for podman container quadlet

Signed-off-by: Thomas Preindl <tompre@users.noreply.github.com>

---------

Signed-off-by: Thomas Preindl <tompre@users.noreply.github.com>
2024-10-06 23:29:58 +03:00
Sergey
46d4378426
Fix command idempotency with quotes (#839)
Fix #838
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-09-05 19:31:28 +03:00
Sergey
83d0eefcb5
Disable idempotency for pod_id_file (#829)
Fix #828
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-09-02 19:54:39 +03:00
Thomas Preindl
4f24eced99
Add group_add parameter for podman quadlet (#827)
* Add group_add parameter for podman quadlet

* Update plugins/module_utils/podman/quadlet.py

Co-authored-by: Sergey <6213510+sshnaidm@users.noreply.github.com>

---------

Co-authored-by: Sergey <6213510+sshnaidm@users.noreply.github.com>
2024-09-02 19:54:22 +03:00
Nikita Tokarchuk
25a64101f2
Fix quadlet parameters when container uses rootfs (#835)
Adjust quadlet parameters to set rootfs as image and clear image field when rootfs container is being used.

Signed-off-by: Nikita Tokarchuk <nikita@tokarch.uk>
2024-09-02 19:25:20 +03:00
Sergey
6c2dda7820
Add support for check_mode in Quadlet (#818)
Fix #808
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-08-16 15:10:55 +03:00
Alessandro Rossi
92fe1464a0
fix for tls_verify being ignored (#815)
Signed-off-by: kubealex <al.rossi87@gmail.com>
2024-08-15 16:26:09 +03:00
Holger Hees
93c1532b04
Fix health-startup-cmd (#809)
"--health-startup-command" is a wrong parameter.

the correct syntax is

"--health-startup-cmd"
2024-08-15 13:56:21 +03:00
Sergey
4e65a7bc94
Fix quadlet parameters for restart policy (#798)
Fix #797
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-07-11 11:13:56 +03:00
Sergey
d25cf57967
Idempotency improvements (#795)
* Fix integers in Quadlet generation
* Work around quotes in command for idempotency

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-07-07 22:55:26 +03:00
Giovanni Baratta
9775178872
Fix missing entries in network quadlet generated file (#792) (#793)
Signed-off-by: Giovanni Baratta <bargiovi@hotmail.it>
2024-06-25 17:51:52 +03:00
Sergey
24c842fdd6
Fix idempotency for empty values (#790)
Fix #788
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-06-20 09:53:16 +03:00
Richard Megginson
c3c5877279
params gpus should be exit_policy (#784)
The code should be setting `--exit-policy` to the value of `params['exit_policy']`
instead of `params['gpus']`

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2024-06-13 14:35:10 +03:00
Sergey
9c40a88a71
Fix idempotency for pods in case of systemd generation (#777)
Fix #774

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-06-07 00:15:57 +03:00
Sergey
8a8f9023e6
Fix idempotency for systemd generations (#776)
Fix #775

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-06-07 00:08:02 +03:00
Sergey
47fc4cc119
Redesign idempotency for Podman Pod module (#759)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-05-27 17:49:32 +03:00
Sergey
e29e2cfb19
Improve idempotency for networking in podman_container (#756)
Related: #555

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-05-23 13:33:01 +03:00
Sergey
e1e4e7516a
Add idempotency for mounts and volumes (#753)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-05-22 22:08:57 +03:00
Sergey
2f5da14c30
Add new options for podman_container (#750)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-05-22 14:30:28 +03:00
Marko Weltzer
9f34e8f78a
fix(#747): set correct HealthCmd (#748)
Signed-off-by: Marko Weltzer <marwel_github@bugga.de>
2024-05-19 22:27:52 +03:00
Sergey
b987120fa0
Add new options to pod module (#745)
Fix #742

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-05-16 14:50:47 +03:00
Sergey
4c987a1c22
Fix idempotency for pod with 0.0.0.0 (#744)
Fix #743
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-05-13 17:21:03 +03:00
Sergey
1476ebe685
Add quadlet support for Podman modules (#722)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-04-22 01:13:04 +03:00
Sagi Shnaidman
cb74414e50 Fix pod for Podman v5
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-04-08 01:11:46 +03:00
Sagi Shnaidman
453be5c5fd Add check and fixed for v5 network diff
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-04-08 01:11:46 +03:00
Sagi Shnaidman
ace1f5896a Add pasta as default network mode after v5
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-04-08 01:11:46 +03:00
Sergey
7dce3c9c8e
Fix pasta networking idempotency for v5 (#728)
Fix #721

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-04-05 13:49:50 +03:00
Sagi Shnaidman
42f10519ec Fix podman pod v5 broken info issue
Fix breakig change introduced in Podman v5:
 https://github.com/containers/podman/pull/21514
Related-to: #712

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-02-18 00:01:09 +02:00
Adam Williamson
7d7445d29b
podman pod info: handle return being list in Podman 5 (#713)
Fixes #712

Podman 5 changed the output of `podman pod info` (when run on a
single pod) from being a dict to being a list of dicts:

https://github.com/containers/podman/pull/21514

this should handle both ways. Unfortunately not sure how to add
a test for this as I can't see a unit test that mocks the output
of the command, only the integration test that gets real live
output, and I'm not sure how to get that test run with Podman 5.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2024-02-17 21:47:19 +02:00
ant-bl
2e661d1700
Update env_file to accept a list of files instead of a single file (#702)
* Update env_file to accept a list of files instead of a single file

Signed-off-by: antoine <antoine.blin@gandi.net>

* Update doc: add alias env_files

Signed-off-by: antoine <antoine.blin@gandi.net>

* Update plugins/module_utils/podman/podman_container_lib.py

Use real arg name and not alias

Co-authored-by: Sergey <6213510+sshnaidm@users.noreply.github.com>

---------

Signed-off-by: antoine <antoine.blin@gandi.net>
Co-authored-by: Sergey <6213510+sshnaidm@users.noreply.github.com>
2024-01-25 14:04:40 +02:00