Compare commits

...

500 Commits
1.1.0 ... main

Author SHA1 Message Date
Sergey 15423c0a5a
Fix Ansible sanity issues for new version (#974)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-08-29 11:58:20 +03:00
Sergey 73b7bb1d3e
Update docs and script (#973)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-08-25 11:45:29 +03:00
Sergey 5265f8c91c
Test new documentation (#972)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-08-25 10:25:00 +03:00
Sergey f333fe7fca
Add podman system connection modules (#971)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-08-25 09:35:27 +03:00
Sergey ee52d9de78
Add podman image scp option (#970)
* Add podman image scp option

Fix #536


---------

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-08-19 23:30:35 +03:00
dependabot[bot] c2530a63f3
Bump actions/checkout from 4 to 5 (#967)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-19 21:06:56 +03:00
Sergey 9cffa671c8
Fix podman logout for newer Podman (#969)
Fix #935

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-08-18 23:15:41 +03:00
Sergey f4b57ac265
Remove quiet mode from pulling image (#968)
Fix #966

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-08-18 22:51:19 +03:00
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
dependabot[bot] fb76891c50
Bump actions/checkout from 4 to 5 (#964)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-12 12:23:23 +03:00
dependabot[bot] 6e8c88068f
Bump actions/download-artifact from 4 to 5 (#965)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-12 11:46:49 +03:00
Sergey 4d1917ac57
Add unittests for podman_image (#961)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-08-06 00:05:07 +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 859215bdfb
Fix README (#959)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-08-04 12:10:02 +03:00
Sergey 5bb0395e9e
Improve docs and guides (#958)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-08-03 14:22:57 +03:00
Sergey 91d991f95b
Add building Podman from source (#955)
* Add building Podman from source

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-08-03 13:30:27 +03:00
Sergey 28126094cc
Fix PR template (#956)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-07-31 17:14:34 +03:00
Sergey 2de46dd4de
Add template based issue and PR (#954)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-07-31 16:56:09 +03:00
Sergey 54c23c9876
Add templates based CI (#953)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-07-31 16:47:10 +03:00
Sergey 68af6b98fd
Fix remaining issues in CI for Ansible 2.20 (#952)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-07-31 14:20:46 +03:00
Sergey e12f269323
Fix Python version in CI for latest Ansible 2.19 (#951)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-07-31 13:54:17 +03:00
Sergey 43e9e4c5aa
Fix obsolete image in CI (#949)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-07-14 20:31:36 +03:00
Sergey f41939d8d8
Replace image in tests from quay.io (#948)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-07-12 16:38:54 +03:00
Sergey 87be6de5c7
Add ignore file for Ansible 2.20 (#946)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-07-01 16:25:35 +03:00
Sergey 13a568f8c6
Release 1.17.0 (#945)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-06-26 13:47:49 +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
johnsonlien aa20ede71e
Add podman system info module (#922)
Add podman system info module

Signed-off-by: johnsonlien <johnsonlien95@gmail.com>
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>

Co-authored-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-06-22 13:13:11 +03:00
Sergey f6bd81e820
Add another test for volumes (#942)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-06-22 12:25:25 +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 50c5a2549d
Release 1.16.4 version (#938)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-06-04 14:16:51 +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
André Lersveen ac5da409fe
Fix idempotency for any podman secret driver (#929)
* Fix idempotency for any podman secret driver

All secret drivers are provided with the same interface in podman, so there is no need to hardcode the state as changed for all drivers other than 'file'.

Signed-off-by: lersveen <7195448+lersveen@users.noreply.github.com>

* ci: add tests for shell secret driver

Signed-off-by: lersveen <7195448+lersveen@users.noreply.github.com>

---------

Signed-off-by: lersveen <7195448+lersveen@users.noreply.github.com>
2025-05-13 15:06:45 +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
Sergey f1a9456147
Fix conditions in CI jobs (#928)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-04-28 00:14:28 +03:00
Sergey 35a9cc1f93
Fix setuptools (#925)
Fix #917
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-04-21 11:46:44 +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
Ewoud Kohl van Wijngaarden 40d320d8f6
Document that sdnotify can be set to healthy (#911)
For quadlets you can set sdnotify (which maps to Notify=) to healthy to
use a healthcheck to determine when the container is up.

Signed-off-by: Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl>
2025-03-10 10:24:42 +02:00
Sergey d901da6301
Fix CI for podman_image_info (#912)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-03-09 16:14:55 +02:00
jeu-umanit 1449f4c1b7
doc: podman_secret: fix indentation error in example (#905)
Signed-off-by: Julien Eula <jeula@umanit.fr>
2025-03-03 13:06:30 +02:00
Finn Krein-Schuch 95a7edb26a
Use usedforsecurity for hashlib.sha256 only in python version >=3.9 (#904)
The usedforsecurity keyword argument of the hashlib functions was
introduced in python 3.9. To achieve compatibility with versions below
that, we only use it once it is available.

The usedforsecurity argument forces use of secure hash functions in
specially compiled versions of python. In this case it would force to
upgrade sha256 to a different hash function should sha256 be deemeed
insecure in the future. The podman hash we are comparing against is
(currently) always sha256.

As sha256 is still considered secure, removing this option for older
python versions should be acceptable.
2025-02-17 18:54:36 +02: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
transcaffeine ✨️ 14ac4a8045
fix(podman_image): correct intendation on 'loop' keyword (#903)
Signed-off-by: transcaffeine <transcaffeine@finally.coffee>
2025-02-17 15:16:10 +02:00
Sergey 010410ae31
Release 1.16.3 (#897)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-01-29 22:15:54 +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
Hagen 16b034b71f
Fix podman_container_copy examples (#882)
Signed-off-by: hagene <hagene@uio.no>
2025-01-08 16:24:49 +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
Vinícius Hashimoto d68ca756de
docs(podman_container): improve comments on network property (#878)
Signed-off-by: vkhashimoto <me@vkhashimoto.dev>
2024-11-24 20:34:29 +02:00
nishipy 1282fc576a
Rename master branch to main (#634)
* Rename master branch to main

Signed-off-by: nishipy <goodisonev4@gmail.com>

* Update with new files

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>

---------

Signed-off-by: nishipy <goodisonev4@gmail.com>
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
Co-authored-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-11-12 14:11:54 +02:00
Sergey a77ca6ab85
Fix list tags failure in podman_search (#875)
Fix #874
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-11-05 14:35:07 +02:00
Sergey 4c84135f5d
Release 1.16.2 version (#873)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-11-03 22:15:02 +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
Sergey 62348545b8
Add option to specify kube file content in module (#863)
Fix #463
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-10-23 18:35:25 +03: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 84cff745f9
Fix unsupported pull policy in example on podman_container.py (#865)
Signed-off-by: InsideTheVoid <824767+InsideTheVoid@users.noreply.github.com>
2024-10-15 13:33:19 +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
Maximilian Stinsky 8aa5708355
podman_login does not support check_mode (#860)
The podman_login module does not have code to support check runs. Therefore a check run in ansible does the actual login. Set supports_check_mode to False so the login is skipped in a dry-run.

Signed-off-by: Maximilian Stinsky <maximilian@stinsky.com>
2024-10-08 17:40:24 +03:00
Martin Jackson e46c7eb1a1
Add secret to login module (#858)
Signed-off-by: Martin Jackson <mhjacks@swbell.net>
Co-authored-by: Sergey <6213510+sshnaidm@users.noreply.github.com>
2024-10-07 23:08:29 +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 ca8267c83b
Add new options for podman_network (#856)
Fix #846
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-09-29 20:44:58 +03:00
Sergey a2806b87fd
Release 1.16.1 version (#854)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-09-26 11:29:57 +03:00
Sergey 4f8ab01fbb
Fix podman image permissions issue and runlable test (#853)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-09-26 09:50:54 +03:00
Evgeni Golov 36c146a633
don't document quadlet_dir as required when setting state=quadlet (#852)
The underlying code has sane defaults and will figure out the
directory on its own in most cases
0b773e5d61/plugins/module_utils/podman/quadlet.py (L688-L693)

Signed-off-by: Evgeni Golov <evgeni@golov.de>
2024-09-25 17:51:54 +03:00
Sergey 0b773e5d61
Release 1.16.0 version (#851)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-09-24 14:26:00 +03:00
Sergey c11b2af89d
CI: add ignore list for Ansible sanity for 2.19 (#850)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-09-24 12:16:23 +03:00
jakestec 1f16527350
modify error and docs (#848)
Signed-off-by: Jacob Stec <jacobstec@gmail.com>
2024-09-23 22:38:46 +03:00
SkrrtBacharach 58edc41196
Trigger a new image build when we detect that the Containerfile has changed. (#811)
* Trigger a new image build when we detect that the Containerfile has
changed.

Signed-off-by: gw <gw@bob.lol>

* Fix return type issues from PR feedback

Signed-off-by: gw <gw@bob.lol>

---------

Signed-off-by: gw <gw@bob.lol>
Co-authored-by: gw <gw@bob.lol>
2024-09-23 22:36:33 +03:00
Sergey 2adc93ffb1
CI: change k8s.gcr.io to registry.k8s.io in tests (#842)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-09-09 11:25:50 +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 f9d33e880b
CI: bump artifacts versions for GHactions (#837)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-09-04 13:53:47 +03:00
Benjamin MENANT 4973c8639e
fix(podman_image): skip empty volume items (#833)
Signed-off-by: Benjamin Menant <dev@menant-benjamin.fr>
2024-09-03 22:00:19 +03:00
Sergey 622f82a8d9
Fix logic in Podman images (#832)
Fix #831
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-09-03 10:30:17 +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
Benjamin MENANT ac3a7a5fde
fix(podman_save): always changed when force (#834)
fixes #826

Signed-off-by: Benjamin Menant <dev@menant-benjamin.fr>
2024-09-02 18:52:14 +03:00
dependabot[bot] 552af3ef7f
Bump actions/checkout from 3 to 4 (#822)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-20 16:57:49 +03:00
dependabot[bot] ebc6f13c07
Bump actions/setup-python from 4 to 5 (#821)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-20 16:57:31 +03:00
dependabot[bot] 5bbc06a26c
Bump actions/cache from 3 to 4 (#823)
Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-20 16:57:13 +03:00
Sergey 7a1d668e0e
Update inspection info about objects in modules (#819)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-08-16 19:26:35 +03:00
Sergey ba88eda0fc
CI: Add images removal for tests (#817)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-08-16 15:11:12 +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
Alessandro Rossi eb46429493
Add podman_container_copy module (#813)
Signed-off-by: kubealex <al.rossi87@gmail.com>
2024-08-13 12:56:47 +03:00
Sergey 202a0fb6da
CI: fix Podman search of invalid image (#812)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-08-07 14:52:57 +03:00
Sergey a7b89ba8fc
Add arch to podman build command explicitly (#805)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-07-15 09:14:28 +03:00
Sergey 3e303c7797
Fix podman CI test container images (#804)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-07-14 23:24:19 +03:00
Sergey 3087fcc353
Release 1.15.4 (#801)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-07-12 11:17:46 +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 d113847336
Release 1.15.3 version (#791)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-06-20 22:36:27 +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
Sergey f9aa8878fd
CI: Update python for latest Ansible to 3.11 in CI (#789)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-06-19 10:46:22 +03:00
Sergey 680b9a9309
Upgrade Python version for latest Ansible (#786)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-06-19 10:18:45 +03:00
Sergey c7a2aec93c
Fix CI job for podman_image in push to docker (#785)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-06-13 15:06:44 +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 e88baa9c8d
Release 1.15.2 (#783)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-06-11 20:06:33 +03:00
Sergey e60d54f629
Add option for inline Containerfile in podman_image (#781)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-06-09 14:37:33 +03:00
Sergey fb6ebaae55
Release 1.15.1 version (#778)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-06-07 00:23:17 +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 510d8ad35b
Release 1.15.0 version (#773)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-06-03 10:04:34 +03:00
Sergey 98dd70ae74
Add CI job for Podman search module (#772)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-06-03 09:54:20 +03:00
Derek Waters 38d95029e8
Add podman search (#770)
* Add podman_search module

Signed-off-by: Derek <derek@frisbeeworld.com>
2024-06-03 09:49:29 +03:00
Sergey 4cb8404b7b
Fix issue with pushing podman image to repo name and org (#771)
If destination doesn't have image, but only repo name and org,
complete with image name and tag.

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-06-02 21:01:06 +03:00
Sergey abb667546c
Release 1.14.0 version (#768)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-05-30 08:09:50 +03:00
Sergey d75126d68a
Add path and env options for podman_secret (#766)
Fix #741
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-05-29 23:23:34 +03:00
Sergey f9ab05b0ae
Add mount and unmount for volumes (#764)
Fix #603
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-05-29 18:28:44 +03:00
Sergey 4985d48415
Reapply "Fix transports issues in podman_image (#619)" (#754) (#755)
This reverts commit 391e4c54ef.

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-05-29 18:27:07 +03:00
Sergey 0e24de1dd3
Add new functionality tests for podman_secret (#765)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-05-29 10:41:30 +03:00
Oleg Bulatov d5224b5323
Create podman secret when skip_existing=True and it does not exist (#733)
Signed-off-by: Oleg Bulatov <oleg@bulatov.me>
2024-05-29 10:34:12 +03:00
Sergey 863ac0e38a
Add docs, tests and more examples for podman_pod (#763)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-05-29 10:24:01 +03:00
Sergey 9142efd82a
Add multiple subnets for networks (#762)
Improve idempotency.
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-05-28 18:36:52 +03:00
Sergey 2887be7289
Add route, dns and ipam_driver to podman_network (#761)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-05-27 21:59:14 +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 b3dc57c1cf
Add autodiscovery for build context in podman_image (#757)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-05-26 00:02:20 +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 391e4c54ef
Revert "Fix transports issues in podman_image (#619)" (#754)
This reverts commit 7ad3dc53d5.

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-05-22 21:11:23 +03:00
Sergey 7ad3dc53d5
Fix transports issues in podman_image (#619)
Fix #218 #205 #264
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-05-22 20:01:32 +03:00
Sergey 2ae2309cb8
Add extra_args for podman_image push and pull (#752)
* Add extra_args for podman_image push

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>

* Add extra_args to podman pull image

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>

---------

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-05-22 19:50:36 +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
Sergey a9e92c902b
Add CI jobs for changes in Quadlet file (#749)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-05-19 22:41:22 +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 1ffa40c705
Use python3image for buildah CI (#746)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-05-17 21:42:55 +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
Sagi Shnaidman 35cdaa1365 Release 1.13.0 version
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-04-22 21:20:28 +03:00
Sagi Shnaidman 4bfbabe727 Add more quadlet examples in docs 2024-04-22 21:20:28 +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
Oliver Walsh 4591a44ef8
Fix pod info for non-existant pods (#732)
Do not try to deserialize json when out is empty

Fixes #731

Signed-off-by: Oliver Walsh <owalsh@redhat.com>
2024-04-12 16:24:13 +03:00
Sergey 7df5126cb3
Release 1.12.1 version (#730)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-04-08 01:29:27 +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 75c4834273 Fix kube play annotations
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
nishipy 6e04b20bf4
Update the logic for deleting pods/containers in podman_play (#727)
* Add test case for deleting pod with podman_play

Signed-off-by: nishipy <goodisonev4@gmail.com>

* Update test case for deleting pod with podman_play

Signed-off-by: nishipy <goodisonev4@gmail.com>

* Add tear_down_pods() for Podman 3.4.0 or later

Signed-off-by: nishipy <goodisonev4@gmail.com>

---------

Signed-off-by: nishipy <goodisonev4@gmail.com>
2024-03-28 13:31:56 +02:00
nishipy 44b2ce69e3
Add support for kube yaml files with multi-documents (#724)
* Add support for multi doc kube yaml

Signed-off-by: nishipy <goodisonev4@gmail.com>

* Update to skip yamllint

Signed-off-by: nishipy <goodisonev4@gmail.com>

* Update ignores for sanity tests

Signed-off-by: nishipy <goodisonev4@gmail.com>

* Update discover_pods()

Signed-off-by: nishipy <goodisonev4@gmail.com>

* Update test for podman_play

Signed-off-by: nishipy <goodisonev4@gmail.com>

---------

Signed-off-by: nishipy <goodisonev4@gmail.com>
2024-03-23 13:55:44 +02:00
Dawa Ometto 890ae35360
Update podman_login.py (#725)
Make tlsverify and certdir parameters no longer mutually exclusive.

Signed-off-by: Dawa Ometto <d.ometto@gmail.com>
2024-03-19 13:38:19 +02:00
Sagi Shnaidman f2dcda6a1d Remove unnecessary quotes in podman_container_exec module
Fix #714
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-02-28 17:55:19 +02:00
Sagi Shnaidman de490b8b37 Fix wrong return data type in podman_image_info
Fix #689
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-02-19 15:08:52 +02:00
Sagi Shnaidman 90ac7e19ac Return data for podman exec module
And add "executable" parameter to be aligned with other modules
Fix #711
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-02-18 18:41:14 +02:00
Sagi Shnaidman a4df896bae CI - add parametrized executables to tests
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-02-18 13:13:57 +02:00
Sagi Shnaidman 129710a383 Fix broken info of pods in Podman v5
Fixing issue from:
https://github.com/containers/podman/pull/21514
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-02-18 13:13:57 +02:00
Sagi Shnaidman aa6a1215cd CI - add custom podman path to tasks
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-02-18 13:13:57 +02: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
Sagi Shnaidman 5e15993783 Fix rootfs test in CI
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
Dan Campbell efbfba7c3c
Fix broken example for podman_generate_systemd (#708)
Change the postgres_local example to use the scope of "user" so
the unit file saved to ~/.config/systemd/user/ will be used by systemd.

Signed-off-by: Dan Campbell <dan@compiledworks.com>
2024-02-04 11:58:28 +02:00
Sergey 7031de6a6b
Release 1.12.0 version (#707)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-01-30 21:26:51 +02:00
Sergey da420f96d9
Add secrets info module (#706)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-01-29 00:14:51 +02:00
Sergey 81209c9a2d
Add tests for env files (#705)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-01-27 22:57:55 +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
dependabot[bot] a6ece472c4
Bump actions/cache from 3 to 4 (#704)
Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-23 11:29:53 +02:00
Sergey 35cac483c9
Add new arguments to podman status commands (#703)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-01-23 11:28:55 +02:00
Sergey 1fe9642576
Add option to parse CreateCommand easily for diff calc (#698)
We have a few calculations of given options and arguments from
CreateCommand, so let's do it in a more convinient way.
Define a function _createcommand which receives an argument
and returns all values for it in a command line of Podman.
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-01-11 15:30:24 +02:00
Andreas Seidl eab26e5eba
Fix idempotency for podman_network (#699) (#700)
* Fix idempotency for podman_network when explicitly definining disable_dns parameter for Podman driver other than type bridge

Signed-off-by: andreas.seidl <andreas.seidl@r-kom.de>
2024-01-11 14:13:32 +02:00
Sergey f9cbca5582
Add idempotency for podman_secret (#693)
* Add idempotency for podman_secret

Fix #692
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>

* Add lables support for podman_secret

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>

---------

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-12-23 18:52:25 +02:00
Sergey 5ee4dd1eda
Fix broken conmon version in CI install (#695)
Podman issue:
https://github.com/containers/podman/issues/21024

Conmon issue:
https://github.com/containers/conmon/issues/475

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-12-23 13:20:01 +02:00
dependabot[bot] 45893f4a7b
Bump actions/setup-python from 4 to 5 (#688)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-11 18:40:25 +02:00
Apollo3zehn e4cf9f6133
Fix example name (#687)
Signed-off-by: Apollo3zehn <git@m1.apollo3zehn.net>
Co-authored-by: Apollo3zehn <git@m1.apollo3zehn.net>
2023-12-11 14:20:59 +02:00
Alessandro Fulgini 4d233a4146
Alias generate systemd options `stop_timeout` and `time` (#685)
* Alias generate systemd options `stop_timeout` and `time`

Closes #683

Option `time` was used before Podman v4, then it was renamed
`stop_timeout`.
Accept both names (the newer takes prirority) and set the correct
CLI argument name based on the detected Podman version.

Signed-off-by: Alessandro Fulgini <fuljo97@gmail.com>

* Fix typo in parameter name `--stop-timeout`

Signed-off-by: Alessandro Fulgini <fuljo97@gmail.com>

* Don't delete temporary variables at the end of block

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

---------

Signed-off-by: Alessandro Fulgini <fuljo97@gmail.com>
Co-authored-by: Sergey <6213510+sshnaidm@users.noreply.github.com>
2023-12-07 11:24:28 +02:00
Sergey e245e332f0
Fix volume inspection by name in podman_volume (#684)
Fix #661
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-12-03 20:54:52 +02:00
Sergey edcb13dd8a
Fail if systemd generation failed and it's explicitly set (#682)
Fix #675

If we explicitly set to generate systemd with parameters, fail
the module if the generation failed.

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-11-30 16:04:51 +02:00
Sergey c3b38b54a9
Catch exceptions when no JSON output in podman_image (#680)
Fix #676
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-11-30 15:12:38 +02:00
Sergey 2d006399b0
Fix idempotency when using 0.0.0.0 in ports (#679)
Fix #678
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-11-30 15:12:17 +02:00
Sergey 821fe265eb
Fix CI rootfs for podman_container (#681)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-11-30 15:02:49 +02:00
Pablo Méndez Hernández ea51855a4c
Add support for setting underlying interface in podman_network (#677)
It may be desirable to set a different interface than the default one
(for example, a different bridge).

In the case of a macvlan interface, it can be used instead of setting
`opt.parent`.

Signed-off-by: Pablo Méndez Hernández <pablomh@redhat.com>
2023-11-29 17:31:49 +02:00
Roberto Alfieri b693cb6b89
Recreate stopped containers if `recreate` flag is enabled (#669)
If `recreate` flag is enabled we should be able to (force) recreate stopped
containers even if they're configuration isn't changed.

Signed-off-by: Roberto Alfieri <ralfieri@redhat.com>
2023-11-28 10:14:24 +02:00
Roberto Alfieri 6c87654f7f
Improve `security_opt` comparison between existing container (#673)
Since SElinux labels are basically annotations, they are merged in a single comma separated string in the list by podman, so we need to split them in a sorted list if we want to compare it to the list that we provide to the module.

Also, a proper test of this example has been added.

Signed-off-by: Roberto Alfieri <ralfieri@redhat.com>
2023-11-28 10:13:17 +02:00
Sergey 59a0dee373
Fix multi-image support for podman_save (#672)
Fix #670
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-11-26 21:31:47 +02:00
nishipy b7e8711230
Add log_opt and annotaion options to podman_play module (#668)
* Add tests for options of podman_play

Signed-off-by: nishipy <goodisonev4@gmail.com>

* Add log_opt and annotaion options for podman_play

Signed-off-by: nishipy <goodisonev4@gmail.com>

* Fix pep8 errors

Signed-off-by: nishipy <goodisonev4@gmail.com>

* Update tests in play-with-options.yml

Signed-off-by: nishipy <goodisonev4@gmail.com>

* Update podman_play.py

Signed-off-by: nishipy <goodisonev4@gmail.com>

* Update test

Signed-off-by: nishipy <goodisonev4@gmail.com>

---------

Signed-off-by: nishipy <goodisonev4@gmail.com>
2023-11-26 14:03:55 +02:00
Sergey 22e0c937d8
Fix the docs for new modules (#667)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-11-04 13:31:27 +02:00
Sergey 9b31d8f01d
Release 1.11.0 version (#666)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-11-04 12:28:13 +02:00
Sergey 1a83e0948b
Release new 1.10.4 version (#663)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-11-01 16:47:25 +02:00
Denis Medeiros 3c0d2cc58c
Add support for health-on-failure action (#658)
Signed-off-by: Denis Medeiros <denis.medeiros@bbd.ca>
2023-11-01 11:31:55 +02:00
Sergey a9fc6b9764
Fix CI jobs for podman_pod with network force (#662)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-11-01 11:31:00 +02:00
Chris Xiao e463004db7
Fix #656: Do not force network removal by default (#660)
* fix #656: do not force network removal by default

* Remove `-f` flag when removing network with `podman network rm`, so
  that containers using the network won't be removed by default.
* Add `force` option (default False) to `podman_network`, which uses `-f`
  and removes containers using the network

Signed-off-by: Chris Xiao <30990835+chrisx8@users.noreply.github.com>

* set default=False for `force`

Signed-off-by: Chris Xiao <30990835+chrisx8@users.noreply.github.com>

---------

Signed-off-by: Chris Xiao <30990835+chrisx8@users.noreply.github.com>
2023-10-31 12:28:41 +02:00
nishipy b65a3dea60
Add build and context_dir option to podman_play (#649)
* Add test for kube_play with image build

Signed-off-by: nishipy <goodisonev4@gmail.com>

* Add build and context_dir options to podman_play

Signed-off-by: nishipy <goodisonev4@gmail.com>

* Fix yamllint errors

Signed-off-by: nishipy <goodisonev4@gmail.com>

* Fix ci errors

Signed-off-by: nishipy <goodisonev4@gmail.com>

---------

Signed-off-by: nishipy <goodisonev4@gmail.com>
2023-10-19 17:25:23 +03:00
Sergey ed8c04fa1e
Fix CI job for podman connection (#655)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-10-19 17:20:56 +03:00
Sergey a1a667b726
Fix network DNS enable idempotency issue (#650)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-09-28 11:42:54 +03:00
nishipy 2a8aaf4522
Add options for resource limits to podman_pod (#635)
* Add resource limiting paramters for podman_pod

Signed-off-by: nishipy <goodisonev4@gmail.com>

* Fix doc-elements-mismatch

Signed-off-by: nishipy <goodisonev4@gmail.com>

* Update tests for podman_pod

Signed-off-by: nishipy <goodisonev4@gmail.com>

---------

Signed-off-by: nishipy <goodisonev4@gmail.com>
2023-09-08 13:36:31 +03:00
Sergey e025e928b2
Fix common file for Python 2.7 (#643)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-09-06 13:28:52 +03:00
Andrew Imeson 18a939a167
Fix typos and spelling errors (#639)
Found with codespell

Signed-off-by: Andrew Imeson <andrew@andrewimeson.com>
2023-09-05 11:30:15 +03:00
dependabot[bot] 65d9d49aa4
Bump actions/checkout from 3 to 4 (#641)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-05 11:29:22 +03:00
Pavel Dostál d2daf7262e
Optimize the podman_runlabel integration test (#640)
I used [1] as example.

[1]: https://fossies.org/linux/podman/test/system/037-runlabel.bats

Signed-off-by: Pavel Dostál <pdostal@pdostal.cz>
2023-09-05 11:28:58 +03:00
Sergey e160458eb6
Fix idempotency when running inside Podman container (#637)
Fix #636
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-08-29 12:55:03 +03:00
Sergey e42e11c714
Add CI for runlabel testing (#630)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-08-23 00:03:50 +03:00
Sergey ba5fa945ef
Add target support for podman build image (#632)
Fix #631
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-08-22 20:54:10 +03:00
nishipy bc3670f8dc
Add podman_container_exec module (#627)
* Add podman_container_exec

Signed-off-by: nishipy <goodisonev4@gmail.com>

* Update podman_container_exec

Signed-off-by: nishipy <goodisonev4@gmail.com>

* Add tests for podman_container_exec

Signed-off-by: nishipy <goodisonev4@gmail.com>

* Update examples for podman_container_exec

Signed-off-by: nishipy <goodisonev4@gmail.com>

* Fix CI errors

Signed-off-by: nishipy <goodisonev4@gmail.com>

* Fix CI errors

Signed-off-by: nishipy <goodisonev4@gmail.com>

* Fix typo

Signed-off-by: nishipy <goodisonev4@gmail.com>

* Add workflow for podman_container_exec

Signed-off-by: nishipy <goodisonev4@gmail.com>

* Fix python version in the workflow for podman_container_exec

Signed-off-by: nishipy <goodisonev4@gmail.com>

* Fix python version in the workflow for podman_container_exec

Signed-off-by: nishipy <goodisonev4@gmail.com>

---------

Signed-off-by: nishipy <goodisonev4@gmail.com>
2023-08-22 18:52:07 +03:00
Pavel Dostál c6ae4b97e7
Add podman_runlabel module (#626)
This is implementing the [podman container runlabel](https://docs.podman.io/en/latest/markdown/podman-container-runlabel.1.html) command.

Signed-off-by: Pavel Dostál <pdostal@suse.cz>
2023-08-22 16:47:52 +03:00
Sergey fea8b255e5
Release 1.10.3 version (#625)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-08-15 21:18:10 +03:00
nishipy 04f455bec1
Add a force field to podman_generate_systemd (#624)
* Add tests for podman_generate_systemd

Signed-off-by: nishipy <goodisonev4@gmail.com>

* Add force option for podman_generate_systemd

Signed-off-by: nishipy <goodisonev4@gmail.com>

* Fix test code for podman_generate_systemd

Signed-off-by: nishipy <goodisonev4@gmail.com>

* Fix CI error

Signed-off-by: nishipy <goodisonev4@gmail.com>

---------

Signed-off-by: nishipy <goodisonev4@gmail.com>
2023-08-13 21:51:13 +03:00
Sergey c6a80a5573
Add example with quotes in command to docs (#623)
Fix #449

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-08-12 15:04:00 +03:00
Sergey 11f9eded6a
Fix idempoency issue with PID of container (#622)
Fix #573
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-08-12 14:25:09 +03:00
Sergey 4812aea6b8
Improve docs about container env_file on remote machine (#621)
Fix #583
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-08-12 13:53:59 +03:00
Sergey faee18ecdc
Fix healthcheck issue where defined in image (#618)
Fix #598
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-08-12 11:32:39 +03:00
DilasserT e4cd2c4493
Adding volume import and export option (#617)
* Adding volume import and export option

adding volume import and volume export to podman_import and podman_export
Updating integration tests

Signed-off-by: DilasserT <dilassert@gmail.com>

* Fixes and linting

Signed-off-by: DilasserT <dilassert@gmail.com>

---------

Signed-off-by: DilasserT <dilassert@gmail.com>
2023-08-11 16:29:22 +03:00
Sergey aeec6b92d6
Revert "Use replace option to recreate a container (#613)" (#616)
This reverts commit cb832c9a84.
We lose flexibility in recreating workflow, replace actually
does the same in Podman - stops and removes/creates.

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-08-07 11:08:18 +03:00
Sergey cb832c9a84
Use replace option to recreate a container (#613)
In recreating container use `--replace` option.
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-08-06 21:26:15 +03:00
Sergey ff12ccddaf
Add restart-sec and other options to systemd generation. (#615)
Add restart_sec, start_timeout_sec and stop_timeout_sec

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-08-06 21:15:36 +03:00
Sergey b91ddd3db7
Fix pulling short image name (#614)
Also return image data when pulling it.
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-08-06 16:39:06 +03:00
Sergey 7a307453a5
Add diff and change detection to systemd generation (#608)
Fix #339
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-08-03 16:26:18 +03:00
Holger Müller cc34c2b780
added cpu_quota parameter to podman_container (#612)
* added cpu_qouta parameter to podman_container

Signed-off-by: Holger Mueller <holger.mueller@inovex.de>

* add missing key to parameter dict

Signed-off-by: Holger Mueller <holger.mueller@inovex.de>

---------

Signed-off-by: Holger Mueller <holger.mueller@inovex.de>
Co-authored-by: Holger Mueller <holger.mueller@inovex.de>
2023-08-03 15:57:10 +03:00
Holger Müller 2914785411
Fixed idempotency with cpus parameter (#581)
* Added cpu_quota parameter and fixed #559

Signed-off-by: Holger Mueller <holger.mueller@inovex.de>

* force float for cpu parameter in diff

Signed-off-by: Holger Mueller <holger.mueller@inovex.de>

* fixed typo

Signed-off-by: Holger Mueller <holger.mueller@inovex.de>

* revert linebreak caused by linting with too short lines

Signed-off-by: Holger Mueller <holger.mueller@inovex.de>

* removed quota parameter from patch

Signed-off-by: Holger Mueller <holger.mueller@inovex.de>

* readded already existing quota key to defaults

Signed-off-by: Holger Mueller <holger.mueller@inovex.de>

---------

Signed-off-by: Holger Mueller <holger.mueller@inovex.de>
Co-authored-by: Holger Mueller <holger.mueller@inovex.de>
2023-08-03 15:29:06 +03:00
Sergey 4e2f42eea6
Fix idempotency for devices (#611)
Fix #610
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-08-02 18:21:43 +03:00
Benjamin Schubert 9aedda4443
Fix idempotency checks when using `userns` (#599)
Previously, this would only mark the userns as expected when `uidmap`
or `gidmap` is passed. However, in the case `userns` is passed, this
is also expected to be set.

Signed-off-by: Benjamin Schubert <contact@benschubert.me>
2023-07-31 20:55:03 +03:00
sedrubal 0ae6baac3d
Fix idempotency for RestartPolicy when MaximumRetryCount > 0 (#607)
Before this change, this task:

```ansible
- containers.podman.podman_container:
    # ...
    restart_policy: on-failure:3
    # ...
```

always caused this diff:

```diff
--- before
+++ after
@@ -1 +1 @@
-restart_policy - on-failure
+restart_policy - on-failure:3
```

Signed-off-by: Sebastian Endres <sebastian.endres@dlr.de>
Co-authored-by: Sebastian Endres <sebastian.endres@dlr.de>
2023-07-30 21:59:13 +03:00
Sergey 0932809c6a
Set Python >=3.10 for Ansible 2.16 (#602)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-07-11 20:32:53 +03:00
Sergey e3000939ef
Fix python versions for CI, drop 2.7 job (#601)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-07-10 15:06:45 +03:00
Sergey 9b60fc5a33
Release 1.10.2 version (#595)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-05-31 13:29:13 +03:00
benblasco fc47f86a18
Added support for "userns" parameter to "play" module (#577)
Co-authored-by: Benjamin Blasco <bblasco@redhat.com>
2023-05-31 13:23:55 +03:00
Simon 52911bfc22
fix(podman-play): fix regex for pod kube recreate (#582)
Signed-off-by: Simon Kuhball <simon@kuhball.de>
Co-authored-by: rwxd <rwxd@pm.me>
2023-05-31 10:27:49 +03:00
Sergey 296faf6154
CI: fix podman play job (#594)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-05-30 22:31:58 +03:00
Sergey 45e1de2bfe
podman-pod: Fix idempotency for pods in 4.4.x versions (#593)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-05-30 19:52:51 +03:00
Sergey e5b37d9756
CI: fix pip installation of the collection (#592)
https://github.com/pypa/setuptools/issues/3197
latest release of setuptools 61.0 broke pip install

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-05-30 14:34:15 +03:00
Sergey 181de14633
Add stdout to podman build and push actions (#586)
Fix #584
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-05-02 17:54:34 +03:00
nishipy ab64d5f953
Update podman_image to specify CPU arch when pulling image (#578)
* Add test to sprcify CPU arch when pulling image

Signed-off-by: nishipy <goodisonev4@gmail.com>

* Update to specify CPU arch when pulling image

Signed-off-by: nishipy <goodisonev4@gmail.com>

* Add document for specifying arch

Signed-off-by: nishipy <goodisonev4@gmail.com>

* Fix for idempotency

Signed-off-by: nishipy <goodisonev4@gmail.com>

* Update plugins/modules/podman_image.py

Signed-off-by: nishipy <goodisonev4@gmail.com>

---------

Signed-off-by: nishipy <goodisonev4@gmail.com>
2023-04-15 13:49:16 +03:00
nishipy e8c270370d
Convert str to json format before evaluating length. (#574)
Signed-off-by: nishipy <goodisonev4@gmail.com>
2023-04-06 13:44:26 +03:00
Sergey 4149dece62
Fix CI for newest Ansible branch 2.16 (#575)
Also include same file for next 3 releases...
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-04-05 20:46:47 +03:00
Sergey d5f7655464
Support SHA256 tag for podman images (#570)
Fix #569
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-04-03 23:56:11 +03:00
Sergey bb4b14bc5d
Add more explanation about cmd_args command usage (#568)
Fix #567

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-04-01 22:01:08 +03:00
spmfox 1a7dc953b4
podman-login - fix FIPS md5 issue and registry requirement (#566)
* Changing md5 to sha256 for FIPS compliance

Signed-off-by: spmfox <spmfox@foxwd.com>

* Removing check for registry

Signed-off-by: spmfox <spmfox@foxwd.com>

* Adding contributor name

Signed-off-by: spmfox <spmfox@foxwd.com>

---------

Signed-off-by: spmfox <spmfox@foxwd.com>
2023-04-01 13:56:09 +03:00
Sergey 0332db2aad
Change yes/no to true/false in the modules (#561)
Fix #560
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-03-08 23:28:52 +02:00
Sergey dba0d78844
podman_systemd: Ignore header when comparing systemd files content (#558)
Fix #557
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-03-04 18:06:23 +02:00
Benjamin Schubert 7c06ddec3b
pod: Support passing multiple networks with params (#553)
Similar to #472, but for pods. there is also support there

Signed-off-by: Benjamin Schubert <contact@benschubert.me>
2023-02-24 12:15:43 +02:00
Sergey 1bfa6396a5
Fix pylint issues for CI ansible-test (#550)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-02-14 16:22:36 +02:00
Sergey 9d168430a4
Fix idempotency lowercase for devices (#549)
Fix: #537

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-02-13 13:24:11 +02:00
Jannik Vieten f618b5ccc6
Improved documentation of `podman_generate_systemd` module (#542)
* podman_generate_systemd: fixed typos in docs and put 'dest' option hints where they belong

Signed-off-by: Jannik Vieten <me@exploide.net>

* podman_generate_systemd: added an idempotent example when using podman_generate_systemd with new:true

Signed-off-by: Jannik Vieten <me@exploide.net>

---------

Signed-off-by: Jannik Vieten <me@exploide.net>
2023-02-12 13:58:18 +02:00
Sergey 8f5842dea6
Add idempotency for restart-policy for containers (#548)
Fix: #440

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-02-12 13:00:00 +02:00
Sergey 132baa18e4
Add hooks-dir parameter for containers (#547)
Fix #539
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-02-12 01:47:46 +02:00
Sergey c4bc7ccada
Fix idempotency for pods with uidmap and gidmap (#546)
Fix #543

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-02-12 01:42:20 +02:00
Roberto Alfieri 7d1d016fe9
added podman_prune module (#538)
* added podman-prune module


---------

Signed-off-by: Roberto Alfieri <ralfieri@redhat.com>
Signed-off-by: Roberto Alfieri <me@rebtoor.com>
2023-01-31 02:22:57 +02:00
zalejus 66f2706464
fix for buildah improper remote target (#540)
This fix is similar to the previous one from [#506](https://github.com/containers/ansible-podman-collections/pull/506), but in buildah.py connection plugin

Signed-off-by: Arkadiusz Zalejski <arkadiusz.zalejski@gmail.com>

Signed-off-by: Arkadiusz Zalejski <arkadiusz.zalejski@gmail.com>
2023-01-18 23:55:36 +02:00
Sergey 877581e31f
Add missing options to podman network (#535)
Fix #534

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2023-01-01 18:20:51 +02:00
linxside a762dc63d0
Fix undesirable splitting of IPv6 host addresses (#533)
* fix: over splitting for ipv6 addresses

Signed-off-by: linxside <git@linux-inside.de>

* test: add test cases for ipv6 oversplitting

Signed-off-by: linxside <git@linux-inside.de>

Signed-off-by: linxside <git@linux-inside.de>
2022-12-13 03:50:40 +02:00
János Gerzson e39439831f
[FIX] Issue #529: become plugin podman_unshare become_user default (#530)
Signed-off-by: Janos Gerzson <gerzsonj@gmail.com>

Signed-off-by: Janos Gerzson <gerzsonj@gmail.com>
2022-11-30 23:08:18 +02:00
Sergey 73af4896b4
Prepare CI for Podman v3 backward compatibility (#528)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-11-29 02:49:27 +02:00
Sergey 2498c52f26
Fix network tests for Podman v4 (#527)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-11-29 01:37:55 +02:00
Sergey f8a70fe5b0
Fix podman logout tests for v4 (#526)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-11-29 00:41:17 +02:00
Sergey 4f6ed89607
Run CI jobs with newer podman 4 (#525)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-11-29 00:02:24 +02:00
Sergey 95649a6e66
Release 1.10.1 version (#522)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-11-22 21:00:16 +02:00
Sergey 76b070ff41
Fix docs for podman_unshare become plugin (#521)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-11-22 20:49:16 +02:00
Sergey d51e253703
Add missed docs for modules (#520)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-11-22 18:23:27 +02:00
phong-ngthanh ed69d3c143
feat: allow empty string for prefixes (#517)
Signed-off-by: zephyros-dev <phong.ngthanh@outlook.com>

Signed-off-by: zephyros-dev <phong.ngthanh@outlook.com>
2022-11-21 18:19:27 +02:00
Sergey 865e1cbee9
Release 1.10.0 version (#512)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-11-17 19:15:52 +02:00
dependabot[bot] 83632441b0
Bump actions/cache from 1 to 3 (#511)
Bumps [actions/cache](https://github.com/actions/cache) from 1 to 3.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v1...v3)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-14 18:37:12 +02:00
Sergey a90c040239
Fix expanduser in path for systemd generation (#510)
Use expanduser for path calculation.
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=2133207
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-11-11 11:00:47 +02:00
Sergey 5c68ee09fe
Add protection for systemd files deletion (#509)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-11-10 21:06:55 +02:00
Sergey 5198b726fb
Delete systemd files when container/pod is deleted (#508)
Fix #489

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-11-10 17:13:45 +02:00
Pelisse Romain 4a1608e700
Warning about improperly configured remote target (#506)
Signed-off-by: Romain Pelisse <belaran@gmail.com>

Signed-off-by: Romain Pelisse <belaran@gmail.com>
2022-11-10 14:28:56 +02:00
Sergey a3f8901c4c
Fix docs issues in podman_image (#507)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-11-02 16:56:24 +02:00
Alessandro Re 1fa3dda67b
docs: added simple extra_args example (#493) 2022-11-01 01:15:40 +02:00
Sergey 05dc08c201
Add example unittest for container lib (#505)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-11-01 00:39:46 +02:00
Sergey c952149603
Add unittests for Ansible Podman modules (#504)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-10-31 23:16:45 +02:00
Sergey 9e92a6e90c
Fix podman load module for Podman 4 (#503)
Fix #486
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-10-31 22:23:35 +02:00
Sergey 712c3230b2
Fix example in systemd generate module (#502)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-10-31 21:59:21 +02:00
CyberFox001 6cf118e7a9
Podman generate systemd (#498)
* Start a new Ansible module: podman_generate_systemd

This module, when finished, will let user generate a systemd .service
unit file from a pod or a container.

If a pod is specified, then the .service file is made for the pod and
its containers.

This commit is only the beginning, with two empty functions and the
base for a Python script.

* podman_generate_systemd : Remove not needed import from __future__

* podman_generate_systemd : Import AnsibleModule and json

* podman_generate_systemd : Build podman comand from user parameters

* podman_generate_systemd : Run the podman command and manage error

* podman_generate_systemd : Manage writing of systemd files, if needed

* podman_generate_systemd : In generate_systemd(), return needed infos

In case of success in generate_systemd() function, return:
- A boolean, indicate if the state of the target systemd is modified
- A copy of the systemd unit content

* podman_generate_systemd : Write run_module() function

This function:
- Build the list of parameters user can use
- Build a default result dictionary
- Build the Ansible Module
- Generate the systemd units (with generate_systemd())
- Return the result, with module.exit_json

* podman_generate_systemd : In main(), call run_module()

* podman_generate_systemd: Return podman command, and remove debug param

The run podman command is now returned by the module, and the "debug"
option is removed.

* podman_generate_systemd: Use more direct #! to python interpreter

The run podman command is now returned by the module, and the "debug"
option is removed.

* podman_generate_systemd: Write DOCUMENTATION variable

* podman_generate_systemd: Write EXAMPLES variable

* podman_generate_systemd: Write RETURN variable

* podman_generate_systemd: Fix typo

* podman_generate_systemd: 'restart_policy, remove default

* podman_generate_systemd: Fix missing "command" return when error

When error in command execution, generate_systemd() was not returning
the command. Now it's done.

* podman_generate_systemd: Remove unnecessary return in case of fail

In generate_systemd(), in case of fail in executing the podman
command, we call module.fail_json() then we return the usual data of
generate_systemd() function.

But module.fail_json() will stop the execution of the module, so it's
not necessary to return a value from generate_systemd() after calling
module.fail_json().

* podman_generate_systemd: Remove TODO

* podman_generate_systemd: Add missing double lines between functions

* podman_generate_systemd: More readability in EXAMPLES variable

* podman_generate_systemd: EXAMPLES, add minimum podman version

When a module option require a minimum Podman version, I indicate
this required version in option description.

For example: The module option `start_timeout` use the Podman option
`--start-timout`, which was introduced in Podman 4.0.0. So, I add in
the description of `start_timeout`: Only with Podman 4.0.0 and above

Options with this information:
- start_timeout
- restart_sec
- wants
- after
- requires

* podman_generate_systemd: EXAMPLES, fix type

* podman_generate_systemd: Simpler code for wants, after and requires

`after`, `wants` and `requires` are of type list. So, no need to
test their type and manage the case where they are of type string.

* podman_generate_systemd, generate_systemd(): Improve returned command

Improve how the used Podman command, returned by generate_systemd(),
is built. Instead of print a list in a formatted string, I join the
list elements with a space char as separator.

* podman_generate_systemd: Add support for the `env` option

Add, to the podman_generate_systemd module, the support for the `env`
option. This commit include the code, the option definition for the
module, the modification of the DOCUMENTATION variable and the add of
an usage example of this new option in the EXAMPLE variable.

* podman_generate_systemd: Write the integration test

* generate_systemd: Fix of the integration test and the --env command option

On the module, I now use the command option `-e=` for the definition
of environment variables. Because the option `--env` give an error
from Podman.

Also, fix errors in the integration test for this module.

* podman_generate_systemd: Add __future__ and __metaclass__ in the module

* podman_generate_systemd: Add author github ID

* podman_generate_systemd: Use argspec type path instead of str for dest option

In the module argspec, I now use the type `path` instead of `str` for
the option `dest`. `os.path.expanduser()` is no more necessary.

* podman_generate_systemd: remove all trailing whitespaces

* podman_generate_systemd: Remove type hint for compatibility with older Python

* podman_generate_systemd: Fix Documentation

Add a default for option `new` and fix typo in `use_names` option name.

* podman_generate_systemd: restart_policy option, new choices

The choice `no` is replaced by `no-restart`

* podman_generate_systemd: dest option in documentation, set type as path

Instead of str

* DNM add CI bits for new module tests

Made by sshnaidm.

* podman_generate_systemd: Better use of fail_json()

First: When calling the method fail_json(), name the `msg` argument to
avoid confusion.

Second: In case of calling fail_json(), I now return the same
arguments than the ones returned by a success: `changed`,
`systemd_units` and `podman_command`.

For future refactoring: Instead of calling fail_json() inside
generate_systemd(), raise custom exceptions and manage calling
fail_json() or exit_json() outside of generate_systemd().

* podman_generate_systemd: Add utf-8

* podman_generate_systemd: Remove `required: false` for DOCUMENTATION var

* podman_generate_systemd: DOCUMENTATION var, use bool instead of yes/no

* podman_generate_systemd: Remove non-necessary check of restart_policy option

The possible choices for this options are set in `ansible_spec` and
will be checked by AnsibleModule code. So, no need to check manually:
`ansible_spec` won't be anything other that the possible choices.

* podman_generate_systemd: On module params, use direct access to dict

Use `module.params['']` instead of `module.params.get('')`.

Because all module's options are defined with the `argument_spec`, the
options used here exist in the params. And if the user don't set
them, the value of the option is `None`.

* podman_generate_systemd: use shlex join for command_str

* podman_generate_systemd: use same quotes for messages

* podman_generate_systemd: Replace f-strings with .format(), for Python 2

* podman_generate_systemd: Revert usage of shlex

It add weird quotes around command options like `-e='ENV_VAR=value'`.

* podman_generate_systemd: Podman command build, more Python 2 compatible

Don't use any more the asterisk to add command options to the command.

* podman_generate_systemd: Better check-mode management

Now, when check mode is enabled, the module report "changed" is
something would be changed, but w/o actually doing anything.

* podman_generate_systemd: remove all trailing whitespaces

Co-authored-by: Sébastien Gendre <seb@k-7.ch>
2022-10-31 20:51:29 +02:00
antonc42 c9008c75b4
fix pod running status for older podman versions (#500)
* fix pod running status for older podman versions

Older podman versions, such as podman 1.6.4 on CentOS 7, do not have the
pod status in the 'podman pod inspect' output. Added an attribute and a
method to PodmanPod to fetch the 'podman pod ps' output. Added an
additional status check to the exising running property that uses the
'ps' info.

Fixes #499

Signed-off-by: antonc42 <antonc42@users.noreply.github.com>
2022-10-29 15:59:20 +03:00
Yuriy Gabuev dbdac4a52b
`podman_image`: add `file` parameter for Containerfile location (#492)
* `podman_image`: correct `path` parameter description

The `path` parameter is the last parameter when running `podman build
...`. As specified in the manpage, it is defined as the build context,
and not necessarily should it contain the Containerfile.

Signed-off-by: Yuriy Gabuev <yuriy.gabuev@holoplot.com>

* `podman_image`: add `file` parameter for Containerfile location

Add the `file` parameter to `podman_image` module which mirrors the
`--file` command line argument for `podman build ...`. This parameter
specifies the location of the Containerfile to use in case it should be
different from the one contained in the build context directory.

Signed-off-by: Yuriy Gabuev <yuriy.gabuev@holoplot.com>

* `podman_image`: add integration tests for `file` parameter

Add tests to ensure that:
- building from a directory without a Containerfile (or Dockerfile)
  fails
- specifying the location of Containerfile with `file` parameter works

Signed-off-by: Yuriy Gabuev <yuriy.gabuev@holoplot.com>

Signed-off-by: Yuriy Gabuev <yuriy.gabuev@holoplot.com>
2022-10-25 17:48:14 +03:00
dependabot[bot] 9531d15d24
Bump actions/upload-artifact from 1 to 3 (#496)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 1 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v1...v3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-25 04:42:06 +03:00
dependabot[bot] 9fe0771f4e
Bump actions/setup-python from 2 to 4 (#497)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2 to 4.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v2...v4)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-25 04:41:31 +03:00
dependabot[bot] 6219c8cb34
Bump actions/checkout from 2 to 3 (#495)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-25 04:39:54 +03:00
dependabot[bot] 3e71b76b2e
Bump actions/download-artifact from 1 to 3 (#494)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 1 to 3.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v1...v3)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-25 04:39:26 +03:00
John Losito 3b3358c811
Check for gha updates weekly using dependabot (#490)
Signed-off-by: John Losito <lositojohnj@gmail.com>

Signed-off-by: John Losito <lositojohnj@gmail.com>
2022-10-25 04:17:10 +03:00
Sergey bf67c7e078
Improve idempotency for devices mount of rootless podman (#487)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-09-28 12:39:15 +03:00
János Gerzson 5f74d5b4fb
New become plugin: podman_unshare (#455)
* New become plugin: podman_unshare

Signed-off-by: Janos Gerzson <gerzsonj@gmail.com>
2022-09-22 17:24:45 +03:00
Sagi Shnaidman 409369c9fc Add shellcheck sanity ignore list for 2.15
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-09-21 02:40:05 +03:00
Sagi Shnaidman d0e3af2b99 Bump galaxy.yml for devel version
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-09-21 02:40:05 +03:00
Sergey 853d3a8cc7
Fix idempotency for labels in pods (#482)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-09-20 12:12:17 +03:00
Sergey 31dbd55579
Prepare tests to use custom executable, part 6 (#478)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-09-04 22:33:28 +03:00
Sergey 03f19dfe25
Prepare tests to use custom executable, part 5 (#477)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-09-04 22:03:29 +03:00
Sergey 9c1cd62b6f
Prepare tests to use custom executable, part 4 (#476)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-09-04 21:47:33 +03:00
Sergey d21b6c0326
Prepare tests to use custom executable, part 3 (#475)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-09-04 21:43:00 +03:00
Sergey 51ce943a63
Prepare tests to use custom executable, part 2 (#474)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-09-04 21:28:13 +03:00
Sergey e9d746728d
Prepare tests to use custom executable, part 1 (#473)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-09-04 21:09:04 +03:00
Sergey 93b5acbf6e
Support passing multiple networks with params (#472)
Fix #467
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-09-03 10:40:48 +03:00
Sergey bd0f6f9bc4
Improve networks idempotency for v4 (#471)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-09-02 19:33:16 +03:00
dada513 b72a026328
generate_systemd: implement --wants, --after and --requires (GH-431) (#432)
* generate_systemd: implement --wants, --after and --requires (GH-431)

Signed-off-by: dada513 <dada513@protonmail.com>
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
Co-authored-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-09-01 20:28:07 +03:00
Sergey befb381194
Create a sponsorship file (#466)
Create a sponsorship file
2022-08-29 01:44:46 +03:00
Sergey cecb29222e
Add --sdnotify option for container (#465)
Fix #464

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-08-28 16:42:31 +03:00
Nikita Tokarchuk 9068baeb99
podman_container should ensure image by using os path if rootfs is used (#458)
* Check image with os path if rootfs is used

Signed-off-by: Nikita Tokarchuk <nikita@tokarch.uk>

* Take into account rootfs usage while evaluating a diff

Signed-off-by: Nikita Tokarchuk <nikita@tokarch.uk>

* Always compare rootfs image diffparam as strict

Signed-off-by: Nikita Tokarchuk <nikita@tokarch.uk>

* Reverse image labels getter to ignore the value if None

Signed-off-by: Nikita Tokarchuk <nikita@tokarch.uk>

* Add tests to check podman rootfs containers

Signed-off-by: Nikita Tokarchuk <nikita@tokarch.uk>

Signed-off-by: Nikita Tokarchuk <nikita@tokarch.uk>
2022-08-12 06:26:16 +03:00
Albrecht 08dd7b0ceb
add required argument to example (#461)
Signed-off-by: weichweich <archbelt@posteo.de>
2022-08-08 22:28:15 +03:00
Sergey e6544bdd0a
Fix PEP8 issue in podman_image (#459)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-07-31 22:47:17 +03:00
Adrian Freund 99c2851341
Fix rerunning playbooks with generate_systemd --new (#453)
* Fix restarting containers if --rm is enabled
* Automatically enable rm if generate_systemd.new is set
* Don't assume that the 'new' key in generate_systemd exists

Signed-off-by: Adrian Freund <adrian@freund.io>
2022-07-22 17:41:21 +03:00
Sergey ff60aed673
Set devel Ansible branch to run on Python 3.9 (#457)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-07-22 12:14:47 +03:00
Sergey 3596833a7d
Remove LC_ALL=C from podman tests (#452)
Ansible requires en_US.UTF-8 from 2.14 version.

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-07-14 12:26:28 +03:00
Sergey 33580c8991
Fix building image with buildah and become (#451)
Probably we hit a bug in CI:
https://github.com/containers/buildah/issues/3887
Unset envs to prevent error "sd-bus call: Transport endpoint is not connected"

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-07-14 11:47:50 +03:00
Sergey 2c88b822cf
Set localte in CI tests to en_US.UTF-8 (#450)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-07-14 11:35:47 +03:00
Sergey 33b28086ec
Release 1.9.4 version (#446)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-07-04 16:03:14 +03:00
Sergey db27c68ef9
Fix pod tests in CI (#445)
Remove 'net' from pod idempotency if it's not in inspection.
Probably a bug on Ubuntu.

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-07-04 15:46:35 +03:00
Sagi Shnaidman 75198ae574 Fix pod network idempotency
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-07-01 10:23:12 +03:00
Sagi Shnaidman 6c862b29e7 Fix pods list retrieve
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-07-01 10:23:12 +03:00
Sagi Shnaidman 542986cd8a Pass errors as a string instead of list 2022-07-01 10:23:12 +03:00
Sagi Shnaidman 3fe1edb5b4 Run CI on Ubuntu 22.04
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-07-01 10:23:12 +03:00
Rabi Mishra 6dc481ae2c
Change IpcMode default to shareable (#444)
podman 4.1.x has changed the ipc namespace mode default to
shareable[1] that results in containers being restarted.

[1] 3987c529f4

Resolves: rhbz#2101495
Signed-off-by: Rabi Mishra <ramishra@redhat.com>
2022-06-29 03:10:45 +03:00
Sergey 2cc1040f33
Use 2.13 Ansible version in CI jobs instead of 2.11 (#439)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-06-28 01:04:56 +03:00
Sergey 2577f5b0f5
Remove distutils as deprecated (#437)
Fix #422
The distutils package is deprecated and slated for removal in Python 3.12

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-06-12 22:54:03 +03:00
Cleber Rosa 1003e966ee
Add missing docstring for method that executes the podman commands (#436)
For completeness sake (and because I looked for it and did not find
it), this adds a docstring line for the "use_container_id" parameter.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
2022-06-11 14:35:29 +03:00
Sergey 25b9516488
Allow specify podman_network options MTU and VLAN separately (#435)
Before that it didn't work when only one option set.

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-06-08 19:37:06 +03:00
nishipy acedce8b4b
Update `podman_image` to remove image with image id (#434)
* Update to remove image with image id.

Signed-off-by: nishipy <goodisonev4@gmail.com>
2022-06-08 18:51:25 +03:00
Clemens Lange b33a657f00
Fix idempotency for podman_login (#430)
Signed-off-by: Clemens Lange <clemens.lange@cern.ch>
2022-06-06 12:18:08 +03:00
Benjamin Schubert 15dae0d9ad
podman_container.py: Fix typo in the documentation (#424)
I believe "prefix" is what was meant here

Signed-off-by: Benjamin Schubert <contact@benschubert.me>
2022-05-22 15:08:16 +03:00
Oscar 20a982b564
Fix play_kube not working when yaml not installed on target (#415) (#419)
Signed-off-by: tcmal <oscar.shrimpton.personal@gmail.com>
2022-05-01 11:48:43 +03:00
Sergey 98c516292f
Fix internal networks idempotency (#421)
Remove logic with internal and dns, since Podman supports it in
recent versions.
Fix #350
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-04-28 00:56:22 +03:00
Sergey 848034096c
Disable memory idempotency (#420)
Because of complexity in Podman logic and calculations of b/m/g
etc let's disable this idempotency for now.
Fix #418

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-04-28 00:26:28 +03:00
Sergey e5d6136694
Change network attribute from str to list in pods #414 #416 (#417)
* Change network attribute from str to list in pods

Signed-off-by: André Cirne <dumahk21@gmail.com>

* Fix tests

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>

Co-authored-by: André Cirne <dumahk21@gmail.com>
2022-04-25 02:15:29 +03:00
MasterWaldo b51dc5c814
Loop over image names when multiple images present in archive (#413)
Signed-off-by: Cory Prelerson <cprelerson42@gmail.com>
2022-04-24 22:38:53 +03:00
Sergey f1d68c0fbd
Release 1.9.3 version (#408)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-03-29 14:46:45 +03:00
Sergey fefc7e461f
Remove idempotency for log level (#404)
Since Podman changes its defaults very often and it's impossible
to track and identify every time what is current log level, let's
remove idempotency for this parameter for now.

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-03-29 14:15:16 +03:00
Sergey 91bd219067
Fix sanity issues with a new Ansible version (#405)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-03-29 11:47:42 +03:00
Henry78 4afd6bbd18
Podman Pod: Update examples to use quotes when publishing ports to avoid them being intrepreted as scalars. #394 (#401)
Signed-off-by: Henry <henry78@gmx.at>
2022-03-24 11:46:54 +02:00
Jakob Meng 55a2efa0d0
Release 1.9.2 version (#400)
Signed-off-by: Jakob Meng <code@jakobmeng.de>
2022-03-21 12:28:34 +01:00
Sergey aa4c3223d2
Fix podman collection for Podman version 4 (#398)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-03-17 21:56:19 +02:00
Axel Dahlberg 4a7d64bb43
fix(network) fix issue when missing plugins entry (#392)
Signed-off-by: Axel Dahlberg <git@valleymnt.com>
2022-03-14 13:41:28 +02:00
Rubik's Dot d024e91216
fix check for read-only change of root image (#393)
The --read-only option is not checked for changes between runs of
ansible thus the container is not recreated if the user changes
the root image between read-write to read-only.

Default for the read_only variable set to False in line with
documentation and so that later checks are simplified.

This is a fix for bug #383.

Signed-off-by: Andrew <rubiksdot@grue.cc>

Co-authored-by: Andrew <rubiksdot@grue.cc>
2022-03-14 12:54:12 +02:00
Sergey 81f20befb2
Fix error with exitcommand for Podman v4 (#390)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-03-11 12:13:36 +02:00
Sergey ecf4c1c52d
Fix CI for podman container tests (#386)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-03-08 17:31:29 +02:00
Sergey 85a36e3b1f
Fix new requirements for plugins documentation (#385)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-03-08 13:58:38 +02:00
Sergey 081ac5f851
Fix MAC address detection in created container (#377)
Fix #373

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-02-17 20:17:57 +02:00
Sergey 527ccacf01
Add --requires option (#378)
Fix #374
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-02-17 18:53:37 +02:00
Sergey 23fde625f6
Strip slashes from volumes (#379)
Fix #372

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-02-17 18:29:51 +02:00
Sergey 547abfea53
Add slirp4netns idempotency for pods (#369)
Fix #367
2022-01-16 23:44:08 +02:00
Sergey 71117a3a86
Release 1.9.1 version (#366) 2022-01-13 15:23:26 +02:00
Sergey 4f3a84f4e5
Add new options for pod module (#361) 2022-01-13 15:10:05 +02:00
Aliaksandr Mianzhynski d185616a72
Update secrets description and add test with secret opts (#363)
* Update secrets description and add test with secret opts

* Make pep happy
2022-01-06 18:08:09 +02:00
Radovan Dražný 42dc5be784
Handle tlsverify correctly in podman_login (#365) 2022-01-06 17:00:10 +02:00
Timo Tomasini 9860b78ce5
Fix podman_pod_lib behavior for ports published to multiple IPs (#359)
* Fix podman_pod_lib behavior for ports published to multiple IPs

* Fix IPv6 behavior for pods and add tests

* Fix bind: cannot assign requested address issue with test container
2022-01-03 08:24:51 +02:00
Maxwell G fcf1522147
[Issue template] Use yaml syntax highlighting where appropriate (#358)
Signed-off-by: Maxwell G <gotmax@e.email>
2021-12-28 13:26:38 +02:00
Sergey 410c76d14a
Release 1.9.0 version (#351) 2021-12-05 19:07:32 +02:00
Sergey 8874ba8e1d
Update generated docs for podman_pod (#349) 2021-11-29 00:17:19 +02:00
Joerg Kastning 6ba6c01229
Add a second example to podman_pod_module.html (#346)
Added a second example
2021-11-29 00:13:31 +02:00
Sergey d5e52d813f
Don't include shared 'net' if network is host in pods (#348) 2021-11-29 00:04:53 +02:00
Sergey 05515e8307
Add CI jobs and docs for podman_tag (#347) 2021-11-28 22:31:18 +02:00
Christian Bourque f2882ecb19
Add podman_tag module #328 (#343)
Fixes #328
Co-authored-by: Christian Bourque <christian.bourque@expretio.com>
2021-11-28 18:02:24 +02:00
Aliaksandr Mianzhynski 3e7f7a00a0
Add secrets driver and driver opts support (#344) 2021-11-26 12:22:36 +02:00
Sergey 46578d246a
Release 1.8.3 version (#341) 2021-11-25 19:12:17 +02:00
Sergey 5db058ac67
Remove default value of log-driver (#340)
The default value of log-driver is not defined now and can change
depending on the platform.
2021-11-25 19:06:02 +02:00
Oliver Walsh f3e95d0d3f
Hardcode RT signal numbers (#338)
Looking up SIGRTMIN/SIGRTMAX isn't portable.
Hardcode the Linux signal number instead.

Fixes issue #337.
2021-11-20 03:06:07 +02:00
zephyros e6d2e86e35
Add documentations for generate_systemd (#336) 2021-11-19 16:04:06 +02:00
Luca Beltrame cef7bdbea0
Support --new in generate_systemd (#334)
* Support --new in generate_systemd

Fixes #318.

* Add docs
2021-11-18 14:35:42 +02:00
Sergey 8829be3231
Release 1.8.2 version (#333) 2021-11-09 13:48:40 +02:00
Cédric Jeanneret a8e81193f4
Allow to actually pass a list of string for "mounts" (#332)
Like "volume", "mount" can be passed multiple times to the container
creation/run, therefore we want to support a list of string, and a
"mounts" alias.
2021-11-09 13:40:40 +02:00
Mike aa6d538be9
Don't add newlines to secrets (#331)
* prevent run_command from creating new lines
* removes new line from test
2021-11-01 22:22:57 +02:00
Oliver Walsh a0377fbd24
Fix signal diff for truncated and RT signal names (#326)
* Fix signal diff for truncated and RT signal names

This refactors the signal mapping logic to closely resemble the logic in
podman.

Podman tolerates images with truncated STOPSIGNAL names e.g RTMIN+3
is used in the freeipa-container Dockerfiles.

Also avoids hardcoding real-time signals as they vary per
platform or glibc implementation (see man 7 signal).

* Cleanup lint

* More lint cleanup
2021-10-19 17:18:22 +03:00
Sean Sullivan e90eb325ae
Update error message when pull set to false (#327) 2021-10-19 02:01:52 +03:00
Sergey c14703ac46
Add option for ansible-core in RPM spec file (#325) 2021-10-13 15:45:02 +03:00
Sergey 4982579c79
Add skip option for podman secret (#324) 2021-10-12 13:56:04 +03:00
Sergey 717963d66d
Fix issue with podman and exposed ports (#323) 2021-10-12 02:18:08 +03:00
Sergey a1aec061f5
Support empty stings in prefixes (#321) 2021-10-11 23:38:58 +03:00
Jad Kik 15cd7623af
Add support for network-alias flag (#314)
* Add support for network-alias flag
* Ignore idempotency assert in tests

Co-authored-by: Sagi Shnaidman <sshnaidm@redhat.com>
2021-10-03 22:18:31 +03:00
Sergey b6c20717ae
Fix CI issues with Ansible 2.12 version (#315) 2021-10-03 00:15:20 +03:00
Sergey f56ea8322c
Release 1.8.1 version (#312) 2021-09-24 00:54:22 +03:00
Sergey 3f3cdab506
Add .service extension to systemd files (#310) 2021-09-23 09:50:16 +03:00
Sergey b2541ad39c
Change python version for ansible-core to 3.9 (#311) 2021-09-22 12:08:21 +03:00
Bruno Marsal 8d48e30721
Fix suboption key in podman_container/podman_pod for generate_systemd documentation (#305)
* fix suboption key in podman_container -> generate_systemd documentation

As of this line 5b3f8a4d3d/plugins/module_utils/podman/common.py (L66) it should be "path", not "file"

* fix suboption key in podman_pod -> generate_systemd documentation
2021-09-19 13:54:50 +03:00
Sergey 5b3f8a4d3d
Add aliases for image load/save (#303)
To be compatible with docker_image_load module add 'path' options
as aliases.
2021-09-17 22:36:07 +03:00
Sergey aaff17fc50
Update docs to 1.8.0 (#302)
And bump up repo version.
2021-09-17 22:21:30 +03:00
Sergey cf45010efd
Release 1.8.0 version (#301) 2021-09-17 15:37:31 +03:00
Sergey 5d37e1ee22
Add systemd generation for pods (#299) 2021-09-15 02:44:06 +03:00
Sergey 24329ce5d3
Generate systemd service files for containers (#298) 2021-09-13 17:13:15 +03:00
Sergey 53338e7ec0
Add podman import/export containers modules (#297) 2021-09-12 17:01:38 +03:00
Sergey ff4e26bbac
Podman image load module (#296) 2021-09-06 02:42:34 +03:00
Sergey 0dd471070a
Podman save module (#295) 2021-09-06 01:36:52 +03:00
Sergey edbb1ab1db
Release 1.7.1 with bugfixes (#293) 2021-09-01 13:46:16 +03:00
Marcin Skarbek af7772db77
Add support for podman pod create --infra-name (#292) 2021-09-01 13:42:05 +03:00
Sergey d707f1e7de
Remove idempotency leftovers of volumes GID,UID (#289)
Fix #282
Remove UID and GID from podman volume options.
We don't support idempotency for them due to conflicting changes
in podman versions.
2021-08-16 16:07:37 +03:00
Sergey afe55dd277
Fix idempotency when containers have a common network (#279)
Fix #252
2021-08-16 14:28:57 +03:00
Sergey 8ac0752283
Release 1.7.0 version with podman_secret (#288) 2021-08-15 20:16:45 +03:00
Sergey d13fe1f850
Run tests with podman secret (#287) 2021-08-15 20:04:51 +03:00
Sergey 1f28b52242
Fix modules for newest pylint in ansible-test (#286) 2021-08-15 19:40:07 +03:00
Aliaksandr Mianzhynski e9ace7b4bf
Add initial secrets support (#284)
* Add initial secrets support
2021-08-10 15:35:48 +03:00
Sergey cc6b26ea22
Release 1.6.2 (#280) 2021-08-02 16:28:55 +03:00
Sergey c9e642d134
Add meta/runtime.yml which is required for Galaxy now (#281) 2021-08-02 16:25:23 +03:00
Sergey ed681ef10e
Fix idempotency with systemd podman files (#278)
Fix #276
Label 'podman_systemd_unit' is the marker for container starting
from systemd generated file. In this case:
* Ignore podman_systemd_unit label
* Ignore cidfile settings when this label presents
2021-08-02 12:59:43 +03:00
Sorin Sbarnea d1698121a9
Avoid exposing pipelining support for podman connections (#275)
Fixes: https://github.com/ansible-community/molecule-podman/issues/2
2021-07-29 19:56:04 +03:00
Sergey 9ff36649ab
Change present state to be as created state (#263)
For being more compliant with docker module.
See #257
2021-07-07 18:48:50 +03:00
Sergey 8ada1501f6
Disable no-hosts idempotency (#273)
Because of podman bug we can't discover what's --no-hosts option
set to.
2021-07-07 12:11:13 +03:00
Sergey 06cc4490da
Remove idempotency for volume UID/GID (#272)
Because of difficulty with UID/GID detection in various podman
versions for volumes, don't check idempotency for volume UID/GID.
If need to recreate use "recreate" option as "true".
2021-07-07 01:51:12 +03:00
Sergey 559c4e2ad6
Bump to dev version (#271) 2021-06-08 16:03:37 +03:00
Sergey 440820d335
Release 1.6.1 version (#270) 2021-06-08 12:09:07 +03:00
Sergey b7e904ae74
Fix failure when listing containers (#269)
Workaround issue https://github.com/containers/podman/issues/10225
Add retries and pause for "podman ps"
2021-06-08 12:04:08 +03:00
Sergey ed17e7aa62
Release 1.6.0 version and update docs (#268) 2021-06-03 18:05:19 +03:00
Sergey bcdaa9f825
Add support for timezones in containers (#262)
* Remove choices for cgroups

* Add timezone parameter to container module
2021-05-24 11:39:08 +03:00
Sergey a7629a89db
Fix multi-containers options (#258) 2021-05-24 09:58:33 +03:00
Sergey b3cf53e5ac
Fix idempotency for environment (#260) 2021-05-24 01:22:32 +03:00
Sergey 6f7c1f340f
Add RPM building scripts (#255) 2021-05-13 14:09:16 +03:00
Sergey 1c0a167a1d
Add Podman play kube module (#244)
* Add Podman play kube module
* Add tests
2021-05-12 16:52:42 +03:00
Sergey 95a402b869
Fix ipv6=false issue (#250)
Pass boolean to ipv6 option in command line.
2021-05-03 01:44:57 +03:00
Sergey ecc02870df
Fix overlayfs issue in CI for buildah connection (#245) 2021-04-14 12:08:37 +03:00
Sergey ba763e2988
Add Ansible 2.11 to all tests and use Ubuntu 20.04 (#243) 2021-04-07 11:13:58 +03:00
Sergey ecd50a7874
Add Ansible 2.11 to testing (#242) 2021-04-07 10:50:03 +03:00
Sergey b62fb99bae
Fix ansible-test issues for CI (#241) 2021-04-07 10:21:08 +03:00
Sergey 14f3a84436
Bump to dev version with docs (#239) 2021-04-05 21:02:53 +03:00
Sergey 8c945f2e4c
Release 1.5.0 version (#238) 2021-04-05 20:55:13 +03:00
Sergey 16ab958a3a
Add CI for podman_login module (#237) 2021-04-05 20:41:53 +03:00
Jason Hiatt 8bb3d5d233
Podman login module (#236)
* Module for podman login

* Podman login tests

* Fixed tlsverify check
2021-04-05 16:22:13 +03:00
Sergey 1d48c44758
Bump dev version and update docs (#235) 2021-04-02 04:36:17 +03:00
Sergey ca1fbf899a
Release 1.4.5 version (#234) 2021-04-02 04:01:16 +03:00
Sergey 2b456dfe8c
Fix error with images info where no images (#233) 2021-04-02 03:53:05 +03:00
Sergey 46020ecf80
Convert IPv6 to shorten form (#232) 2021-04-02 03:01:50 +03:00
Sergey b098abb00f
Fix idempotency for rootless networks from v3 (#231)
Rootless network will always have DNS enabled.
Fix #212
2021-04-02 02:36:40 +03:00
Sergey 607c120f94
Fix uppercase labels idempotency issue (#230)
When we lower cases for all keys, but leave it original case for
all values, we need to do the same with input labels.
Add test.
Fix #227
2021-04-01 16:33:27 +03:00
Sergey f41c63815f
Stop pods without recreating them (#229)
Stop pod without recreating if its definition isn't the same as
before.
Fix #215
2021-04-01 14:52:58 +03:00
Sergey f6ec6ac158
Add support for Podman Pod restart (#228)
Fix #223
Add tests.
2021-04-01 12:58:26 +03:00
Sergey d87777394b
Add IPv6 support for publishing ports (#226) 2021-03-31 18:28:46 +03:00
Sergey ed3a3dc080
Fix no_log for newer ansible-test (#221) 2021-03-16 16:28:58 +02:00
Andreas Gerstmayr 303486c52c
Add sigrtmin+3 signal (required for systemd containers) (#220) 2021-03-13 12:30:13 +02:00
Sergey 7bacd62fad
Bump galaxy dev version and docs (#217) 2021-03-01 15:28:38 +02:00
Sergey 13dcf300c7
Release 1.4.4 version (#216) 2021-03-01 15:23:15 +02:00
Sergey af89807468
Don't calculate image digest in check mode (#214) 2021-03-01 13:21:22 +02:00
Sergey 56105f0116
Add information to issues template (#213) 2021-02-27 12:57:56 +02:00
Elias Norrby 4da30fd3fd
Attempt graceful stop when recreating container (#203)
References: containers/ansible-podman-collections#202

Co-authored-by: Sergey <sshnaidm@users.noreply.github.com>
2021-02-24 13:19:37 +02:00
Sergey 5b133ee898
Fix internal networks and DNS plugin for v3 (#210) 2021-02-24 08:28:19 +02:00
Sergey c4ba85f73c
Fixes for podman_container for Podman v3 (#209)
Fix logs, networks, etc.
2021-02-24 07:52:30 +02:00
Sergey 9f45c40ea9
Fix podman_pod* modules for Podman v3 (#207)
Fix network in podman_pod modules for Podman v3
2021-02-23 15:57:25 +02:00
Sergey 44d266dc3e
Change Ubuntu 16 to latest in connection tests (#206) 2021-02-23 01:23:27 +02:00
Yigit Polat ee6a47f916
Update README.md (#208)
indent typo fix.
2021-02-22 16:01:09 +02:00
Sergey 47dbb10a95
Update galaxy.yml to dev version (#198) 2021-02-14 12:15:43 +02:00
Sergey 4002858d0b
Release 1.4.3 version (#197) 2021-02-14 11:51:37 +02:00
Sergey dfae85ecad
Add docs generation (#196) 2021-02-14 11:37:11 +02:00
Sergey 6ee8848310
Release 1.4.2 version (#195) 2021-02-14 10:41:12 +02:00
Sergey 86c9066771
Fix idempotency for multiple ports (#194) 2021-02-14 09:47:32 +02:00
Sagi Shnaidman 3204bb2c23 Fix CI for various Python versions 2021-02-14 08:00:49 +02:00
Sagi Shnaidman 8a61f88d66 Don't recreate container if env_file is specified
Fix #178
2021-02-11 04:34:25 +02:00
Sagi Shnaidman 596aab757f Fix pylint issues for ansible-test 2021-02-11 04:22:04 +02:00
Sagi Shnaidman 2b073c6e89 Fix slirp4netns options idempotency
Fix #184
2021-02-11 01:54:42 +02:00
Sagi Shnaidman 0bdaa4a78f Fix ambigous variable issue for pylint 2021-02-10 20:54:00 +02:00
Sagi Shnaidman e4f5a8eabe Convert systemd option to a string
And set it to lower to workaround bugs in 3.0.1
2021-02-10 20:14:03 +02:00
Sagi Shnaidman 885af0c7c5 Change default log level for 3+ versions 2021-02-10 18:13:39 +02:00
Georgi Valkov b911939f07 Fix 'cap_add' and 'cap_drop' idempotency
- Ensure that comparison always happens on lower-case values.

- Take into account that capabilities can be specified with or
  without the 'CAP_' prefix.
2021-02-01 11:24:14 +02:00
Sagi Shnaidman c85718665b Fix uid/gid checks for podman 1.6.4 volumes
And prepare volume tasks for versioned checks
2021-01-15 02:29:32 +02:00
Sagi Shnaidman 03f578405c Update README with docs links 2021-01-13 23:40:33 +02:00
Sagi Shnaidman ee51fb3c81 Fix static files for docs 2021-01-13 23:11:25 +02:00
Sagi Shnaidman 3f27e78976 Add docs to Github 2021-01-13 22:23:52 +02:00
Justin Riley db09d8e778 podman_container_lib: fix command idempotency
preserve case sensitivity by removing the use of lower() and using shlex
to split the command string
2021-01-12 13:38:28 +02:00
Sagi Shnaidman d9e392f47e Don't set default for validate-certs in podman_image 2021-01-08 13:02:13 +02:00
Sagi Shnaidman be87b6859c Add debug log and podman_actions to podman_image 2021-01-08 01:37:15 +02:00
Sagi Shnaidman c60f2c6cae Restart container in a simple manner
Don't require an image when restarting container, only the
container name.
2021-01-08 00:56:42 +02:00
Sagi Shnaidman 33c7fa5842 Add 'created' state for podman_container
Add state 'created' which will ensure container exists in current
configuration. It can either run or not.
2021-01-06 15:20:16 +02:00
Sagi Shnaidman bae71956b7 Handle slash removals for root volumes mount 2020-12-27 16:00:46 +02:00
Sagi Shnaidman 281ec2fb82 Release 1.4.1 2020-12-21 01:03:40 +02:00
Sagi Shnaidman 00d490b95c Convert gidmap to list for podman_container
Fix #152
2020-12-21 00:53:42 +02:00
Sagi Shnaidman 1d5d02cbbb Convert log-opts to dictionary and idempotent 2020-12-21 00:53:42 +02:00
Sagi Shnaidman 27d5a718e6 Release 1.4.0 version 2020-12-20 21:57:36 +02:00
Sagi Shnaidman 075d35daee Fix idempotency for volume GID and UID
Fix #150
Add special treat for volume GIDs and UIDs options.
2020-12-20 21:10:53 +02:00
Sagi Shnaidman 62638bac26 Fix no_hosts idempotency for newer version 2020-12-20 18:30:17 +02:00
Sagi Shnaidman cd652fe2ee Remove 'detach' when creating container 2020-12-20 18:30:17 +02:00
Sagi Shnaidman 6f8df336bc Add support of network options like MTU, VLAN 2020-12-20 16:50:54 +02:00
Sagi Shnaidman 04c7e18bc3 Add IPv6 to network
Fix CI for podman network.
Make 'subnet' required for ip-range or gateway.
Add IPv6 subnets.
2020-12-20 16:50:54 +02:00
Sergey 2a84642c3f
Add podman_containers module for multiple containers (#141) 2020-12-13 20:59:07 +02:00
Sergey fecc0739d6
Fix doc defaults for podman_image (#151) 2020-12-08 12:31:57 +02:00
Sagi Shnaidman a35c9cc8ca Add idempotency for mac_address and tests 2020-11-23 15:53:08 +02:00
Eric L 29a4bfa8e0 Add mac_address field to podman_container module
* extended description of podman_container
* add mac_address field and add_param function in podman_container_lib
* closes #146
2020-11-23 15:53:08 +02:00
Eric L baf459ec23
Correct IP range example for podman_network (#149)
the IP range must be in CIDR notation not IP1-IP2, at least according to man page
of podman-network-create

Co-authored-by: Eric L <ewl+git@lavar.de>
2020-11-23 14:16:32 +02:00
cfelder 95baa8faae
podman_image: reuse existing results in present() (#109)
* podman_image: reuse existing results in present()
2020-11-08 14:04:44 +02:00
Riyad Preukschas 9bc1233a73
Improve compatibility with docker_container by adding aliases (#142) 2020-11-07 19:54:27 +02:00
Sergey 90e6bc33f9
Move pod logic to separate library (#140) 2020-11-04 15:04:48 +02:00
Sergey bf752e4492
Move containers logic to module utils (#139) 2020-11-03 09:55:23 +02:00
Sergey 90aea8e818
Fix logout test for podman_logout (#138) 2020-11-02 10:36:32 +02:00
Clemens Lange db7b4ca099
Handle podman logout not logging out when logged in via different tool (#137) 2020-10-27 22:16:16 +02:00
Sergey e1d35e70c6
Add strict image compare with hashes (#136) 2020-10-26 19:23:46 +02:00
Clemens Lange 92389abff2
Add podman_login_info module (#133)
related to #93
2020-10-26 17:32:39 +02:00
Clemens Lange 05746224e0
Add podman logout module (#134)
* Add podman logout module
* Add more tests
* Fix output string comparison (due to podman inconsistency)
* Fix copy and paste error
* Use full module path and name
Fix #94
2020-10-26 15:22:38 +02:00
Sergey 91073bb443
Prepare pod module to be called from other modules (#130) 2020-10-24 23:43:43 +03:00
Sergey 3dbca6fb91
Fix force restart option for containers (#131) 2020-10-24 18:04:42 +03:00
Sergey 1cf8872345
Add log level for Podman in module (#129) 2020-10-22 22:34:21 +03:00
Sergey 00a2bc9453
Prepare podman container to be called from other module (#128) 2020-10-22 00:43:53 +03:00
Sergey 7288eddc1c
Release 1.3.2 hotfix (#127) 2020-10-20 17:34:14 +03:00
Sergey 2007d84132
Fix signals case for podman_container (#126)
In #113 we made a change to lowercase only keys, but signals in
image info are upper case.

Fix tests - stop signal should be word, not number.
Related to #125.
2020-10-20 16:54:33 +03:00
Sergey 297995540b
Add jobs for Ansible 2.10 and 2.11 releases (#124) 2020-10-18 22:47:41 +03:00
Sébastien CATHERINE 978e328420
Update podman_network.py (#123)
Fix doc
2020-10-12 01:19:57 +03:00
Sergey 03aed3edcc
Add changelog for 1.3.1 (#122) 2020-10-09 02:39:37 +03:00
Sergey 5343cb43ed
Remove pyyaml from requirements (#121)
And remove all skips from ansible-test which were related to
imports and compiles.
2020-10-09 01:10:26 +03:00
Sergey f7f279a9ce
Add note about containerPort setting (#120)
Fix #116
2020-10-08 21:18:45 +03:00
Sergey c9479367d9
Set options for a volume as list and fix idempotency (#119)
Options can be set multiple times for a driver, so let's configure
them as a list.
Fix idempotency for options and add tests for them.
Fix #108
2020-10-08 17:40:18 +03:00
Sergey f03362429b
Check if dnsname plugin installed for CNI (#118)
If dnsname plugins is not in specified set of paths, it's not
installed. If it's not installed, then the default values of
disable-dns will be True (as dns is disabled).
2020-10-07 13:05:50 +03:00
Holger Hees 1bd3b70de6
fix diff calculation for lower/upper cases (#115)
* fix diff calculation

* fix formatting

* fix formatting

* removed unused import statements

* add missing requirement doc
2020-10-07 11:50:43 +03:00
ruatag 9a7b4d7172
Fix init: option it's boolean not string (#111)
* Fix init: option it's boolean not string

* DOCUMENTATION.options.init.type bool
2020-09-28 21:25:37 +03:00
Sergey c97a56a0a2
Add podman_network module (#107)
And add release 1.3.0
2020-09-03 01:38:25 +03:00
Sergey cb6934de24
Fix return data from podman_volume module (#106) 2020-09-03 01:21:54 +03:00
Sergey 280af2c268
Add changelog for Ansible 2.10 release (#103) 2020-08-17 15:57:48 +03:00
Sergey 8e45217465
Add setup files for Pip installation (#100) 2020-08-06 15:39:32 +03:00
Sergey 69b034b263
Fix yaml python dep in root tests (#96)
Use different python interpretators for root and rootless tests,
as it's a problem in Ubuntu 18.
2020-08-03 14:49:55 +03:00
Jens Heinrich a38df046a4
Update README.md (#97)
Fix minor typos
2020-08-03 12:41:31 +03:00
Sergey 2d3689e8c5
Fix issue with idempotency uts, ipc with pod (#95) 2020-07-29 13:25:32 +03:00
Sergey 727d4a361f
Fix idempotency for case with = in env (#92)
Add tests for env settings.
2020-07-27 20:00:04 +03:00
Sergey 0519ab69ab
Chown file for users when copy them to container (#90)
In podman connection when we copy file to container and work as
non-root user, need to set correct ownership for the files.
Since ansible change https://github.com/ansible/ansible/pull/70221
it's broken, because of new permissions ansible set to copied files.
2020-07-26 18:39:18 +03:00
Sergey e1a81db9ea
Fix publish job (#89)
Add dry run job for testing publishing
2020-07-22 13:06:07 +03:00
Sergey 869c644448
Improve podman volume info tests with new module (#88) 2020-07-22 09:11:26 +03:00
Sergey 4069b600ea
Create podman_volume module for volumes management (#87) 2020-07-22 09:04:00 +03:00
378 changed files with 80171 additions and 4479 deletions

3
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1,3 @@
# These are supported funding model platforms
github: [sshnaidm]

View File

@ -1,77 +0,0 @@
<!--
---------------------------------------------------
BUG REPORT INFORMATION
---------------------------------------------------
Use the commands below to provide key information from your environment:
You do NOT have to include this information if this is a FEATURE REQUEST
Please update your version of Podman Ansible modules to the latest possible and
retry your command before creating an issue.
-->
**Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)**
/kind bug
/kind feature
**Description**
<!--
Briefly describe the problem you are having in a few paragraphs.
-->
**Steps to reproduce the issue:**
1.
2.
3.
**Describe the results you received:**
**Describe the results you expected:**
**Additional information you deem important (e.g. issue happens only occasionally):**
**Output of `ansible --version`:**
```
(paste your output here)
```
**Output of `podman version`:**
```
(paste your output here)
```
**Output of `podman info --debug`:**
```
(paste your output here)
```
**Package info (e.g. output of `rpm -q podman` or `apt list podman`):**
```
(paste your output here)
```
**Playbok you run with ansible (e.g. content of `playbook.yaml`):**
```
(paste your output here)
```
**Command line and output of ansible run with high verbosity:**
```
(paste your output here)```
**Additional environment details (AWS, VirtualBox, physical, etc.):**

105
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View File

@ -0,0 +1,105 @@
name: Bug Report
description: File a bug report
title: "[BUG]: "
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
Please update your version of Podman Ansible modules to the latest possible and retry your command before creating an issue.
- type: textarea
id: description
attributes:
label: Description
description: Briefly describe the problem you are having
placeholder: Tell us what you see!
validations:
required: true
- type: textarea
id: steps
attributes:
label: Steps to reproduce
description: What are the reproduction steps?
placeholder: |
1. Run command...
2. See error...
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected behavior
description: What did you expect to happen?
validations:
required: true
- type: textarea
id: actual
attributes:
label: Actual behavior
description: What actually happened?
validations:
required: true
- type: textarea
id: collection-version
attributes:
label: Collection version
description: Output of `ansible-galaxy collection list | grep containers.podman` or `git show --summary`
render: shell
validations:
required: true
- type: textarea
id: ansible-version
attributes:
label: Ansible version
description: Output of `ansible --version`
render: shell
validations:
required: true
- type: textarea
id: podman-version
attributes:
label: Podman version
description: Output of `podman version`
render: shell
validations:
required: true
- type: textarea
id: playbook
attributes:
label: Playbook
description: Content of your playbook (use real values, not templated parameters like {{ variable_name }}!)
placeholder: |
- name: Create container
containers.podman.podman_container:
name: my-container
image: nginx:latest
state: present
render: yaml
validations:
required: false
- type: textarea
id: command-output
attributes:
label: Command output
description: Command line and output of ansible run with high verbosity (use `--diff -vv` for idempotency issues)
render: shell
validations:
required: false
- type: textarea
id: additional
attributes:
label: Additional information
description: Any additional information (environment details, package info, etc.)
validations:
required: false

View File

@ -0,0 +1,50 @@
name: Feature Request
description: Suggest an idea for this project
title: "[FEATURE]: "
labels: ["enhancement"]
body:
- type: markdown
attributes:
value: |
Thanks for suggesting a new feature!
- type: textarea
id: problem
attributes:
label: Is your feature request related to a problem?
description: A clear and concise description of what the problem is
placeholder: I'm always frustrated when...
validations:
required: false
- type: textarea
id: solution
attributes:
label: Describe the solution you'd like
description: A clear and concise description of what you want to happen
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Describe alternatives you've considered
description: A clear and concise description of any alternative solutions or features you've considered
validations:
required: false
- type: textarea
id: use-case
attributes:
label: Use case
description: Describe your use case and how this feature would help
validations:
required: false
- type: textarea
id: additional
attributes:
label: Additional context
description: Add any other context or screenshots about the feature request here
validations:
required: false

7
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,7 @@
---
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

46
.github/pull_request_template.md vendored Normal file
View File

@ -0,0 +1,46 @@
# Type of change
Please select the type of change:
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
- [ ] CI/CD improvements
- [ ] Refactoring
- [ ] Other: _____
## Description
Brief description of the changes...
## Motivation and context
Why is this change required? What problem does it solve?
Fixes issue #___
## How has this been tested?
Describe the tests that you ran to verify your changes:
- [ ] Unit tests
- [ ] Integration tests
- [ ] Manual testing
- [ ] Other: _____
## Checklist
- [ ] I have performed a self-review of my own code
- [ ] I have tested my changes thoroughly
- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] If I used AI tools, I have disclosed their use in the description of my changes and reviewed the output for accuracy
## Breaking changes
If this is a breaking change, describe what breaks and how to migrate:
## Additional notes
Any additional information or notes for reviewers:

View File

@ -0,0 +1,468 @@
name: Podman Latest Build Testing
on:
schedule:
- cron: "0 4 * * *" # Run daily at 4:00 UTC
workflow_dispatch: # Allow manual triggering
pull_request:
paths:
- ".github/workflows/build_latest_podman.yml"
- 'ci/playbooks/containers/podman_container.yml'
- 'plugins/modules/podman_container.py'
- 'plugins/module_utils/podman/podman_container_lib.py'
- 'plugins/module_utils/podman/common.py'
- 'plugins/module_utils/podman/quadlet.py'
- 'plugins/modules/podman_container_info.py'
- 'tests/integration/targets/podman_container/**'
- 'tests/integration/targets/podman_container_idempotency/**'
jobs:
build-podman-from-source:
name: Build Podman from latest source
runs-on: ubuntu-24.04
outputs:
podman-version: ${{ steps.build-info.outputs.version }}
steps:
- name: Check out repository
uses: actions/checkout@v5
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.21"
- name: Install build dependencies and container runtimes
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
git \
libseccomp-dev \
libgpgme-dev \
libdevmapper-dev \
libsystemd-dev \
pkg-config \
uidmap \
libbtrfs-dev \
protobuf-compiler \
go-md2man \
runc \
conmon \
jq
echo "=== Installed runtime versions ==="
runc --version || echo "runc not available"
conmon --version || echo "conmon not available"
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Fix apparmor
run: |
sudo systemctl stop apparmor.service
#sudo aa-teardown || true
sudo sed -i "s@/usr/bin@/usr/local/bin@g" /etc/apparmor.d/podman
sudo apparmor_parser -r /etc/apparmor.d/podman || echo "AppArmor parser failed, continuing..."
- name: Clone Podman source and check dependencies
run: |
git clone https://github.com/containers/podman.git /tmp/podman
cd /tmp/podman
git log --oneline -1
echo "=== Checking dependency versions ==="
# Check go.mod for dependencies
if [ -f go.mod ]; then
echo "--- go.mod dependencies ---"
grep -E "(runc|conmon|crun)" go.mod || echo "No runtime deps found in go.mod"
fi
# Check docs for installation requirements
if [ -f docs/tutorials/podman-installation.md ]; then
echo "--- Installation docs ---"
grep -A5 -B5 -i "conmon\|runc\|crun" docs/tutorials/podman-installation.md || echo "No runtime info in installation docs"
fi
# Check Dockerfiles
find . -name "Dockerfile*" -exec echo "=== {} ===" \; -exec grep -i "conmon\|runc\|crun" {} \; 2>/dev/null || echo "No Dockerfiles with runtime info"
# Check CI setup scripts
find contrib -name "*.sh" -exec echo "=== {} ===" \; -exec grep -A3 -B3 -i "conmon\|runc\|crun" {} \; 2>/dev/null || echo "No CI scripts with runtime info"
# Check for any version files
find . -name "*version*" -o -name "*VERSION*" | head -5
- name: Build Podman from source
id: build-info
run: |
cd /tmp/podman
make BUILDTAGS="seccomp systemd"
sudo make install PREFIX=/usr/local
# Get version info
VERSION=$(/usr/local/bin/podman version --format "{{.Client.Version}}")
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Built Podman version: $VERSION"
# Verify installation
/usr/local/bin/podman --version
/usr/local/bin/podman info --format json | jq -r '.version.Version'
- name: Configure Podman for rootless
run: |
# Set up for rootless usage - use system newuidmap/newgidmap from uidmap package
sudo chmod 4755 /usr/bin/newgidmap || echo "newgidmap not found, continuing..."
sudo chmod 4755 /usr/bin/newuidmap || echo "newuidmap not found, continuing..."
# Configure subuid/subgid for runner user
echo "runner:100000:65536" | sudo tee -a /etc/subuid
echo "runner:100000:65536" | sudo tee -a /etc/subgid
# Create podman directories
mkdir -p ~/.config/containers
# Basic containers.conf with netavark configuration
cat > ~/.config/containers/containers.conf << EOF
[engine]
runtime = "runc"
helper_binaries_dir = ["/usr/lib/podman", "/usr/local/libexec/podman", "/usr/local/bin"]
EOF
sudo mkdir -p /etc/containers
sudo tee /etc/containers/policy.json > /dev/null <<'EOF'
{
"default": [
{
"type": "insecureAcceptAnything"
}
]
}
EOF
echo "Podman configured for rootless usage"
- name: Install deps for Podman
run: |
sudo apt-get update -y
sudo apt-get install -y uidmap \
slirp4netns catatonit netavark aardvark-dns passt conmon \
containernetworking-plugins crun
- name: Test Podman installation
run: |
/usr/local/bin/podman --version
/usr/local/bin/podman info
echo "=== Testing container runtime compatibility ==="
echo "Testing image pull and run functionality..."
# Test image pulling and running - this should fail the build if runtime is incompatible
/usr/local/bin/podman pull docker.io/library/hello-world:latest
/usr/local/bin/podman run --rm hello-world
# Additional runtime debugging
echo "=== Runtime debugging ==="
echo "Available runtimes:"
ls -la /usr/bin/runc /usr/local/bin/crun /usr/bin/crun 2>/dev/null || echo "Some runtimes not found"
echo "Default runtime in use:"
/usr/local/bin/podman info --format json | jq -r '.host.ociRuntime.name' || echo "Could not get runtime info"
- name: Create Podman artifact
run: |
mkdir -p podman-artifact
cp /usr/local/bin/podman podman-artifact/
cp /usr/local/bin/podman-remote podman-artifact/ || true
# cp /usr/local/libexec/podman/netavark podman-artifact/
echo "${{ steps.build-info.outputs.version }}" > podman-artifact/VERSION
- name: Upload Podman artifact
uses: actions/upload-artifact@v4
with:
name: podman-latest
path: podman-artifact/
retention-days: 1
test-podman-container-latest:
name: Podman container test with latest Podman
needs: build-podman-from-source
runs-on: ubuntu-24.04
continue-on-error: true # Don't fail the workflow if this job fails
strategy:
fail-fast: false
matrix:
ansible-version:
- git+https://github.com/ansible/ansible.git@stable-2.18
python-version:
- "3.12"
steps:
- name: Check out repository
uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Download Podman artifact
uses: actions/download-artifact@v5
with:
name: podman-latest
path: podman-artifact/
- name: Install deps for Podman
run: |
sudo apt-get update -y
sudo apt-get install -y uidmap \
slirp4netns catatonit netavark aardvark-dns passt conmon \
containernetworking-plugins crun
- name: Install custom Podman
run: |
sudo cp podman-artifact/podman /usr/local/bin/
sudo chmod +x /usr/local/bin/podman
if [ -f podman-artifact/podman-remote ]; then
sudo cp podman-artifact/podman-remote /usr/local/bin/
sudo chmod +x /usr/local/bin/podman-remote
fi
# Configure PATH to use our custom podman
echo "/usr/local/bin" >> $GITHUB_PATH
PODMAN_VERSION=$(cat podman-artifact/VERSION)
echo "PODMAN_VERSION=$PODMAN_VERSION" >> $GITHUB_ENV
- name: Configure Podman for testing
run: |
# Set up for rootless usage
# Configure subuid/subgid for runner user
echo "runner:100000:65536" | sudo tee -a /etc/subuid
echo "runner:100000:65536" | sudo tee -a /etc/subgid
# Create podman directories
mkdir -p ~/.config/containers
# Basic containers.conf with netavark configuration
cat > ~/.config/containers/containers.conf << EOF
[engine]
runtime = "runc"
helper_binaries_dir = ["/usr/lib/podman", "/usr/local/libexec/podman", "/usr/local/bin"]
EOF
sudo mkdir -p /etc/containers
sudo tee /etc/containers/policy.json > /dev/null <<'EOF'
{
"default": [
{
"type": "insecureAcceptAnything"
}
]
}
EOF
- name: Upgrade pip and install dependencies
run: |
sudo apt-get install -y python*-wheel python*-yaml
python -m pip install --upgrade pip
python -V
pip --version
- name: Set up pip cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ github.ref }}-podman-latest
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install Ansible ${{ matrix.ansible-version }}
run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}'
- name: Build and install collection
run: |
export PATH=~/.local/bin:$PATH
echo "Ansible version:"
~/.local/bin/ansible --version
echo "Podman version:"
podman --version
rm -rf /tmp/just_new_collection
~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force
~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz
- name: Run podman_container tests
run: |
export PATH=~/.local/bin:$PATH
export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg
echo "=== Environment Information ==="
echo "Podman version: $PODMAN_VERSION"
echo "Ansible version:"
ansible --version
echo "Python version:"
python --version
echo "================================"
ansible-playbook -vv ci/playbooks/pre.yml \
-e host=localhost \
-i localhost, \
-e ansible_connection=local \
-e setup_python=false \
-e podman_version_ubuntu=latest
echo "Running podman_container tests..."
ANSIBLECMD="ansible-playbook --skip-tags no_build_version " \
TEST2RUN=podman_container ./ci/run_containers_tests.sh
test-podman-idempotency-latest:
name: Podman Idempotency test with latest Podman
needs: build-podman-from-source
runs-on: ubuntu-24.04
continue-on-error: true # Don't fail the workflow if this job fails
strategy:
fail-fast: false
matrix:
ansible-version:
- git+https://github.com/ansible/ansible.git@stable-2.18
python-version:
- "3.12"
steps:
- name: Check out repository
uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Download Podman artifact
uses: actions/download-artifact@v5
with:
name: podman-latest
path: podman-artifact/
- name: Install deps for Podman
run: |
sudo apt-get update -y
sudo apt-get install -y uidmap \
slirp4netns catatonit netavark aardvark-dns passt conmon \
containernetworking-plugins crun
- name: Install custom Podman
run: |
sudo cp podman-artifact/podman /usr/local/bin/
sudo chmod +x /usr/local/bin/podman
if [ -f podman-artifact/podman-remote ]; then
sudo cp podman-artifact/podman-remote /usr/local/bin/
sudo chmod +x /usr/local/bin/podman-remote
fi
# Configure PATH to use our custom podman
echo "/usr/local/bin" >> $GITHUB_PATH
PODMAN_VERSION=$(cat podman-artifact/VERSION)
echo "PODMAN_VERSION=$PODMAN_VERSION" >> $GITHUB_ENV
- name: Configure Podman for testing
run: |
# Set up for rootless usage
# Configure subuid/subgid for runner user
echo "runner:100000:65536" | sudo tee -a /etc/subuid
echo "runner:100000:65536" | sudo tee -a /etc/subgid
# Create podman directories
mkdir -p ~/.config/containers
# Basic containers.conf with netavark configuration
cat > ~/.config/containers/containers.conf << EOF
[engine]
runtime = "runc"
helper_binaries_dir = ["/usr/lib/podman", "/usr/local/libexec/podman", "/usr/local/bin"]
EOF
sudo mkdir -p /etc/containers
sudo tee /etc/containers/policy.json > /dev/null <<'EOF'
{
"default": [
{
"type": "insecureAcceptAnything"
}
]
}
EOF
- name: Upgrade pip and install dependencies
run: |
sudo apt-get install -y python*-wheel python*-yaml
python -m pip install --upgrade pip
python -V
pip --version
- name: Set up pip cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ github.ref }}-podman-latest
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install Ansible ${{ matrix.ansible-version }}
run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}'
- name: Build and install collection
run: |
export PATH=~/.local/bin:$PATH
echo "Ansible version:"
~/.local/bin/ansible --version
echo "Podman version:"
podman --version
rm -rf /tmp/just_new_collection
~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force
~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz
- name: Run podman_container tests
run: |
export PATH=~/.local/bin:$PATH
export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg
echo "=== Environment Information ==="
echo "Podman version: $PODMAN_VERSION"
echo "Ansible version:"
ansible --version
echo "Python version:"
python --version
echo "================================"
ansible-playbook -vv ci/playbooks/pre.yml \
-e host=localhost \
-i localhost, \
-e ansible_connection=local \
-e setup_python=false \
-e podman_version_ubuntu=latest
echo "Running podman_container tests..."
ANSIBLECMD="ansible-playbook --skip-tags no_build_version " \
TEST2RUN=podman_container_idempotency ./ci/run_containers_tests.sh

View File

@ -13,20 +13,20 @@ jobs:
strategy: strategy:
matrix: matrix:
runner-os: runner-os:
- ubuntu-latest - ubuntu-22.04
ansible-version: ansible-version:
- git+https://github.com/ansible/ansible.git@stable-2.10 - git+https://github.com/ansible/ansible.git@stable-2.15
runner-python-version: runner-python-version:
- 3.7 - 3.9
steps: steps:
- name: Check out ${{ github.repository }} on disk - name: Check out ${{ github.repository }} on disk
uses: actions/checkout@master uses: actions/checkout@v5
- name: Set up Python ${{ matrix.runner-python-version }} - name: Set up Python ${{ matrix.runner-python-version }}
uses: actions/setup-python@v1 uses: actions/setup-python@v5
with: with:
python-version: ${{ matrix.runner-python-version }} python-version: ${{ matrix.runner-python-version }}
- name: Set up pip cache - name: Set up pip cache
uses: actions/cache@v1 uses: actions/cache@v4
with: with:
path: ~/.cache/pip path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('tests/sanity/requirements.txt') }}-${{ hashFiles('tests/unit/requirements.txt') }} key: ${{ runner.os }}-pip-${{ hashFiles('tests/sanity/requirements.txt') }}-${{ hashFiles('tests/unit/requirements.txt') }}
@ -41,7 +41,7 @@ jobs:
~/.local/bin/ansible-galaxy collection build --output-path ~/.local/bin/ansible-galaxy collection build --output-path
"${GITHUB_WORKSPACE}/.cache/collection-tarballs" "${GITHUB_WORKSPACE}/.cache/collection-tarballs"
- name: Store migrated collection artifacts - name: Store migrated collection artifacts
uses: actions/upload-artifact@v1 uses: actions/upload-artifact@v4
with: with:
name: collection name: collection
path: .cache/collection-tarballs path: .cache/collection-tarballs
@ -55,34 +55,33 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
runner-os: runner-os:
- ubuntu-latest - ubuntu-22.04
runner-python-version: runner-python-version:
- 3.7 - '3.11'
ansible-version: ansible-version:
- ansible<2.10 - git+https://github.com/ansible/ansible.git@stable-2.18
- git+https://github.com/ansible/ansible.git@stable-2.10
- git+https://github.com/ansible/ansible.git@devel - git+https://github.com/ansible/ansible.git@devel
python-version: python-version:
- 2.7 - '3.11'
- 3.7
exclude:
- runner-os: ubuntu-latest
runner-python-version: 3.7
ansible-version: git+https://github.com/ansible/ansible.git@devel
python-version: 3.7
include: include:
- runner-os: ubuntu-20.04 - runner-os: ubuntu-22.04
runner-python-version: 3.7 runner-python-version: '3.12'
ansible-version: git+https://github.com/ansible/ansible.git@devel ansible-version: git+https://github.com/ansible/ansible.git@devel
python-version: 3.7 python-version: '3.12'
exclude:
- runner-os: ubuntu-22.04
runner-python-version: '3.11'
ansible-version: git+https://github.com/ansible/ansible.git@devel
python-version: '3.11'
steps: steps:
- name: Set up Python ${{ matrix.runner-python-version }} - name: Set up Python ${{ matrix.runner-python-version }}
uses: actions/setup-python@v1 uses: actions/setup-python@v5
with: with:
python-version: ${{ matrix.runner-python-version }} python-version: ${{ matrix.runner-python-version }}
- name: Set up pip cache - name: Set up pip cache
uses: actions/cache@v1 uses: actions/cache@v4
with: with:
path: ~/.cache/pip path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ github.ref }}-sanity-containers key: ${{ runner.os }}-pip-${{ github.ref }}-sanity-containers
@ -93,7 +92,7 @@ jobs:
run: >- run: >-
python -m pip install --user '${{ matrix.ansible-version }}' python -m pip install --user '${{ matrix.ansible-version }}'
- name: Download migrated collection artifacts - name: Download migrated collection artifacts
uses: actions/download-artifact@v1 uses: actions/download-artifact@v5
with: with:
name: collection name: collection
path: .cache/collection-tarballs path: .cache/collection-tarballs

View File

@ -0,0 +1,58 @@
name: Collection release and publish DRY RUN
on:
push:
paths:
- '.github/workflows/collection-publish.yml'
- '.github/workflows/collection-publish-dry-run.yml'
- 'contrib/build.py'
- 'contrib/publish-requirements.txt'
- 'contrib/publish.sh'
branches:
- main
pull_request:
paths:
- '.github/workflows/collection-publish.yml'
- '.github/workflows/collection-publish-dry-run.yml'
- 'contrib/build.py'
- 'contrib/publish-requirements.txt'
- 'contrib/publish.sh'
schedule:
- cron: 3 0 * * * # Run daily at 0:03 UTC
jobs:
publish-collection-artifact-dry-run:
name: Publish
runs-on: ${{ matrix.runner-os }}
strategy:
matrix:
runner-os:
- ubuntu-22.04
ansible-version:
- git+https://github.com/ansible/ansible.git@stable-2.15
runner-python-version:
- 3.9
steps:
- name: Check out ${{ github.repository }} on disk
uses: actions/checkout@v5
- name: Set up Python ${{ matrix.runner-python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.runner-python-version }}
- name: Install Ansible ${{ matrix.ansible-version }}
run: |
python -m pip install virtualenv
python -m virtualenv /tmp/new-ansible
/tmp/new-ansible/bin/pip install '${{ matrix.ansible-version }}'
/tmp/new-ansible/bin/pip install -r contrib/publish-requirements.txt
- name: Generate a version from tag
run: >-
./contrib/publish.sh ${GITHUB_REF##*/}
env:
API_GALAXY_TOKEN: noreallykeyhere
GALAXY_PATH: /tmp/new-ansible/bin/ansible-galaxy
PYTHON_PATH: /tmp/new-ansible/bin/python
DRYRUN: 1

View File

@ -11,27 +11,27 @@ jobs:
strategy: strategy:
matrix: matrix:
runner-os: runner-os:
- ubuntu-16.04 - ubuntu-22.04
ansible-version: ansible-version:
- git+https://github.com/ansible/ansible.git@stable-2.10 - git+https://github.com/ansible/ansible.git@stable-2.15
runner-python-version: runner-python-version:
- 3.7 - 3.9
steps: steps:
- name: Check out ${{ github.repository }} on disk - name: Check out ${{ github.repository }} on disk
uses: actions/checkout@master uses: actions/checkout@v5
- name: Set up Python ${{ matrix.runner-python-version }} - name: Set up Python ${{ matrix.runner-python-version }}
uses: actions/setup-python@v1 uses: actions/setup-python@v5
with: with:
python-version: ${{ matrix.runner-python-version }} python-version: ${{ matrix.runner-python-version }}
- name: Install Ansible ${{ matrix.ansible-version }} - name: Install Ansible ${{ matrix.ansible-version }}
run: | run: |
python -m pip install --user -r contrib/publish-requirements.txt python -m pip install virtualenv
python -m pip install --user -U --force '${{ matrix.ansible-version }}'
python -m virtualenv /tmp/new-ansible python -m virtualenv /tmp/new-ansible
/tmp/new-ansible/bin/pip install '${{ matrix.ansible-version }}' /tmp/new-ansible/bin/pip install '${{ matrix.ansible-version }}'
/tmp/new-ansible/bin/pip install -r contrib/publish-requirements.txt
- name: Generate a version from tag - name: Generate a version from tag
run: >- run: >-
@ -39,3 +39,5 @@ jobs:
env: env:
API_GALAXY_TOKEN: ${{ secrets.API_GALAXY_TOKEN }} API_GALAXY_TOKEN: ${{ secrets.API_GALAXY_TOKEN }}
GALAXY_PATH: /tmp/new-ansible/bin/ansible-galaxy GALAXY_PATH: /tmp/new-ansible/bin/ansible-galaxy
PYTHON_PATH: /tmp/new-ansible/bin/python
DRYRUN: 0

View File

@ -11,7 +11,7 @@ on:
- 'tests/integration/targets/connection/**' - 'tests/integration/targets/connection/**'
- 'tests/integration/targets/connection_*/**' - 'tests/integration/targets/connection_*/**'
branches: branches:
- master - main
pull_request: pull_request:
paths: paths:
- '.github/workflows/connections_tests.yml' - '.github/workflows/connections_tests.yml'
@ -31,20 +31,20 @@ jobs:
strategy: strategy:
matrix: matrix:
runner-os: runner-os:
- ubuntu-16.04 - ubuntu-22.04
ansible-version: ansible-version:
- git+https://github.com/ansible/ansible.git@devel - git+https://github.com/ansible/ansible.git@stable-2.15
runner-python-version: runner-python-version:
- 3.7 - 3.9
steps: steps:
- name: Check out ${{ github.repository }} on disk - name: Check out ${{ github.repository }} on disk
uses: actions/checkout@master uses: actions/checkout@v5
- name: Set up Python ${{ matrix.runner-python-version }} - name: Set up Python ${{ matrix.runner-python-version }}
uses: actions/setup-python@v1 uses: actions/setup-python@v5
with: with:
python-version: ${{ matrix.runner-python-version }} python-version: ${{ matrix.runner-python-version }}
- name: Set up pip cache - name: Set up pip cache
uses: actions/cache@v1 uses: actions/cache@v4
with: with:
path: ~/.cache/pip path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('tests/sanity/requirements.txt') }}-${{ hashFiles('tests/unit/requirements.txt') }} key: ${{ runner.os }}-pip-${{ hashFiles('tests/sanity/requirements.txt') }}-${{ hashFiles('tests/unit/requirements.txt') }}
@ -59,16 +59,16 @@ jobs:
~/.local/bin/ansible-galaxy collection build --output-path ~/.local/bin/ansible-galaxy collection build --output-path
"${GITHUB_WORKSPACE}/.cache/collection-tarballs" "${GITHUB_WORKSPACE}/.cache/collection-tarballs"
- name: Store migrated collection artifacts - name: Store migrated collection artifacts
uses: actions/upload-artifact@v1 uses: actions/upload-artifact@v4
with: with:
name: collection name: collection
path: .cache/collection-tarballs path: .cache/collection-tarballs
test-podman-connection: test-podman-connection:
name: Podman connection VM ${{ matrix.os || 'ubuntu-latest' }}-${{ matrix.ansible-version }} name: Podman connection VM ${{ matrix.os || 'ubuntu-22.04' }}-${{ matrix.ansible-version }}
needs: needs:
- build-collection-artifact-connection-tests - build-collection-artifact-connection-tests
runs-on: ${{ matrix.os || 'ubuntu-latest' }} runs-on: ${{ matrix.os || 'ubuntu-22.04' }}
defaults: defaults:
run: run:
shell: bash shell: bash
@ -76,30 +76,35 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
ansible-version: ansible-version:
- ansible<2.10 - git+https://github.com/ansible/ansible.git@stable-2.17
- git+https://github.com/ansible/ansible.git@stable-2.10 - git+https://github.com/ansible/ansible.git@devel
os: os:
- ubuntu-latest - ubuntu-22.04
#- ubuntu-20.04 #- ubuntu-22.04
#- ubuntu-16.04 #- ubuntu-16.04
#- macos-latest #- macos-latest
python-version: python-version:
#- 3.8 - "3.11"
- 3.7 # - 3.9
#- 3.6 #- 3.6
#- 3.5 #- 3.5
#- 2.7 #- 2.7
include: include:
- os: ubuntu-20.04 - os: ubuntu-22.04
ansible-version: git+https://github.com/ansible/ansible.git@devel ansible-version: git+https://github.com/ansible/ansible.git@devel
python-version: 3.7 python-version: "3.12"
exclude:
- os: ubuntu-22.04
ansible-version: git+https://github.com/ansible/ansible.git@devel
python-version: "3.11"
steps: steps:
- name: Check out repository - name: Check out repository
uses: actions/checkout@v2 uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2 uses: actions/setup-python@v5
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
@ -110,7 +115,7 @@ jobs:
pip --version pip --version
- name: Set up pip cache - name: Set up pip cache
uses: actions/cache@v1 uses: actions/cache@v4
with: with:
path: ~/.cache/pip path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs
@ -122,7 +127,7 @@ jobs:
run: python -m pip install --user '${{ matrix.ansible-version }}' run: python -m pip install --user '${{ matrix.ansible-version }}'
- name: Download migrated collection artifacts - name: Download migrated collection artifacts
uses: actions/download-artifact@v1 uses: actions/download-artifact@v5
with: with:
name: collection name: collection
path: .cache/collection-tarballs path: .cache/collection-tarballs
@ -135,9 +140,8 @@ jobs:
run: | run: |
export PATH=~/.local/bin:$PATH export PATH=~/.local/bin:$PATH
if [[ '${{ matrix.ansible-version }}' == 'git+https://github.com/ansible/ansible.git@devel' ]]; then export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg
export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then
elif [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then
export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg
fi fi
@ -158,10 +162,10 @@ jobs:
shell: bash shell: bash
test-buildah-connection: test-buildah-connection:
name: Buildah connection VM ${{ matrix.os || 'ubuntu-latest' }}-${{ matrix.ansible-version }} name: Buildah connection VM ${{ matrix.os || 'ubuntu-22.04' }}-${{ matrix.ansible-version }}
needs: needs:
- build-collection-artifact-connection-tests - build-collection-artifact-connection-tests
runs-on: ${{ matrix.os || 'ubuntu-latest' }} runs-on: ${{ matrix.os || 'ubuntu-22.04' }}
defaults: defaults:
run: run:
shell: bash shell: bash
@ -169,30 +173,35 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
ansible-version: ansible-version:
- ansible<2.10 - git+https://github.com/ansible/ansible.git@stable-2.18
- git+https://github.com/ansible/ansible.git@stable-2.10 - git+https://github.com/ansible/ansible.git@devel
os: os:
- ubuntu-latest - ubuntu-22.04
#- ubuntu-20.04 #- ubuntu-22.04
#- ubuntu-16.04 #- ubuntu-16.04
#- macos-latest #- macos-latest
python-version: python-version:
#- 3.8 #- 3.9
- 3.7 - "3.11"
#- 3.6 #- 3.6
#- 3.5 #- 3.5
#- 2.7 #- 2.7
include: include:
- os: ubuntu-20.04 - os: ubuntu-22.04
ansible-version: git+https://github.com/ansible/ansible.git@devel ansible-version: git+https://github.com/ansible/ansible.git@devel
python-version: 3.7 python-version: "3.12"
exclude:
- os: ubuntu-22.04
ansible-version: git+https://github.com/ansible/ansible.git@devel
python-version: "3.11"
steps: steps:
- name: Check out repository - name: Check out repository
uses: actions/checkout@v2 uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2 uses: actions/setup-python@v5
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
@ -203,7 +212,7 @@ jobs:
pip --version pip --version
- name: Set up pip cache - name: Set up pip cache
uses: actions/cache@v1 uses: actions/cache@v4
with: with:
path: ~/.cache/pip path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs
@ -215,7 +224,7 @@ jobs:
run: python -m pip install --user '${{ matrix.ansible-version }}' run: python -m pip install --user '${{ matrix.ansible-version }}'
- name: Download migrated collection artifacts - name: Download migrated collection artifacts
uses: actions/download-artifact@v1 uses: actions/download-artifact@v5
with: with:
name: collection name: collection
path: .cache/collection-tarballs path: .cache/collection-tarballs
@ -228,9 +237,8 @@ jobs:
run: | run: |
export PATH=~/.local/bin:$PATH export PATH=~/.local/bin:$PATH
if [[ '${{ matrix.ansible-version }}' == 'git+https://github.com/ansible/ansible.git@devel' ]]; then export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg
export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then
elif [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then
export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg
fi fi

View File

@ -5,18 +5,26 @@ on:
paths: paths:
- '.github/workflows/podman_container.yml' - '.github/workflows/podman_container.yml'
- 'ci/*.yml' - 'ci/*.yml'
- 'ci/containers/podman_container.yml' - 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_container.yml'
- 'plugins/modules/podman_container.py' - 'plugins/modules/podman_container.py'
- 'plugins/module_utils/podman/podman_container_lib.py'
- 'plugins/module_utils/podman/common.py'
- 'plugins/module_utils/podman/quadlet.py'
- 'plugins/modules/podman_container_info.py' - 'plugins/modules/podman_container_info.py'
- 'tests/integration/targets/podman_container/**' - 'tests/integration/targets/podman_container/**'
branches: branches:
- master - main
pull_request: pull_request:
paths: paths:
- '.github/workflows/podman_container.yml' - '.github/workflows/podman_container.yml'
- 'ci/*.yml' - 'ci/*.yml'
- 'ci/containers/podman_container.yml' - 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_container.yml'
- 'plugins/modules/podman_container.py' - 'plugins/modules/podman_container.py'
- 'plugins/module_utils/podman/podman_container_lib.py'
- 'plugins/module_utils/podman/common.py'
- 'plugins/module_utils/podman/quadlet.py'
- 'plugins/modules/podman_container_info.py' - 'plugins/modules/podman_container_info.py'
- 'tests/integration/targets/podman_container/**' - 'tests/integration/targets/podman_container/**'
schedule: schedule:
@ -25,8 +33,8 @@ on:
jobs: jobs:
test_podman_container: test_podman_container:
name: Podman container ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-latest' }} name: Podman container ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }}-${{ matrix.podman-version || 'unstable' }}
runs-on: ${{ matrix.os || 'ubuntu-latest' }} runs-on: ${{ matrix.os || 'ubuntu-22.04' }}
defaults: defaults:
run: run:
shell: bash shell: bash
@ -34,34 +42,49 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
ansible-version: ansible-version:
- ansible<2.10 - git+https://github.com/ansible/ansible.git@stable-2.18
#- git+https://github.com/ansible/ansible.git@stable-2.10 - git+https://github.com/ansible/ansible.git@devel
os: os:
- ubuntu-latest - ubuntu-22.04
python-version: python-version:
- 3.7 - "3.11"
podman-version:
- unstable
include: include:
- os: ubuntu-20.04 - os: ubuntu-22.04
ansible-version: git+https://github.com/ansible/ansible.git@stable-2.18
python-version: "3.11"
podman-version: stable
- os: ubuntu-22.04
ansible-version: git+https://github.com/ansible/ansible.git@devel ansible-version: git+https://github.com/ansible/ansible.git@devel
python-version: 3.7 python-version: "3.12"
podman-version: unstable
exclude:
- os: ubuntu-22.04
ansible-version: git+https://github.com/ansible/ansible.git@devel
python-version: "3.11"
podman-version: unstable
steps: steps:
- name: Check out repository - name: Check out repository
uses: actions/checkout@v2 uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2 uses: actions/setup-python@v5
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- name: Upgrade pip and display Python and PIP versions - name: Upgrade pip and display Python and PIP versions
run: | run: |
sudo apt-get update
sudo apt-get install -y python*-wheel python*-yaml
python -m pip install --upgrade pip python -m pip install --upgrade pip
python -V python -V
pip --version pip --version
- name: Set up pip cache - name: Set up pip cache
uses: actions/cache@v1 uses: actions/cache@v4
with: with:
path: ~/.cache/pip path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs
@ -87,9 +110,8 @@ jobs:
run: | run: |
export PATH=~/.local/bin:$PATH export PATH=~/.local/bin:$PATH
if [[ '${{ matrix.ansible-version }}' == 'git+https://github.com/ansible/ansible.git@devel' ]]; then export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg
export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then
elif [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then
export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg
fi fi
@ -103,7 +125,8 @@ jobs:
-e host=localhost \ -e host=localhost \
-i localhost, \ -i localhost, \
-e ansible_connection=local \ -e ansible_connection=local \
-e setup_python=false -e setup_python=false \
-e podman_version_ubuntu=${{ matrix.podman-version }}
TEST2RUN=podman_container ./ci/run_containers_tests.sh TEST2RUN=podman_container ./ci/run_containers_tests.sh
shell: bash shell: bash

View File

@ -0,0 +1,32 @@
name: Podman Container Copy module
on:
push:
paths:
- '.github/workflows/podman_container_copy.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_container_copy.yml'
- 'plugins/modules/podman_container_copy.py'
- 'tests/integration/targets/podman_container_copy/**'
branches:
- main
pull_request:
paths:
- '.github/workflows/podman_container_copy.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_container_copy.yml'
- 'plugins/modules/podman_container_copy.py'
- 'tests/integration/targets/podman_container_copy/**'
schedule:
- cron: 4 0 * * * # Run daily at 0:03 UTC
jobs:
test_podman_container_copy:
uses: ./.github/workflows/reusable-module-test.yml
with:
module_name: 'podman_container_copy'
display_name: 'Podman Container Copy module'

View File

@ -0,0 +1,32 @@
name: Podman container exec
on:
push:
paths:
- '.github/workflows/podman_container_exec.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_container_exec.yml'
- 'plugins/modules/podman_container_exec.py'
- 'tests/integration/targets/podman_container_exec/**'
branches:
- main
pull_request:
paths:
- '.github/workflows/podman_container_exec.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_container_exec.yml'
- 'plugins/modules/podman_container_exec.py'
- 'tests/integration/targets/podman_container_exec/**'
schedule:
- cron: 4 0 * * * # Run daily at 0:03 UTC
jobs:
test_podman_container_exec:
uses: ./.github/workflows/reusable-module-test.yml
with:
module_name: 'podman_container_exec'
display_name: 'Podman container exec'

View File

@ -3,106 +3,32 @@ name: Idempotency
on: on:
push: push:
paths: paths:
- '.github/workflows/podman_container.yml' - '.github/workflows/podman_container_idem.yml'
- 'ci/*.yml' - 'ci/*.yml'
- 'ci/containers/podman_container.yml' - 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_container_idempotency.yml'
- 'plugins/modules/podman_container.py' - 'plugins/modules/podman_container.py'
- 'plugins/modules/podman_container_info.py' - 'plugins/module_utils/podman/podman_container_lib.py'
- 'tests/integration/targets/podman_container/**' - 'plugins/module_utils/podman/common.py'
- 'tests/integration/targets/podman_container_idempotency/**'
branches: branches:
- master - main
pull_request: pull_request:
paths: paths:
- '.github/workflows/podman_container.yml' - '.github/workflows/podman_container_idem.yml'
- 'ci/*.yml' - 'ci/*.yml'
- 'ci/containers/podman_container.yml' - 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_container_idempotency.yml'
- 'plugins/modules/podman_container.py' - 'plugins/modules/podman_container.py'
- 'plugins/modules/podman_container_info.py' - 'plugins/module_utils/podman/podman_container_lib.py'
- 'tests/integration/targets/podman_container/**' - 'plugins/module_utils/podman/common.py'
- 'tests/integration/targets/podman_container_idempotency/**'
schedule: schedule:
- cron: 4 0 * * * # Run daily at 0:03 UTC - cron: 4 0 * * * # Run daily at 0:03 UTC
jobs: jobs:
test_podman_container_idem: test_podman_container_idem:
name: Podman container ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-latest' }} uses: ./.github/workflows/reusable-module-test.yml
runs-on: ${{ matrix.os || 'ubuntu-latest' }} with:
defaults: module_name: 'podman_container_idempotency'
run: display_name: 'Idempotency'
shell: bash
strategy:
fail-fast: false
matrix:
ansible-version:
- ansible<2.10
# - git+https://github.com/ansible/ansible.git@stable-2.10
os:
- ubuntu-latest
python-version:
- 3.7
include:
- os: ubuntu-20.04
"ansible-version": git+https://github.com/ansible/ansible.git@devel
"python-version": 3.7
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip and display Python and PIP versions
run: |
python -m pip install --upgrade pip
python -V
pip --version
- name: Set up pip cache
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install Ansible ${{ matrix.ansible-version }}
run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}'
- name: Build and install the collection tarball
run: |
rm -rf /tmp/just_new_collection
~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force
~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz
- name: Run idempotency tests for podman container
run: |
export PATH=~/.local/bin:$PATH
echo "Run ansible version"
command -v ansible
ansible --version
if [[ '${{ matrix.ansible-version }}' == 'git+https://github.com/ansible/ansible.git@devel' ]]; then
export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg
elif [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then
export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg
fi
echo $ANSIBLE_CONFIG
command -v ansible-playbook
pip --version
python --version
ansible-playbook --version
ansible-playbook -vv ci/playbooks/pre.yml \
-e host=localhost \
-i localhost, \
-e ansible_connection=local \
-e setup_python=false
TEST2RUN=podman_container_idempotency ./ci/run_containers_tests.sh
shell: bash

View File

@ -4,105 +4,35 @@ on:
push: push:
paths: paths:
- '.github/workflows/podman_container_info.yml' - '.github/workflows/podman_container_info.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml' - 'ci/*.yml'
- 'ci/containers/podman_container_info.yml' - 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_container_info.yml'
- 'plugins/modules/podman_container.py' - 'plugins/modules/podman_container.py'
- 'plugins/module_utils/podman/podman_container_lib.py'
- 'plugins/module_utils/podman/common.py'
- 'plugins/modules/podman_container_info.py' - 'plugins/modules/podman_container_info.py'
- 'tests/integration/targets/podman_container_info/**' - 'tests/integration/targets/podman_container_info/**'
branches: branches:
- master - main
pull_request: pull_request:
paths: paths:
- '.github/workflows/podman_container_info.yml' - '.github/workflows/podman_container_info.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml' - 'ci/*.yml'
- 'ci/containers/podman_container_info.yml' - 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_container_info.yml'
- 'plugins/modules/podman_container.py' - 'plugins/modules/podman_container.py'
- 'plugins/module_utils/podman/podman_container_lib.py'
- 'plugins/module_utils/podman/common.py'
- 'plugins/modules/podman_container_info.py' - 'plugins/modules/podman_container_info.py'
- 'tests/integration/targets/podman_container_info/**' - 'tests/integration/targets/podman_container_info/**'
schedule: schedule:
- cron: 4 0 * * * # Run daily at 0:03 UTC - cron: 4 0 * * * # Run daily at 0:03 UTC
jobs: jobs:
test_podman_container_info: test_podman_container_info:
name: Podman container info ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-latest' }} uses: ./.github/workflows/reusable-module-test.yml
runs-on: ${{ matrix.os || 'ubuntu-latest' }} with:
defaults: module_name: 'podman_container_info'
run: display_name: 'Podman container info'
shell: bash
strategy:
fail-fast: false
matrix:
ansible-version:
- ansible<2.10
# - git+https://github.com/ansible/ansible.git@stable-2.10
os:
- ubuntu-latest
python-version:
- 3.7
include:
- os: ubuntu-20.04
ansible-version: git+https://github.com/ansible/ansible.git@devel
python-version: 3.7
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip and display Python and PIP versions
run: |
python -m pip install --upgrade pip
python -V
pip --version
- name: Set up pip cache
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install Ansible ${{ matrix.ansible-version }}
run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}'
- name: Build and install the collection tarball
run: |
rm -rf /tmp/just_new_collection
~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force
~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz
- name: Run collection tests for podman container info
run: |
export PATH=~/.local/bin:$PATH
echo "Run ansible version"
command -v ansible
ansible --version
if [[ '${{ matrix.ansible-version }}' == 'git+https://github.com/ansible/ansible.git@devel' ]]; then
export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg
elif [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then
export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg
fi
echo $ANSIBLE_CONFIG
command -v ansible-playbook
pip --version
python --version
ansible-playbook --version
ansible-playbook -vv ci/playbooks/pre.yml \
-e host=localhost \
-i localhost, \
-e ansible_connection=local \
-e setup_python=false
TEST2RUN=podman_container_info ./ci/run_containers_tests.sh
shell: bash

38
.github/workflows/podman_containers.yml vendored Normal file
View File

@ -0,0 +1,38 @@
name: Podman multi-containers
on:
push:
paths:
- '.github/workflows/podman_containers.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_containers.yml'
- 'plugins/modules/podman_container.py'
- 'plugins/module_utils/podman/podman_container_lib.py'
- 'plugins/module_utils/podman/common.py'
- 'plugins/modules/podman_containers.py'
- 'tests/integration/targets/podman_containers/**'
branches:
- main
pull_request:
paths:
- '.github/workflows/podman_containers.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_containers.yml'
- 'plugins/modules/podman_container.py'
- 'plugins/module_utils/podman/podman_container_lib.py'
- 'plugins/module_utils/podman/common.py'
- 'plugins/modules/podman_containers.py'
- 'tests/integration/targets/podman_containers/**'
schedule:
- cron: 4 0 * * * # Run daily at 0:03 UTC
jobs:
test_podman_containers:
uses: ./.github/workflows/reusable-module-test.yml
with:
module_name: 'podman_containers'
display_name: 'Podman multi-containers'

32
.github/workflows/podman_export.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: Podman export
on:
push:
paths:
- '.github/workflows/podman_export.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_export.yml'
- 'plugins/modules/podman_export.py'
- 'tests/integration/targets/podman_export/**'
branches:
- main
pull_request:
paths:
- '.github/workflows/podman_export.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_export.yml'
- 'plugins/modules/podman_export.py'
- 'tests/integration/targets/podman_export/**'
schedule:
- cron: 4 0 * * * # Run daily at 0:03 UTC
jobs:
test_podman_export:
uses: ./.github/workflows/reusable-module-test.yml
with:
module_name: 'podman_export'
display_name: 'Podman export'

View File

@ -0,0 +1,32 @@
name: Podman generate systemd
on:
push:
paths:
- '.github/workflows/podman_generate_systemd.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_generate_systemd.yml'
- 'plugins/modules/podman_generate_systemd.py'
- 'tests/integration/targets/podman_generate_systemd/**'
branches:
- main
pull_request:
paths:
- '.github/workflows/podman_generate_systemd.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_generate_systemd.yml'
- 'plugins/modules/podman_generate_systemd.py'
- 'tests/integration/targets/podman_generate_systemd/**'
schedule:
- cron: 4 0 * * * # Run daily at 0:03 UTC
jobs:
test_podman_generate_systemd:
uses: ./.github/workflows/reusable-module-test.yml
with:
module_name: 'podman_generate_systemd'
display_name: 'Podman generate systemd'

View File

@ -4,105 +4,36 @@ on:
push: push:
paths: paths:
- '.github/workflows/podman_image.yml' - '.github/workflows/podman_image.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml' - 'ci/*.yml'
- 'ci/containers/podman_image.yml' - 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_image.yml'
- 'plugins/modules/podman_image.py' - 'plugins/modules/podman_image.py'
- 'plugins/modules/podman_image_info.py' - 'plugins/modules/podman_image_info.py'
- 'plugins/module_utils/podman/quadlet.py'
- 'plugins/module_utils/podman/podman_image_lib.py'
- 'tests/integration/targets/podman_image/**' - 'tests/integration/targets/podman_image/**'
branches: branches:
- master - main
pull_request: pull_request:
paths: paths:
- '.github/workflows/podman_image.yml' - '.github/workflows/podman_image.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml' - 'ci/*.yml'
- 'ci/containers/podman_image.yml' - 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_image.yml'
- 'plugins/modules/podman_image.py' - 'plugins/modules/podman_image.py'
- 'plugins/modules/podman_image_info.py' - 'plugins/modules/podman_image_info.py'
- 'plugins/module_utils/podman/quadlet.py'
- 'plugins/module_utils/podman/podman_image_lib.py'
- 'tests/integration/targets/podman_image/**' - 'tests/integration/targets/podman_image/**'
schedule: schedule:
- cron: 4 0 * * * # Run daily at 0:03 UTC - cron: 4 0 * * * # Run daily at 0:03 UTC
jobs: jobs:
test_podman_image: test_podman_image:
name: Podman image ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-latest' }} uses: ./.github/workflows/reusable-module-test.yml
runs-on: ${{ matrix.os || 'ubuntu-latest' }} with:
defaults: module_name: 'podman_image'
run: display_name: 'Podman image'
shell: bash extra_collections: 'ansible.posix'
strategy:
fail-fast: false
matrix:
ansible-version:
- ansible<2.10
# - git+https://github.com/ansible/ansible.git@stable-2.10
os:
- ubuntu-latest
python-version:
- 3.7
include:
- os: ubuntu-20.04
ansible-version: git+https://github.com/ansible/ansible.git@devel
python-version: 3.7
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip and display Python and PIP versions
run: |
python -m pip install --upgrade pip
python -V
pip --version
- name: Set up pip cache
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install Ansible ${{ matrix.ansible-version }}
run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}'
- name: Build and install the collection tarball
run: |
rm -rf /tmp/just_new_collection
~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force
~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz
- name: Run collection tests for podman image
run: |
export PATH=~/.local/bin:$PATH
echo "Run ansible version"
command -v ansible
ansible --version
if [[ '${{ matrix.ansible-version }}' == 'git+https://github.com/ansible/ansible.git@devel' ]]; then
export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg
elif [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then
export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg
fi
echo $ANSIBLE_CONFIG
command -v ansible-playbook
pip --version
python --version
ansible-playbook --version
ansible-playbook -vv ci/playbooks/pre.yml \
-e host=localhost \
-i localhost, \
-e ansible_connection=local \
-e setup_python=false
TEST2RUN=podman_image ./ci/run_containers_tests.sh
shell: bash

View File

@ -4,105 +4,34 @@ on:
push: push:
paths: paths:
- '.github/workflows/podman_image_info.yml' - '.github/workflows/podman_image_info.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml' - 'ci/*.yml'
- 'ci/containers/podman_image_info.yml' - 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_image_info.yml'
- 'plugins/modules/podman_image.py' - 'plugins/modules/podman_image.py'
- 'plugins/modules/podman_image_info.py' - 'plugins/modules/podman_image_info.py'
- 'plugins/module_utils/podman/podman_image_lib.py'
- 'tests/integration/targets/podman_image_info/**' - 'tests/integration/targets/podman_image_info/**'
branches: branches:
- master - main
pull_request: pull_request:
paths: paths:
- '.github/workflows/podman_image_info.yml' - '.github/workflows/podman_image_info.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml' - 'ci/*.yml'
- 'ci/containers/podman_image_info.yml' - 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_image_info.yml'
- 'plugins/modules/podman_image.py' - 'plugins/modules/podman_image.py'
- 'plugins/modules/podman_image_info.py' - 'plugins/modules/podman_image_info.py'
- 'plugins/module_utils/podman/podman_image_lib.py'
- 'tests/integration/targets/podman_image_info/**' - 'tests/integration/targets/podman_image_info/**'
schedule: schedule:
- cron: 4 0 * * * # Run daily at 0:03 UTC - cron: 4 0 * * * # Run daily at 0:03 UTC
jobs: jobs:
test_podman_image_info: test_podman_image_info:
name: Podman image info ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-latest' }} uses: ./.github/workflows/reusable-module-test.yml
runs-on: ${{ matrix.os || 'ubuntu-latest' }} with:
defaults: module_name: 'podman_image_info'
run: display_name: 'Podman image info'
shell: bash
strategy:
fail-fast: false
matrix:
ansible-version:
- ansible<2.10
# - git+https://github.com/ansible/ansible.git@stable-2.10
os:
- ubuntu-latest
python-version:
- 3.7
include:
- os: ubuntu-20.04
ansible-version: git+https://github.com/ansible/ansible.git@devel
python-version: 3.7
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip and display Python and PIP versions
run: |
python -m pip install --upgrade pip
python -V
pip --version
- name: Set up pip cache
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install Ansible ${{ matrix.ansible-version }}
run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}'
- name: Build and install the collection tarball
run: |
rm -rf /tmp/just_new_collection
~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force
~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz
- name: Run collection tests for podman image info
run: |
export PATH=~/.local/bin:$PATH
echo "Run ansible version"
command -v ansible
ansible --version
if [[ '${{ matrix.ansible-version }}' == 'git+https://github.com/ansible/ansible.git@devel' ]]; then
export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg
elif [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then
export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg
fi
echo $ANSIBLE_CONFIG
command -v ansible-playbook
pip --version
python --version
ansible-playbook --version
ansible-playbook -vv ci/playbooks/pre.yml \
-e host=localhost \
-i localhost, \
-e ansible_connection=local \
-e setup_python=false
TEST2RUN=podman_image_info ./ci/run_containers_tests.sh
shell: bash

32
.github/workflows/podman_import.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: Podman import
on:
push:
paths:
- '.github/workflows/podman_import.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_import.yml'
- 'plugins/modules/podman_import.py'
- 'tests/integration/targets/podman_import/**'
branches:
- main
pull_request:
paths:
- '.github/workflows/podman_import.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_import.yml'
- 'plugins/modules/podman_import.py'
- 'tests/integration/targets/podman_import/**'
schedule:
- cron: 4 0 * * * # Run daily at 0:03 UTC
jobs:
test_podman_import:
uses: ./.github/workflows/reusable-module-test.yml
with:
module_name: 'podman_import'
display_name: 'Podman import'

32
.github/workflows/podman_load.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: Podman load
on:
push:
paths:
- '.github/workflows/podman_load.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_load.yml'
- 'plugins/modules/podman_load.py'
- 'tests/integration/targets/podman_load/**'
branches:
- main
pull_request:
paths:
- '.github/workflows/podman_load.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_load.yml'
- 'plugins/modules/podman_load.py'
- 'tests/integration/targets/podman_load/**'
schedule:
- cron: 4 0 * * * # Run daily at 0:03 UTC
jobs:
test_podman_load:
uses: ./.github/workflows/reusable-module-test.yml
with:
module_name: 'podman_load'
display_name: 'Podman load'

32
.github/workflows/podman_login.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: Podman login
on:
push:
paths:
- '.github/workflows/podman_login.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_login.yml'
- 'plugins/modules/podman_login.py'
- 'tests/integration/targets/podman_login/**'
branches:
- main
pull_request:
paths:
- '.github/workflows/podman_login.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_login.yml'
- 'plugins/modules/podman_login.py'
- 'tests/integration/targets/podman_login/**'
schedule:
- cron: 4 0 * * * # Run daily at 0:03 UTC
jobs:
test_podman_login:
uses: ./.github/workflows/reusable-module-test.yml
with:
module_name: 'podman_login'
display_name: 'Podman login'

32
.github/workflows/podman_login_info.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: Podman login info
on:
push:
paths:
- '.github/workflows/podman_login_info.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_login_info.yml'
- 'plugins/modules/podman_login_info.py'
- 'tests/integration/targets/podman_login_info/**'
branches:
- main
pull_request:
paths:
- '.github/workflows/podman_login_info.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_login_info.yml'
- 'plugins/modules/podman_login_info.py'
- 'tests/integration/targets/podman_login_info/**'
schedule:
- cron: 4 0 * * * # Run daily at 0:03 UTC
jobs:
test_podman_login_info:
uses: ./.github/workflows/reusable-module-test.yml
with:
module_name: 'podman_login_info'
display_name: 'Podman login info'

32
.github/workflows/podman_logout.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: Podman logout
on:
push:
paths:
- '.github/workflows/podman_logout.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_logout.yml'
- 'plugins/modules/podman_logout.py'
- 'tests/integration/targets/podman_logout/**'
branches:
- main
pull_request:
paths:
- '.github/workflows/podman_logout.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_logout.yml'
- 'plugins/modules/podman_logout.py'
- 'tests/integration/targets/podman_logout/**'
schedule:
- cron: 4 0 * * * # Run daily at 0:03 UTC
jobs:
test_podman_logout:
uses: ./.github/workflows/reusable-module-test.yml
with:
module_name: 'podman_logout'
display_name: 'Podman logout'

34
.github/workflows/podman_network.yml vendored Normal file
View File

@ -0,0 +1,34 @@
name: Podman network
on:
push:
paths:
- '.github/workflows/podman_network.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_network.yml'
- 'plugins/modules/podman_network.py'
- 'plugins/module_utils/podman/quadlet.py'
- 'tests/integration/targets/podman_network/**'
branches:
- main
pull_request:
paths:
- '.github/workflows/podman_network.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_network.yml'
- 'plugins/modules/podman_network.py'
- 'plugins/module_utils/podman/quadlet.py'
- 'tests/integration/targets/podman_network/**'
schedule:
- cron: 4 0 * * * # Run daily at 0:03 UTC
jobs:
test_podman_network:
uses: ./.github/workflows/reusable-module-test.yml
with:
module_name: 'podman_network'
display_name: 'Podman network'

View File

@ -4,103 +4,29 @@ on:
push: push:
paths: paths:
- '.github/workflows/podman_network_info.yml' - '.github/workflows/podman_network_info.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml' - 'ci/*.yml'
- 'ci/containers/podman_network_info.yml' - 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_network_info.yml'
- 'plugins/modules/podman_network_info.py' - 'plugins/modules/podman_network_info.py'
- 'tests/integration/targets/podman_network_info/**' - 'tests/integration/targets/podman_network_info/**'
branches: branches:
- master - main
pull_request: pull_request:
paths: paths:
- '.github/workflows/podman_network_info.yml' - '.github/workflows/podman_network_info.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml' - 'ci/*.yml'
- 'ci/containers/podman_network_info.yml' - 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_network_info.yml'
- 'plugins/modules/podman_network_info.py' - 'plugins/modules/podman_network_info.py'
- 'tests/integration/targets/podman_network_info/**' - 'tests/integration/targets/podman_network_info/**'
schedule: schedule:
- cron: 4 0 * * * # Run daily at 0:03 UTC - cron: 4 0 * * * # Run daily at 0:03 UTC
jobs: jobs:
test_podman_network_info: test_podman_network_info:
name: Podman network info ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-latest' }} uses: ./.github/workflows/reusable-module-test.yml
runs-on: ${{ matrix.os || 'ubuntu-latest' }} with:
defaults: module_name: 'podman_network_info'
run: display_name: 'Podman network info'
shell: bash
strategy:
fail-fast: false
matrix:
ansible-version:
- ansible<2.10
# - git+https://github.com/ansible/ansible.git@stable-2.10
os:
- ubuntu-latest
python-version:
- 3.7
include:
- os: ubuntu-20.04
ansible-version: git+https://github.com/ansible/ansible.git@devel
python-version: 3.7
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip and display Python and PIP versions
run: |
python -m pip install --upgrade pip
python -V
pip --version
- name: Set up pip cache
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install Ansible ${{ matrix.ansible-version }}
run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}'
- name: Build and install the collection tarball
run: |
rm -rf /tmp/just_new_collection
~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force
~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz
- name: Run collection tests for podman network info
run: |
export PATH=~/.local/bin:$PATH
echo "Run ansible version"
command -v ansible
ansible --version
if [[ '${{ matrix.ansible-version }}' == 'git+https://github.com/ansible/ansible.git@devel' ]]; then
export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg
elif [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then
export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg
fi
echo $ANSIBLE_CONFIG
command -v ansible-playbook
pip --version
python --version
ansible-playbook --version
ansible-playbook -vv ci/playbooks/pre.yml \
-e host=localhost \
-i localhost, \
-e ansible_connection=local \
-e setup_python=false
TEST2RUN=podman_network_info ./ci/run_containers_tests.sh
shell: bash

32
.github/workflows/podman_play.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: Podman play
on:
push:
paths:
- '.github/workflows/podman_play.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_play.yml'
- 'plugins/modules/podman_play.py'
- 'plugins/module_utils/podman/quadlet.py'
- 'tests/integration/targets/podman_play/**'
branches:
- main
pull_request:
paths:
- '.github/workflows/podman_play.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_play.yml'
- 'plugins/modules/podman_play.py'
- 'plugins/module_utils/podman/quadlet.py'
- 'tests/integration/targets/podman_play/**'
schedule:
- cron: 4 0 * * * # Run daily at 0:03 UTC
jobs:
test_podman_play:
uses: ./.github/workflows/reusable-module-test.yml
with:
module_name: 'podman_play'
display_name: 'Podman play'

View File

@ -5,17 +5,25 @@ on:
paths: paths:
- '.github/workflows/podman_pod.yml' - '.github/workflows/podman_pod.yml'
- 'ci/*.yml' - 'ci/*.yml'
- 'ci/containers/podman_pod.yml' - 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_pod.yml'
- 'plugins/module_utils/podman/podman_pod_lib.py'
- 'plugins/module_utils/podman/common.py'
- 'plugins/module_utils/podman/quadlet.py'
- 'plugins/modules/podman_pod.py' - 'plugins/modules/podman_pod.py'
- 'plugins/modules/podman_pod_info.py' - 'plugins/modules/podman_pod_info.py'
- 'tests/integration/targets/podman_pod/**' - 'tests/integration/targets/podman_pod/**'
branches: branches:
- master - main
pull_request: pull_request:
paths: paths:
- '.github/workflows/podman_pod.yml' - '.github/workflows/podman_pod.yml'
- 'ci/*.yml' - 'ci/*.yml'
- 'ci/containers/podman_pod.yml' - 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_pod.yml'
- 'plugins/module_utils/podman/podman_pod_lib.py'
- 'plugins/module_utils/podman/common.py'
- 'plugins/module_utils/podman/quadlet.py'
- 'plugins/modules/podman_pod.py' - 'plugins/modules/podman_pod.py'
- 'plugins/modules/podman_pod_info.py' - 'plugins/modules/podman_pod_info.py'
- 'tests/integration/targets/podman_pod/**' - 'tests/integration/targets/podman_pod/**'
@ -23,87 +31,8 @@ on:
- cron: 4 0 * * * # Run daily at 0:03 UTC - cron: 4 0 * * * # Run daily at 0:03 UTC
jobs: jobs:
test_podman_pod: test_podman_pod:
name: Podman pod ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-latest' }} uses: ./.github/workflows/reusable-module-test.yml
runs-on: ${{ matrix.os || 'ubuntu-latest' }} with:
defaults: module_name: 'podman_pod'
run: display_name: 'Podman pod'
shell: bash
strategy:
fail-fast: false
matrix:
ansible-version:
- ansible<2.10
#- git+https://github.com/ansible/ansible.git@stable-2.10
os:
- ubuntu-latest
python-version:
- 3.7
include:
- os: ubuntu-20.04
ansible-version: git+https://github.com/ansible/ansible.git@devel
python-version: 3.7
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip and display Python and PIP versions
run: |
python -m pip install --upgrade pip
python -V
pip --version
- name: Set up pip cache
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install Ansible ${{ matrix.ansible-version }}
run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}'
- name: Build and install the collection tarball
run: |
export PATH=~/.local/bin:$PATH
echo "Run ansible version"
command -v ansible
ansible --version
rm -rf /tmp/just_new_collection
~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force
~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz
- name: Run collection tests for podman pod
run: |
export PATH=~/.local/bin:$PATH
if [[ '${{ matrix.ansible-version }}' == 'git+https://github.com/ansible/ansible.git@devel' ]]; then
export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg
elif [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then
export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg
fi
echo $ANSIBLE_CONFIG
command -v ansible-playbook
pip --version
python --version
ansible-playbook --version
ansible-playbook -vv ci/playbooks/pre.yml \
-e host=localhost \
-i localhost, \
-e ansible_connection=local \
-e setup_python=false
TEST2RUN=podman_pod ./ci/run_containers_tests.sh
shell: bash

View File

@ -5,17 +5,21 @@ on:
paths: paths:
- '.github/workflows/podman_pod_info.yml' - '.github/workflows/podman_pod_info.yml'
- 'ci/*.yml' - 'ci/*.yml'
- 'ci/containers/podman_pod_info.yml' - 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_pod_info.yml'
- 'plugins/module_utils/podman/podman_pod_lib.py'
- 'plugins/modules/podman_pod.py' - 'plugins/modules/podman_pod.py'
- 'plugins/modules/podman_pod_info.py' - 'plugins/modules/podman_pod_info.py'
- 'tests/integration/targets/podman_pod_info/**' - 'tests/integration/targets/podman_pod_info/**'
branches: branches:
- master - main
pull_request: pull_request:
paths: paths:
- '.github/workflows/podman_pod_info.yml' - '.github/workflows/podman_pod_info.yml'
- 'ci/*.yml' - 'ci/*.yml'
- 'ci/containers/podman_pod_info.yml' - 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_pod_info.yml'
- 'plugins/module_utils/podman/podman_pod_lib.py'
- 'plugins/modules/podman_pod.py' - 'plugins/modules/podman_pod.py'
- 'plugins/modules/podman_pod_info.py' - 'plugins/modules/podman_pod_info.py'
- 'tests/integration/targets/podman_pod_info/**' - 'tests/integration/targets/podman_pod_info/**'
@ -23,87 +27,8 @@ on:
- cron: 4 0 * * * # Run daily at 0:03 UTC - cron: 4 0 * * * # Run daily at 0:03 UTC
jobs: jobs:
test_podman_pod_info: test_podman_pod_info:
name: Podman pod info ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-latest' }} uses: ./.github/workflows/reusable-module-test.yml
runs-on: ${{ matrix.os || 'ubuntu-latest' }} with:
defaults: module_name: 'podman_pod_info'
run: display_name: 'Podman pod info'
shell: bash
strategy:
fail-fast: false
matrix:
ansible-version:
- ansible<2.10
#- git+https://github.com/ansible/ansible.git@stable-2.10
os:
- ubuntu-latest
python-version:
- 3.7
include:
- os: ubuntu-20.04
ansible-version: git+https://github.com/ansible/ansible.git@devel
python-version: 3.7
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip and display Python and PIP versions
run: |
python -m pip install --upgrade pip
python -V
pip --version
- name: Set up pip cache
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install Ansible ${{ matrix.ansible-version }}
run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}'
- name: Build and install the collection tarball
run: |
export PATH=~/.local/bin:$PATH
echo "Run ansible version"
command -v ansible
ansible --version
rm -rf /tmp/just_new_collection
~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force
~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz
- name: Run collection tests for podman pod info
run: |
export PATH=~/.local/bin:$PATH
if [[ '${{ matrix.ansible-version }}' == 'git+https://github.com/ansible/ansible.git@devel' ]]; then
export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg
elif [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then
export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg
fi
echo $ANSIBLE_CONFIG
command -v ansible-playbook
pip --version
python --version
ansible-playbook --version
ansible-playbook -vv ci/playbooks/pre.yml \
-e host=localhost \
-i localhost, \
-e ansible_connection=local \
-e setup_python=false
TEST2RUN=podman_pod_info ./ci/run_containers_tests.sh
shell: bash

32
.github/workflows/podman_prune.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: Podman prune
on:
push:
paths:
- '.github/workflows/podman_prune.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_prune.yml'
- 'plugins/modules/podman_prune.py'
- 'tests/integration/targets/podman_prune/**'
branches:
- main
pull_request:
paths:
- '.github/workflows/podman_prune.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_prune.yml'
- 'plugins/modules/podman_prune.py'
- 'tests/integration/targets/podman_prune/**'
schedule:
- cron: 4 0 * * * # Run daily at 0:03 UTC
jobs:
test_podman_prune:
uses: ./.github/workflows/reusable-module-test.yml
with:
module_name: 'podman_prune'
display_name: 'Podman prune'

32
.github/workflows/podman_runlabel.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: Podman runlabel module
on:
push:
paths:
- '.github/workflows/podman_runlabel.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_runlabel.yml'
- 'plugins/modules/podman_runlabel.py'
- 'tests/integration/targets/podman_runlabel/**'
branches:
- main
pull_request:
paths:
- '.github/workflows/podman_runlabel.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_runlabel.yml'
- 'plugins/modules/podman_runlabel.py'
- 'tests/integration/targets/podman_runlabel/**'
schedule:
- cron: 4 0 * * * # Run daily at 0:03 UTC
jobs:
test_podman_runlabel:
uses: ./.github/workflows/reusable-module-test.yml
with:
module_name: 'podman_runlabel'
display_name: 'Podman runlabel module'

32
.github/workflows/podman_save.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: Podman save
on:
push:
paths:
- '.github/workflows/podman_save.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_save.yml'
- 'plugins/modules/podman_save.py'
- 'tests/integration/targets/podman_save/**'
branches:
- main
pull_request:
paths:
- '.github/workflows/podman_save.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_save.yml'
- 'plugins/modules/podman_save.py'
- 'tests/integration/targets/podman_save/**'
schedule:
- cron: 4 0 * * * # Run daily at 0:03 UTC
jobs:
test_podman_save:
uses: ./.github/workflows/reusable-module-test.yml
with:
module_name: 'podman_save'
display_name: 'Podman save'

32
.github/workflows/podman_search.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: Podman search
on:
push:
paths:
- '.github/workflows/podman_search.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_search.yml'
- 'plugins/modules/podman_search.py'
- 'tests/integration/targets/podman_search/**'
branches:
- main
pull_request:
paths:
- '.github/workflows/podman_search.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_search.yml'
- 'plugins/modules/podman_search.py'
- 'tests/integration/targets/podman_search/**'
schedule:
- cron: 4 0 * * * # Run daily at 0:03 UTC
jobs:
test_podman_search:
uses: ./.github/workflows/reusable-module-test.yml
with:
module_name: 'podman_search'
display_name: 'Podman search'

35
.github/workflows/podman_secret.yml vendored Normal file
View File

@ -0,0 +1,35 @@
name: Podman secret
on:
push:
paths:
- '.github/workflows/podman_secret.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_secret.yml'
- 'plugins/modules/podman_secret.py'
- 'plugins/modules/podman_container.py'
- 'plugins/module_utils/podman/podman_container_lib.py'
branches:
- main
pull_request:
paths:
- '.github/workflows/podman_secret.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_secret.yml'
- 'plugins/modules/podman_secret.py'
- 'plugins/modules/podman_container.py'
- 'plugins/module_utils/podman/podman_container_lib.py'
schedule:
- cron: 4 0 * * * # Run daily at 0:03 UTC
jobs:
test_podman_secret:
uses: ./.github/workflows/reusable-module-test.yml
with:
module_name: 'podman_secret'
display_name: 'Podman secret'

View File

@ -0,0 +1,32 @@
name: Podman secret info
on:
push:
paths:
- '.github/workflows/podman_secret_info.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_secret_info.yml'
- 'plugins/modules/podman_secret.py'
- 'plugins/modules/podman_secret_info.py'
branches:
- main
pull_request:
paths:
- '.github/workflows/podman_secret_info.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_secret_info.yml'
- 'plugins/modules/podman_secret.py'
- 'plugins/modules/podman_secret_info.py'
schedule:
- cron: 4 0 * * * # Run daily at 0:03 UTC
jobs:
test_podman_secret_info:
uses: ./.github/workflows/reusable-module-test.yml
with:
module_name: 'podman_secret_info'
display_name: 'Podman secret info'

View File

@ -0,0 +1,32 @@
name: Podman system connection
on:
push:
paths:
- '.github/workflows/podman_system_connection.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_system_connection.yml'
- 'plugins/modules/podman_system_connection.py'
- 'tests/integration/targets/podman_system_connection/**'
branches:
- main
pull_request:
paths:
- '.github/workflows/podman_system_connection.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_system_connection.yml'
- 'plugins/modules/podman_system_connection.py'
- 'tests/integration/targets/podman_system_connection/**'
schedule:
- cron: 4 0 * * * # Run daily at 0:03 UTC
jobs:
test_podman_system_connection:
uses: ./.github/workflows/reusable-module-test.yml
with:
module_name: 'podman_system_connection'
display_name: 'Podman system connection'

View File

@ -0,0 +1,32 @@
name: Podman system connection info
on:
push:
paths:
- '.github/workflows/podman_system_connection_info.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_system_connection_info.yml'
- 'plugins/modules/podman_system_connection_info.py'
- 'tests/integration/targets/podman_system_connection_info/**'
branches:
- main
pull_request:
paths:
- '.github/workflows/podman_system_connection_info.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_system_connection_info.yml'
- 'plugins/modules/podman_system_connection_info.py'
- 'tests/integration/targets/podman_system_connection_info/**'
schedule:
- cron: 4 0 * * * # Run daily at 0:03 UTC
jobs:
test_podman_system_connection_info:
uses: ./.github/workflows/reusable-module-test.yml
with:
module_name: 'podman_system_connection_info'
display_name: 'Podman system connection info'

View File

@ -0,0 +1,30 @@
name: Podman system info
on:
push:
paths:
- '.github/workflows/podman_system_info.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_system_info.yml'
- 'plugins/modules/podman_system_info.py'
- 'tests/integration/targets/podman_system_info/**'
branches:
- main
pull_request:
paths:
- '.github/workflows/podman_system_info.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_system_info.yml'
- 'plugins/modules/podman_system_info.py'
- 'tests/integration/targets/podman_system_info/**'
schedule:
- cron: 4 0 * * * # Run daily at 0:03 UTC
jobs:
test_podman_system_info:
uses: ./.github/workflows/reusable-module-test.yml
with:
module_name: 'podman_system_info'
display_name: 'Podman system info'

32
.github/workflows/podman_tag.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: Podman tag
on:
push:
paths:
- '.github/workflows/podman_tag.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_tag.yml'
- 'plugins/modules/podman_tag.py'
- 'tests/integration/targets/podman_tag/**'
branches:
- main
pull_request:
paths:
- '.github/workflows/podman_tag.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_tag.yml'
- 'plugins/modules/podman_tag.py'
- 'tests/integration/targets/podman_tag/**'
schedule:
- cron: 4 0 * * * # Run daily at 0:03 UTC
jobs:
test_podman_tag:
uses: ./.github/workflows/reusable-module-test.yml
with:
module_name: 'podman_tag'
display_name: 'Podman tag'

34
.github/workflows/podman_volume.yml vendored Normal file
View File

@ -0,0 +1,34 @@
name: Podman volume
on:
push:
paths:
- '.github/workflows/podman_volume.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_volume.yml'
- 'plugins/modules/podman_volume.py'
- 'plugins/module_utils/podman/quadlet.py'
- 'tests/integration/targets/podman_volume/**'
branches:
- main
pull_request:
paths:
- '.github/workflows/podman_volume.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml'
- 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_volume.yml'
- 'plugins/modules/podman_volume.py'
- 'plugins/module_utils/podman/quadlet.py'
- 'tests/integration/targets/podman_volume/**'
schedule:
- cron: 4 0 * * * # Run daily at 0:03 UTC
jobs:
test_podman_volume:
uses: ./.github/workflows/reusable-module-test.yml
with:
module_name: 'podman_volume'
display_name: 'Podman volume'

View File

@ -4,103 +4,31 @@ on:
push: push:
paths: paths:
- '.github/workflows/podman_volume_info.yml' - '.github/workflows/podman_volume_info.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml' - 'ci/*.yml'
- 'ci/containers/podman_volume_info.yml' - 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_volume_info.yml'
- 'plugins/modules/podman_volume_info.py' - 'plugins/modules/podman_volume_info.py'
- 'plugins/modules/podman_volume.py'
- 'tests/integration/targets/podman_volume_info/**' - 'tests/integration/targets/podman_volume_info/**'
branches: branches:
- master - main
pull_request: pull_request:
paths: paths:
- '.github/workflows/podman_volume_info.yml' - '.github/workflows/podman_volume_info.yml'
- '.github/workflows/reusable-module-test.yml'
- 'ci/*.yml' - 'ci/*.yml'
- 'ci/containers/podman_volume_info.yml' - 'ci/run_containers_tests.sh'
- 'ci/playbooks/containers/podman_volume_info.yml'
- 'plugins/modules/podman_volume_info.py' - 'plugins/modules/podman_volume_info.py'
- 'plugins/modules/podman_volume.py'
- 'tests/integration/targets/podman_volume_info/**' - 'tests/integration/targets/podman_volume_info/**'
schedule: schedule:
- cron: 4 0 * * * # Run daily at 0:03 UTC - cron: 4 0 * * * # Run daily at 0:03 UTC
jobs: jobs:
test_podman_volume_info: test_podman_volume_info:
name: Podman volume info ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-latest' }} uses: ./.github/workflows/reusable-module-test.yml
runs-on: ${{ matrix.os || 'ubuntu-latest' }} with:
defaults: module_name: 'podman_volume_info'
run: display_name: 'Podman volume info'
shell: bash
strategy:
fail-fast: false
matrix:
ansible-version:
- ansible<2.10
# - git+https://github.com/ansible/ansible.git@stable-2.10
os:
- ubuntu-latest
python-version:
- 3.7
include:
- os: ubuntu-20.04
ansible-version: git+https://github.com/ansible/ansible.git@devel
python-version: 3.7
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip and display Python and PIP versions
run: |
python -m pip install --upgrade pip
python -V
pip --version
- name: Set up pip cache
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install Ansible ${{ matrix.ansible-version }}
run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}'
- name: Build and install the collection tarball
run: |
rm -rf /tmp/just_new_collection
~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force
~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz
- name: Run collection tests for podman volume info
run: |
export PATH=~/.local/bin:$PATH
echo "Run ansible version"
command -v ansible
ansible --version
if [[ '${{ matrix.ansible-version }}' == 'git+https://github.com/ansible/ansible.git@devel' ]]; then
export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg
elif [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then
export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg
fi
echo $ANSIBLE_CONFIG
command -v ansible-playbook
pip --version
python --version
ansible-playbook --version
ansible-playbook -vv ci/playbooks/pre.yml \
-e host=localhost \
-i localhost, \
-e ansible_connection=local \
-e setup_python=false
TEST2RUN=podman_volume_info ./ci/run_containers_tests.sh
shell: bash

View File

@ -0,0 +1,118 @@
name: Reusable Module Test
on:
workflow_call:
inputs:
module_name:
description: 'The name of the Podman module to test (e.g., podman_export)'
required: true
type: string
display_name:
description: 'Display name for the module (e.g., Podman export)'
required: false
type: string
default: ''
python_version:
description: 'Python version to use for testing'
required: false
type: string
default: '3.12'
os_matrix:
description: 'OS matrix as JSON string'
required: false
type: string
default: '["ubuntu-22.04"]'
ansible_versions:
description: 'Ansible versions matrix as JSON string'
required: false
type: string
default: '["git+https://github.com/ansible/ansible.git@stable-2.18", "git+https://github.com/ansible/ansible.git@devel"]'
extra_collections:
description: 'Space-separated list of extra Ansible collections to install before running tests (e.g., "ansible.posix community.general")'
required: false
type: string
default: ''
jobs:
test_module:
name: ${{ inputs.display_name || inputs.module_name }} ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }}
runs-on: ${{ matrix.os || 'ubuntu-22.04' }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
ansible-version: ${{ fromJSON(inputs.ansible_versions) }}
os: ${{ fromJSON(inputs.os_matrix) }}
python-version:
- ${{ inputs.python_version }}
steps:
- name: Check out repository
uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip and display Python and PIP versions
run: |
sudo apt-get update
sudo apt-get install -y python*-wheel python*-yaml
python -m pip install --upgrade pip
python -V
pip --version
- name: Set up pip cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install Ansible ${{ matrix.ansible-version }}
run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}'
- name: Build and install the collection tarball
run: |
rm -rf /tmp/just_new_collection
~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force
~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz
- name: Install extra Ansible collections (optional)
if: ${{ inputs.extra_collections != '' }}
run: |
echo "Installing extra collections: ${{ inputs.extra_collections }}"
~/.local/bin/ansible-galaxy collection install -vvv --force ${{ inputs.extra_collections }}
- name: Run collection tests for ${{ inputs.module_name }}
run: |
export PATH=~/.local/bin:$PATH
echo "Run ansible version"
command -v ansible
ansible --version
export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg
if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then
export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg
fi
echo $ANSIBLE_CONFIG
command -v ansible-playbook
pip --version
python --version
ansible-playbook --version
ansible-playbook -vv ci/playbooks/pre.yml \
-e host=localhost \
-i localhost, \
-e ansible_connection=local \
-e setup_python=false
TEST2RUN=${{ inputs.module_name }} ./ci/run_containers_tests.sh
shell: bash

View File

@ -0,0 +1,358 @@
name: Test inventory and example playbooks
on:
pull_request:
paths:
- '.github/workflows/test-inventory-examples.yml'
- 'plugins/inventory/podman_containers.py'
- 'plugins/inventory/buildah_containers.py'
- 'tests/unit/plugins/inventory/*.py'
push:
paths:
- '.github/workflows/test-inventory-examples.yml'
- 'plugins/inventory/podman_containers.py'
- 'plugins/inventory/buildah_containers.py'
- 'tests/unit/plugins/inventory/*.py'
branches: [ main ]
schedule:
- cron: 4 0 * * * # Run daily at 0:03 UTC
jobs:
inventory_test:
name: Functional inventory tests
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Ansible 2.18
run: python3 -m pip install --user --force-reinstall --upgrade ansible-core==2.18
- name: Build and install the collection tarball
run: |
rm -rf /tmp/just_new_collection
~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force
~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz
- name: Install system deps (podman, buildah)
run: |
sudo apt-get update
sudo apt-get install -y podman buildah jq
podman --version
buildah --version
- name: Configure rootless storage
run: |
mkdir -p ~/.config/containers
printf '[storage]\ndriver = "overlay"\n' > ~/.config/containers/storage.conf
printf '[engine]\ncgroup_manager = "cgroupfs"\nevents_logger = "file"\n' > ~/.config/containers/engine.conf
- name: Install Ansible
run: |
python -m pip install --upgrade pip
python -m pip install ansible-core
ansible --version
- name: Build basic containers for discovery
run: |
podman pull alpine:latest
podman run -d --name podman-inventory-test alpine:latest sleep 3600
podman run -d --name podman-inventory-test2 --label role=api --label env=dev alpine:latest sleep 3600
podman run -d --name podman-stopped-test alpine:latest sleep 3600 && podman stop podman-stopped-test
buildah from --name hello-buildah alpine:latest
echo 'Podman ps output:'
podman ps -a --format json | jq '.'
echo 'Buildah containers output:'
buildah containers -a --json | jq '.'
- name: Write podman inventory source
run: |
mkdir -p ci/tmpinv
cat > ci/tmpinv/podman.yml <<'EOF'
plugin: containers.podman.podman_containers
include_stopped: false
connection_plugin: containers.podman.podman
EOF
- name: Write buildah inventory source
run: |
cat > ci/tmpinv/buildah.yml <<'EOF'
plugin: containers.podman.buildah_containers
connection_plugin: containers.podman.buildah
EOF
- name: Sanity check podman inventory
run: |
out=$(ANSIBLE_INVENTORY_ENABLED=containers.podman.podman_containers,yaml,ini ansible-inventory -i ci/tmpinv/podman.yml --list)
echo "$out" | jq '.'
echo "$out" | jq -e '. | to_entries | any(.value.hosts != null and (.value.hosts | length) > 0)'
- name: Test podman inventory - empty selection with name_patterns
run: |
cat > ci/tmpinv/podman_empty.yml <<'EOF'
plugin: containers.podman.podman_containers
name_patterns: ['no-such-*']
EOF
out=$(ANSIBLE_INVENTORY_ENABLED=containers.podman.podman_containers,yaml,ini ansible-inventory -i ci/tmpinv/podman_empty.yml --list)
echo "$out" | jq '.'
# Expect no groups with hosts
test $(echo "$out" | jq '[ . | to_entries[] | select(.value.hosts != null and (.value.hosts | length) > 0) ] | length') -eq 0
- name: Test podman include_stopped false excludes stopped
run: |
cat > ci/tmpinv/podman_running.yml <<'EOF'
plugin: containers.podman.podman_containers
include_stopped: false
EOF
out=$(ANSIBLE_INVENTORY_ENABLED=containers.podman.podman_containers,yaml,ini ansible-inventory -i ci/tmpinv/podman_running.yml --list)
echo "$out" | jq '.'
# Stopped host must not be present in hostvars
echo "$out" | jq -e '._meta.hostvars | has("podman-stopped-test") | not'
- name: Test podman include_stopped true includes stopped
run: |
cat > ci/tmpinv/podman_all.yml <<'EOF'
plugin: containers.podman.podman_containers
include_stopped: true
EOF
out=$(ANSIBLE_INVENTORY_ENABLED=containers.podman.podman_containers,yaml,ini ansible-inventory -i ci/tmpinv/podman_all.yml --list)
echo "$out" | jq '.'
# Stopped host must be present in hostvars
echo "$out" | jq -e '._meta.hostvars | has("podman-stopped-test")'
- name: Test label_selectors and group_by_image/label
run: |
cat > ci/tmpinv/podman_labels.yml <<'EOF'
plugin: containers.podman.podman_containers
label_selectors:
role: api
group_by_image: true
group_by_label: ['env']
EOF
out=$(ANSIBLE_INVENTORY_ENABLED=containers.podman.podman_containers,yaml,ini ansible-inventory -i ci/tmpinv/podman_labels.yml --list)
echo "$out" | jq '.'
# Only labeled host present
echo "$out" | jq -e '._meta.hostvars | has("podman-inventory-test2")'
echo "$out" | jq -e '._meta.hostvars | has("podman-inventory-test") | not'
# Image group exists
echo "$out" | jq -e '."image_docker.io_library_alpine_latest".hosts | index("podman-inventory-test2") != null'
# Label group exists
echo "$out" | jq -e '."label_env_dev".hosts | index("podman-inventory-test2") != null'
- name: Test verbose_output and filters include/exclude
run: |
cat > ci/tmpinv/podman_filters.yml <<'EOF'
plugin: containers.podman.podman_containers
include_stopped: true
verbose_output: true
filters:
exclude:
status: 'Exited*'
EOF
out=$(ANSIBLE_INVENTORY_ENABLED=containers.podman.podman_containers,yaml,ini ansible-inventory -i ci/tmpinv/podman_filters.yml --list)
echo "$out" | jq '.'
# Exited (stopped) should be excluded
echo "$out" | jq -e '._meta.hostvars | has("podman-stopped-test") | not'
# podman_ps should exist for a running host
echo "$out" | jq -e '._meta.hostvars["podman-inventory-test"] | has("podman_ps")'
- name: Test keyed_groups with prefix/separator/default and parent_group
run: |
cat > ci/tmpinv/podman_keyed.yml <<'EOF'
plugin: containers.podman.podman_containers
keyed_groups:
- key: labels.role
prefix: k
separator: '-'
parent_group: keyed
- key: labels.missing
prefix: missing
default_value: unknown
leading_separator: false
trailing_separator: false
EOF
out=$(ANSIBLE_INVENTORY_ENABLED=containers.podman.podman_containers,yaml,ini ansible-inventory -i ci/tmpinv/podman_keyed.yml --list)
echo "$out" | jq '.'
# Group from labels.role
echo "$out" | jq -e '."k_api".hosts | index("podman-inventory-test2") != null'
# Parent group exists and contains subgroup
echo "$out" | jq -e '((.keyed.children | type) == "array" and (.keyed.children | index("k_api") != null)) or ((.keyed.children | type) == "object" and (.keyed.children | has("k_api")))'
# Default value group for missing key exists for at least one host
test $(echo "$out" | jq 'to_entries | map(select(.key | startswith("missing"))) | length') -ge 1
- name: Verbose logs - podman inventory (-vvvv) name_patterns and label_selectors
run: |
# Create an inventory that will: match only podman-inventory-test (not test2) by name_patterns,
# then filter it out by label_selectors; the unmatched one will be filtered by name_patterns.
cat > ci/tmpinv/podman_verbose.yml <<'EOF'
plugin: containers.podman.podman_containers
include_stopped: true
name_patterns: ['podman-inventory-test']
label_selectors:
role: api
EOF
set -o pipefail
ANSIBLE_INVENTORY_ENABLED=containers.podman.podman_containers,yaml,ini \
ansible-inventory -i ci/tmpinv/podman_verbose.yml --list -vvvv 1>/tmp/podman_verbose.out 2>/tmp/podman_verbose.err || true
echo "podman_verbose.err:"
cat /tmp/podman_verbose.err
echo "podman_verbose.out:"
cat /tmp/podman_verbose.out
# Expect messages from plugin
grep -q "Filtered out podman-inventory-test2 by name_patterns option" /tmp/podman_verbose.out
grep -q "Filtered out podman-inventory-test by label_selectors option" /tmp/podman_verbose.out
- name: Verbose logs - podman inventory (-vvvv) filters include path
run: |
# Match only the labeled container and then filter it via filters.include
cat > ci/tmpinv/podman_verbose_filters.yml <<'EOF'
plugin: containers.podman.podman_containers
include_stopped: true
name_patterns: ['podman-inventory-test2']
filters:
include:
status: 'Exited*'
EOF
set -o pipefail
ANSIBLE_INVENTORY_ENABLED=containers.podman.podman_containers,yaml,ini \
ansible-inventory -i ci/tmpinv/podman_verbose_filters.yml --list -vvvv 1>/tmp/podman_verbose2.out 2>/tmp/podman_verbose2.err || true
echo "podman_verbose2.err:"
cat /tmp/podman_verbose2.err
echo "podman_verbose2.out:"
cat /tmp/podman_verbose2.out
grep -q "Filtered out podman-inventory-test2 by filters option" /tmp/podman_verbose2.out
- name: Test strict=true fails on missing keyed key
run: |
set +e
cat > ci/tmpinv/podman_strict.yml <<'EOF'
plugin: containers.podman.podman_containers
strict: true
keyed_groups:
- key: labels.nonexistent
EOF
ANSIBLE_INVENTORY_ENABLED=containers.podman.podman_containers,yaml,ini ansible-inventory -i ci/tmpinv/podman_strict.yml --list >/tmp/out.json 2>/tmp/err.log
rc=$?
echo "RC=$rc"; cat /tmp/err.log || true
# Some ansible-core versions still exit 0 after parser fallbacks; assert on error message instead
grep -q "Missing keyed_groups key 'labels.nonexistent'" /tmp/err.log
- name: Sanity check buildah inventory
run: |
out=$(ANSIBLE_INVENTORY_ENABLED=containers.podman.buildah_containers,yaml,ini ansible-inventory -i ci/tmpinv/buildah.yml --list)
echo "$out" | jq '.'
echo "$out" | jq -e '. | to_entries | any(.value.hosts != null and (.value.hosts | length) > 0)'
- name: Verbose logs - buildah inventory (-vvvv) name_patterns filter path
run: |
cat > ci/tmpinv/buildah_verbose.yml <<'EOF'
plugin: containers.podman.buildah_containers
name_patterns: ['no-such-*']
EOF
set -o pipefail
ANSIBLE_INVENTORY_ENABLED=containers.podman.buildah_containers,yaml,ini \
ansible-inventory -i ci/tmpinv/buildah_verbose.yml --list -vvvv 1>/tmp/buildah_verbose.out 2>/tmp/buildah_verbose.err || true
echo "buildah_verbose.err:"
cat /tmp/buildah_verbose.err
echo "buildah_verbose.out:"
cat /tmp/buildah_verbose.out
grep -q "Filtered out hello-buildah by name_patterns option" /tmp/buildah_verbose.out
- name: Test buildah inventory - empty selection with name_patterns
run: |
cat > ci/tmpinv/buildah_empty.yml <<'EOF'
plugin: containers.podman.buildah_containers
name_patterns: ['no-such-*']
EOF
out=$(ANSIBLE_INVENTORY_ENABLED=containers.podman.buildah_containers,yaml,ini ansible-inventory -i ci/tmpinv/buildah_empty.yml --list)
echo "$out" | jq '.'
# Expect no groups with hosts
test $(echo "$out" | jq '[ . | to_entries[] | select(.value.hosts != null and (.value.hosts | length) > 0) ] | length') -eq 0
- name: Test buildah inventory - match by name_patterns and host vars
run: |
cat > ci/tmpinv/buildah_match.yml <<'EOF'
plugin: containers.podman.buildah_containers
name_patterns: ['hello-buildah']
connection_plugin: containers.podman.buildah
EOF
out=$(ANSIBLE_INVENTORY_ENABLED=containers.podman.buildah_containers,yaml,ini ansible-inventory -i ci/tmpinv/buildah_match.yml --list)
echo "$out" | jq '.'
# Host should be present in at least one group's hosts list
echo "$out" | jq -e '. | to_entries | any(.value.hosts? and (.value.hosts | index("hello-buildah") != null))'
# Hostvars should include connection and ids
echo "$out" | jq -e '._meta.hostvars["hello-buildah"].ansible_connection == "containers.podman.buildah"'
echo "$out" | jq -e '._meta.hostvars["hello-buildah"] | has("buildah_container_id")'
echo "$out" | jq -e '._meta.hostvars["hello-buildah"] | has("buildah_container_name")'
unittests:
name: Unit tests inventory
runs-on: ${{ matrix.runner-os }}
strategy:
matrix:
runner-os:
- ubuntu-24.04
# ansible-version:
# - git+https://github.com/ansible/ansible.git@stable-2.15
runner-python-version:
- '3.11'
steps:
- name: Check out ${{ github.repository }} on disk
uses: actions/checkout@v5
- name: Set up Python ${{ matrix.runner-python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.runner-python-version }}
- name: Set up pip cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('tests/sanity/requirements.txt') }}-${{ hashFiles('tests/unit/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install requirements for tests
run: >-
python -m pip install --user -r test-requirements.txt
- name: Build a collection tarball
run: >-
~/.local/bin/ansible-galaxy collection build --output-path
"${GITHUB_WORKSPACE}/.cache/collection-tarballs"
- name: Install the collection tarball
run: >-
~/.local/bin/ansible-galaxy collection install ${GITHUB_WORKSPACE}/.cache/collection-tarballs/*.tar.gz
- name: Run collection unit tests (with coverage)
run: >-
~/.local/bin/ansible-test units
--python "${{ matrix.runner-python-version }}" --coverage -vvv
tests/unit/plugins/inventory/
working-directory: >-
/home/runner/.ansible/collections/ansible_collections/containers/podman
- name: Generate coverage reports (xml, html)
run: |
~/.local/bin/ansible-test coverage xml
~/.local/bin/ansible-test coverage html
working-directory: >-
/home/runner/.ansible/collections/ansible_collections/containers/podman
- name: Upload coverage artifact (ansible-test outputs)
uses: actions/upload-artifact@v4
with:
name: inventory-coverage
path: |
/home/runner/.ansible/collections/ansible_collections/containers/podman/tests/output/coverage/**

59
.github/workflows/unittests.yml vendored Normal file
View File

@ -0,0 +1,59 @@
name: Unittests
on:
push:
pull_request:
schedule:
- cron: 3 0 * * * # Run daily at 0:03 UTC
jobs:
build-collection-artifact:
name: Test
runs-on: ${{ matrix.runner-os }}
strategy:
matrix:
runner-os:
- ubuntu-22.04
# ansible-version:
# - git+https://github.com/ansible/ansible.git@stable-2.15
runner-python-version:
- '3.11'
steps:
- name: Check out ${{ github.repository }} on disk
uses: actions/checkout@v5
- name: Set up Python ${{ matrix.runner-python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.runner-python-version }}
- name: Set up pip cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('tests/sanity/requirements.txt') }}-${{ hashFiles('tests/unit/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install requirements for tests
run: >-
python -m pip install --user -r test-requirements.txt
- name: Build a collection tarball
run: >-
~/.local/bin/ansible-galaxy collection build --output-path
"${GITHUB_WORKSPACE}/.cache/collection-tarballs"
- name: Install the collection tarball
run: >-
~/.local/bin/ansible-galaxy collection install ${GITHUB_WORKSPACE}/.cache/collection-tarballs/*.tar.gz
- name: Run collection unit tests
run: >-
~/.local/bin/ansible-test units
--python "${{ matrix.runner-python-version }}" -vvv
tests/unit/plugins/modules/
working-directory: >-
/home/runner/.ansible/collections/ansible_collections/containers/podman

4
.gitignore vendored
View File

@ -209,7 +209,6 @@ MANIFEST
# Usually these files are written by a python script from a template # Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it. # before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest *.manifest
*.spec
# Installer logs # Installer logs
pip-log.txt pip-log.txt
@ -384,4 +383,7 @@ $RECYCLE.BIN/
# Windows shortcuts # Windows shortcuts
*.lnk *.lnk
# Custom
changelogs/.plugin-cache.yaml
# End of https://www.gitignore.io/api/git,linux,pydev,python,windows,pycharm+all,jupyternotebook,vim,webstorm,emacs,dotenv # End of https://www.gitignore.io/api/git,linux,pydev,python,windows,pycharm+all,jupyternotebook,vim,webstorm,emacs,dotenv
ansible-collection-containers-podman-build.spec

1231
CHANGELOG.rst Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,3 @@
## The Podman Ansible Collections Project Community Code of Conduct ## The Podman Ansible Collections Project Community Code of Conduct
The Podman Ansible Collections project follows the [Containers Community Code of Conduct](https://github.com/containers/common/blob/master/CODE-OF-CONDUCT.md). The Podman Ansible Collections project follows the [Containers Community Code of Conduct](https://github.com/containers/common/blob/main/CODE-OF-CONDUCT.md).

197
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,197 @@
# Contributing to the Podman Ansible Collection
First off, thank you for considering contributing to this collection! We welcome any help, from reporting a bug to submitting a new feature. Every contribution is valuable.
This document provides guidelines to help you get started. Please read it carefully to ensure a smooth and effective contribution process.
## Code of Conduct
All contributors are expected to follow our [Code of Conduct](CODE-OF-CONDUCT.md). Please make sure you are familiar with its contents.
## How to Contribute
You can contribute in several ways:
* **Reporting Bugs:** If you find a bug, please [open an issue](https://github.com/containers/ansible-podman-collections/issues/new?assignees=&labels=bug&projects=&template=bug_report.yml) and provide as much detail as possible, including your Podman version, Ansible version, the playbook you are using, and the full error output.
* **Suggesting Enhancements:** If you have an idea for a new feature or an improvement to an existing one, please [open a feature request](https://github.com/containers/ansible-podman-collections/issues/new?assignees=&labels=enhancement&projects=&template=feature_request.yml).
* **Submitting Pull Requests:** If you want to fix a bug or add a feature yourself, please follow the guidelines below.
## Development Setup
1. **Fork and Clone:** Fork the repository on GitHub and clone your fork locally.
```bash
git clone https://github.com/YOUR-USERNAME/ansible-podman-collections.git
cd ansible-podman-collections
```
2. **Set up a Virtual Environment:** It's highly recommended to work in a Python virtual environment.
```bash
python3 -m venv venv
source venv/bin/activate
```
3. **Install Dependencies:** The collection's testing dependencies are listed in `test-requirements.txt`.
```bash
pip install -r test-requirements.txt
```
## Guidelines for Pull Requests
### General Workflow
1. Create a new branch for your changes: `git checkout -b my-feature-or-fix`.
2. Make your changes. Follow the coding and testing guidelines below.
3. Commit your changes with a clear and descriptive message. See existing commit messages for style (`git log --oneline`).
4. Push your branch to your fork: `git push origin my-feature-or-fix`.
5. Open a pull request against the `main` branch of the original repository.
### Fixing a Bug
1. If an issue for the bug doesn't already exist, please create one.
2. Ideally, add an integration test case to `tests/integration/targets/` that reproduces the bug and fails before your fix.
3. Implement the code change that fixes the bug.
4. Run the tests to ensure your fix works and doesn't break anything else.
5. In your PR description, use the "Fixes #123" syntax to link it to the issue.
### Adding a New Module
We have a script to help you scaffold a new module.
1. **Define Module Variables:** Copy `contrib/my_module_template_vars.yaml` and customize it with your new module's details (name, author, options, etc.).
2. **Generate the Module:** Run the `contrib/generate_module.sh` script. This will create a new module file in the `contrib` directory.
3. **Place the Module:** Move the generated file into `plugins/modules/`.
4. **Add Logic:** Implement the core logic for your module. If you need to share code with other modules, consider adding it to `plugins/module_utils/`.
5. **Document:** Ensure the `DOCUMENTATION`, `EXAMPLES`, and `RETURN` sections are thorough and accurate. This is critical for users.
6. **Add Tests:** Create a new integration test role and a new CI workflow for your module (see below).
## Testing Strategy
This collection uses three types of tests. All tests must pass before a PR can be merged.
### 1. Sanity Tests
These tests check for code style, syntax errors, and other common issues. Sanity tests must pass in pull requests in opder to merge.
* **How to Run:**
```bash
bash contrib/ansible-lint.sh
```
* **Guidelines:**
* This will install collection in `/tmp` directory and run `ansible-test` sanity in docker.
* The maximum line length is 120 characters.
### 2. Unit Tests
Unit tests are for testing specific functions in isolation, often by mocking external dependencies. This is an area we are actively working to improve.
* **Location:** `tests/unit/plugins/modules/`
* **How to Run:**
```bash
bash contrib/ansible-unit.sh
```
* **Guidelines:**
* This will install collection in `/tmp` directory and run `ansible-test` unit tests.
### 3. Integration Tests
These are the most important tests in the collection. They run Ansible playbooks to test modules against a live Podman instance.
* **Location:** `tests/integration/targets/`
* **Structure:** Each subdirectory in `targets` is an Ansible role that tests a specific module or feature. The main logic is in `tasks/main.yml`.
* **Adding a New Integration Test:**
1. Create a new directory (role) for your module: `tests/integration/targets/my_new_module/tasks`.
2. Create a `main.yml` file inside that directory.
3. Write Ansible tasks that execute your module and verify its behavior. Use the `assert` or `fail` modules to check for expected outcomes.
```yaml
- name: Run my_new_module
my_new_module:
name: test_container
state: present
register: result
- name: Assert that the container was created
assert:
that:
- result.changed
- result.container.State.Status == "running"
```
* **Running Locally:** You can run a specific test role using `ansible-playbook`. This requires a working Podman installation.
* Create a testing playbook with your tests like:
```yaml
- hosts: all
gather_facts: false
tasks:
- include_tasks: tests/integration/targets/my_new_module/tasks/main.yml
```
Install the collection version you develop with:
```bash
ansible-galaxy collection install -vvv --force .
```
and then run the playbook it with:
```bash
ansible-playbook -vv -i localhost, my_playbook.yml
```
## Continuous Integration (CI)
We use GitHub Actions to run all our tests automatically.
### Adding a CI Job for a New Module
To ensure your new module is tested on every PR, you must add a new workflow file. We use a reusable workflow to make this easy.
1. Go to the `.github/workflows/` directory.
2. Create a new file named after your module, e.g., `podman_my_new_module.yml`.
3. Copy the content from an existing module workflow, like `podman_export.yml`, and adapt it. You only need to change a few lines:
```yaml
name: Podman my_new_module
on:
push:
paths:
- 'plugins/modules/podman_my_new_module.py'
- 'tests/integration/targets/podman_my_new_module/**'
pull_request:
paths:
- 'plugins/modules/podman_my_new_module.py'
- 'tests/integration/targets/podman_my_new_module/**'
jobs:
test:
uses: ./.github/workflows/reusable-module-test.yml
with:
module_name: podman_my_new_module # The name of your test role
display_name: "Podman my_new_module" # A friendly name for the job
```
4. Commit this new workflow file along with your module and test code.
## Final Checklist for Pull Requests
Before you submit your PR, please make sure you have:
* [ ] Read this `CONTRIBUTING.md` guide.
* [ ] Added or updated tests for your changes.
* [ ] Run `ansible-test sanity` and fixed any issues.
* [ ] Ensured all CI checks are passing on your PR.
* [ ] Updated the `DOCUMENTATION` block in the module if you changed any parameters.
Thank you for your contribution!

15
Makefile Normal file
View File

@ -0,0 +1,15 @@
PKG_NAME=ansible-podman-collections
TMPINSTALLDIR=/tmp/$(PKG_NAME)-fpm-install
VERSION ?= $(shell python3 setup.py --version 2>/dev/null | sed "s/\([0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/g")
rpm:
rm -rf $(TMPINSTALLDIR)
mkdir -p ~/rpmbuild/SOURCES/
mkdir -p $(TMPINSTALLDIR)/$(PKG_NAME)-$(VERSION)
cp -r * $(TMPINSTALLDIR)/$(PKG_NAME)-$(VERSION)/
tar -zcvf ~/rpmbuild/SOURCES/$(VERSION).tar.gz -C $(TMPINSTALLDIR) $(PKG_NAME)-$(VERSION)
cp ansible-collection-containers-podman.spec ansible-collection-containers-podman-build.spec
sed -i "s/Version:.*/Version: $(VERSION)/g" ansible-collection-containers-podman-build.spec
sed -i "s/Release:.*/Release: 999%{?dist}/g" ansible-collection-containers-podman-build.spec
sed -i "s/^version: .*/version: $(VERSION)/" $(TMPINSTALLDIR)/$(PKG_NAME)-$(VERSION)/galaxy.yml
rpmbuild -bb ansible-collection-containers-podman-build.spec

160
README.md
View File

@ -1,105 +1,117 @@
[![GitHub Actions CI/CD build status — Collection test suite](https://github.com/containers/ansible-podman-collections/workflows/Collection%20build%20and%20tests/badge.svg?branch=master)](https://github.com/containers/ansible-podman-collections/actions?query=workflow%3A%22Collection%20build%20and%20tests) <!-- omit in toc -->
# Ansible Collection: containers.podman # Ansible Collection: containers.podman
This repo hosts the `containers.podman` Ansible Collection. [![CI/CD Status](https://img.shields.io/github/actions/workflow/status/containers/ansible-podman-collections/.github/workflows/collection-continuous-integration.yml?branch=main&style=for-the-badge&label=CI%2FCD)](https://github.com/containers/ansible-podman-collections/actions/workflows/collection-continuous-integration.yml)
[![Ansible Galaxy](https://img.shields.io/ansible/collection/d/containers/podman?style=for-the-badge&label=Ansible%20Galaxy)](https://galaxy.ansible.com/containers/podman)
[![License](https://img.shields.io/github/license/containers/ansible-podman-collections?style=for-the-badge)](COPYING)
The collection includes the Podman container plugins to help the build and management of Podman containers. **Manage the full lifecycle of Podman containers, images, pods, networks, and volumes with Ansible.**
## Installation and Usage This collection provides a suite of powerful and flexible Ansible modules to automate the management of your [Podman](https://podman.io/) environment. Whether you are running a single container or orchestrating complex, multi-container applications, these modules give you the tools to do it idempotently and efficiently.
### Installing the Collection from Ansible Galaxy ---
Before using the Podman collection, you need to install the collection with the `ansible-galaxy` CLI: ### **Table of Contents**
`ansible-galaxy collection install containers.podman` - [Key Features](#key-features)
- [Requirements](#requirements)
- [Installation](#installation)
- [Getting Started: A Simple Example](#getting-started-a-simple-example)
- [Available Content](#available-content)
- [Documentation](#documentation)
- [Contributing](#contributing)
- [License](#license)
You can also include it in a `requirements.yml` file and install it via ---
`ansible-galaxy collection install -r requirements.yml` using the format:
```yaml ## Key Features
collections:
- name: containers.podman
```
or clone by your own: - **Comprehensive Management:** Control every aspect of Podman, including containers, images, pods, networks, volumes, and secrets.
- **Idempotent Operations:** All modules are designed to be idempotent, ensuring predictable and consistent state for your resources.
- **Flexible and Powerful:** Exposes a wide range of Podman options, from simple container creation to advanced features like systemd integration and Quadlet file generation.
- **Connection Plugin:** Includes a `podman` connection plugin to execute Ansible tasks directly inside containers.
## Requirements
- **Ansible:** `ansible-core >= 2.12`
- **Python:** `python >= 3.9`
- **Podman:** A working installation of Podman on the target machine.
## Installation
Install the collection from Ansible Galaxy using the `ansible-galaxy` CLI:
```bash ```bash
mkdir -p ~/.ansible/collections/ansible_collections/containers ansible-galaxy collection install containers.podman
git clone https://github.com/containers/ansible-podman-collections.git ~/.ansible/collections/ansible_collections/containers/podman
``` ```
### Playbooks You can also include it in a `requirements.yml` file, which is useful for managing project dependencies:
To use a module from Podman collection, please reference the full namespace, collection name, ```yaml
and modules name that you want to use: # requirements.yml
collections:
- name: containers.podman
```
Then, install it with:
```bash
ansible-galaxy collection install -r requirements.yml
```
## Getting Started: A Simple Example
Here is a quick example of how to ensure a Redis container is running using the `podman_container` module.
```yaml ```yaml
--- ---
- name: Using Podman collection - name: Deploy a Redis container with Podman
hosts: localhost hosts: localhost
connection: local
tasks: tasks:
- name: Run redis container - name: Ensure the Redis container is running
containers.podman.podman_container: containers.podman.podman_container:
name: myredis name: my-redis-cache
image: redis image: docker.io/redis:alpine
command: redis-server --appendonly yes state: started
state: present ports:
recreate: yes - "6379:6379"
expose: restart_policy: "always"
- 6379
volumes_from:
- mydata
``` ```
Or you can add full namepsace and collecton name in the `collections` element: ## Available Content
```yaml This collection includes:
---
- name: Using Podman collection - **Modules:**
hosts: localhost - `podman_container`: Manage Podman containers.
collections: - `podman_image`: Build, pull, and manage Podman images.
- containers.podman - `podman_pod`: Create and manage Podman pods.
tasks: - `podman_network`: Manage Podman networks.
- name: Build and push an image using existing credentials - `podman_volume`: Manage Podman volumes.
podman_image: - `podman_secret`: Manage Podman secrets.
name: nginx - `podman_login`/`podman_logout`: Authenticate with container registries.
path: /path/to/build/dir - ...and many more!
push: yes
push_args: - **Connection Plugins:**
dest: quay.io/acme - `podman`: Execute Ansible tasks directly within a container.
``` - `buildah`: Execute Ansible tasks directly within a buildah container.
- **Become Plugins:**
- `podman_unshare`: Execute tasks within a `podman unshare` environment.
## Documentation
- **Official Ansible Docs:** For stable, released versions of the collection, see the documentation on the [official Ansible documentation site](https://docs.ansible.com/ansible/latest/collections/containers/podman/index.html).
- **Latest Development Version:** For the most up-to-date documentation based on the `main` branch of this repository, visit our [GitHub Pages site](https://containers.github.io/ansible-podman-collections/).
## Contributing ## Contributing
We are accepting Github pull requests and issues. We welcome contributions from the community! Whether you want to fix a bug, add a new feature, or improve our documentation, your help is valuable.
There are many ways in which you can participate in the project, for example:
- Submit bugs and feature requests, and help us verify them Please read our **[Contributing Guide](CONTRIBUTING.md)** to learn how to get started with development, testing, and submitting pull requests.
- Submit and review source code changes in Github pull requests
- Add new modules for Podman containers and images
## Testing and Development
If you want to develop new content for this collection or improve what is already
here, the easiest way to work on the collection is to clone it into one of the configured
[`COLLECTIONS_PATHS`](https://docs.ansible.com/ansible/latest/reference_appendices/config.html#collections-paths),
and work on it there.
### Testing with `ansible-test`
We use `ansible-test` for sanity.
## More Information
TBD
## Communication
Please submit Github issues for communication any issues.
You can ask Podman related questions on `#podman` channel of Ansible Podman questions
on `#ansible-podman` channel on Freenode IRC.
## License ## License
GPL-3.0-or-later This collection is licensed under the [GNU General Public License v3.0 or later](COPYING).

View File

@ -1,4 +1,4 @@
## Security and Disclosure Information Policy for the Podman Ansible Collections Project ## Security and Disclosure Information Policy for the Podman Ansible Collections Project
The Podman Ansible Collections Project follows the [Security and Disclosure Information Policy](https://github.com/containers/common/blob/master/SECURITY.md) for the Containers Projects. The Podman Ansible Collections Project follows the [Security and Disclosure Information Policy](https://github.com/containers/common/blob/main/SECURITY.md) for the Containers Projects.

View File

@ -0,0 +1,40 @@
%global collection_namespace containers
%global collection_name podman
Name: ansible-collection-%{collection_namespace}-%{collection_name}
Version: XXX
Release: 1%{?dist}
Summary: Podman Ansible collection for Podman containers
License: GPLv3+
URL: %{ansible_collection_url}
Source: https://github.com/containers/ansible-podman-collections/archive/%{version}.tar.gz
BuildRequires: (ansible >= 2.9.10 or ansible-core >= 2.11.0)
BuildArch: noarch
%description
%{summary}.
%prep
%autosetup -n ansible-podman-collections-%{version}
sed -i -e 's/version:.*/version: %{version}/' galaxy.yml
find -type f ! -executable -name '*.py' -print -exec sed -i -e '1{\@^#!.*@d}' '{}' +
rm -fvr changelogs/ ci/ contrib/ tests/ ./galaxy.yml.in .github/ .gitignore
%build
%ansible_collection_build
%install
%ansible_collection_install
%files
%license COPYING
%doc README.md
%{ansible_collection_files}
%changelog
* Tue Feb 09 2021 Sagi Shnaidman <sshnaidm@redhat.com> - 1.4.1-1
- Initial package

767
changelogs/changelog.yaml Normal file
View File

@ -0,0 +1,767 @@
ancestor: null
releases:
1.0.0:
changes:
bugfixes:
- buildah_connection - Fix buildah debug output for py2
- podman_connection - Run pause=false w/o message condition
- podman_container - Add idempotency for user and stop signal
- podman_container - Fix idempotency issues with workdir and volumes
- podman_container - Fix image, healthcheck and other idempotency
- podman_container - Improve idempotency of podman_container in uts, ipc, networks,
cpu_shares
- podman_image - only set changed=true if there is a new image
- podman_image - use correct option for remove_signatures flag
minor_changes:
- buildah_connection - add support of specific user
- buildah_connection - added Buildah connection rootless
- podman_connection - add user flags before container id in podman exec
release_summary: Initial release of collection with new modules
modules:
- description: Manage Podman containers
name: podman_container
namespace: ''
- description: Retrieve information about Podman networks
name: podman_network_info module
namespace: ''
release_date: '2020-05-20'
1.0.1:
changes:
bugfixes:
- podman_container - Add inspect of image and user idempotency
- podman_image - Add option for tls_verify=false for images
release_summary: Idempotency and images improvements
release_date: '2020-06-01'
1.0.2:
changes:
bugfixes:
- podman_container - Add idempotency for existing local volumes
release_summary: Idempotency fixes
release_date: '2020-06-05'
1.0.3:
changes:
minor_changes:
- Relicense under GPLv3 and clean up modules
release_summary: Relicense under GPLv3 and clean up modules
release_date: '2020-06-08'
1.0.4:
changes:
bugfixes:
- podman_container - Add idempotency for ulimits and tests
- podman_container - Fix idempotency for podman > 2 versions
release_summary: Idempotency and Podman v2 fixes
release_date: '2020-06-29'
1.0.5:
changes:
bugfixes:
- podman_connection - Add check for empty dir for podman connection mount
- podman_connection - Increase verbosity for mount failure messages
- podman_container - Improve idempotency for volumes with slashesAdd idempotency
for ulimits and tests
- podman_container - Improve ports idempotency and support UDP
release_summary: Idempotency and another bugfixes for podman connection plugin.
release_date: '2020-07-09'
1.1.0:
changes:
bugfixes:
- podman_container - Fix idempotency for networks and add tests
minor_changes:
- Add podman pod and pod info modules
release_summary: New modules for pods management.
modules:
- description: Manage Podman pods
name: podman_pod
namespace: ''
- description: Retrieve information about Podman pods
name: podman_pod_info
namespace: ''
release_date: '2020-07-19'
1.1.1:
changes:
bugfixes:
- podman_volume_info - Improve podman volume info tests with new module
minor_changes:
- Create podman_volume module for volumes management
release_summary: New modules for volumes management.
modules:
- description: Manage Podman volumes
name: podman_volume
namespace: ''
release_date: '2020-07-22'
1.1.2:
changes:
bugfixes:
- podman_connection - Chown file for users when copy them to container
release_summary: Urgent fix for podman connection plugin.
release_date: '2020-07-26'
1.1.3:
changes:
bugfixes:
- podman_container - Fix idempotency for case with = in env
- podman_container - Fix issue with idempotency uts, ipc with pod
release_summary: Idempotency fixes for podman containers.
release_date: '2020-07-29'
1.1.4:
changes:
minor_changes:
- Add pip installation for podman collection.
release_summary: Pip install and minor fixes.
release_date: '2020-08-06'
1.10.0:
changes:
bugfixes:
- Delete systemd files when container/pod is deleted
- Fix example in systemd generate module
- Fix expanduser in path for systemd generation
- Fix idempotency for labels in pods
- Fix podman load module for Podman 4
- Fix rerunning playbooks with generate_systemd --new
- Improve idempotency for devices mount of rootless podman
- Improve networks idempotency for v4
- Support passing multiple networks with params
- fix pod running status for older podman versions
- podman_container should ensure image by using os path if rootfs is used
major_changes:
- New become plugin - podman_unshare
- Podman generate systemd module
minor_changes:
- Add --sdnotify option for container
- Add example unittest for container lib
- Add protection for systemd files deletion
- Add unittests for Ansible Podman modules
- Check for gha updates weekly using dependabot
- Fix PEP8 issue in podman_image
- Fix building image with buildah and become
- Fix docs issues in podman_image
- Warning about improperly configured remote target
- add required argument to example
- docs - added simple extra_args example
- generate_systemd - implement --wants, --after and --requires
- podman_image - add file parameter for Containerfile location
release_summary: New modules, become plugin and bugfixes.
release_date: '2022-11-17'
1.10.1:
changes:
bugfixes:
- podman_systemd_generate - allow empty string for prefixes
- podman_unshare - Fix docs for podman_unshare become plugin
minor_changes:
- Add missed docs for modules
release_summary: Bugfixes and minor docs changes
release_date: '2022-11-22'
1.10.2:
changes:
bugfixes:
- Add hooks-dir parameter for containers
- Add idempotency for restart-policy for containers
- Add missing options to podman network
- Add more explanation about cmd_args command usage
- Add stdout to podman build and push actions
- Added support for "userns" parameter to "play" module
- CI - fix pip installation of the collection
- CI - fix podman play job for 4.4.x versions
- Change yes/no to true/false in the modules
- Convert str to json format before evaluating length.
- Fix CI for newest Ansible branch 2.16
- Fix idempotency for pods with uidmap and gidmap
- Fix idempotency lowercase for devices
- Fix network tests for Podman v4
- Fix podman logout tests for v4
- Fix pylint issues for CI ansible-test
- Fix undesirable splitting of IPv6 host addresses
- Improved documentation of `podman_generate_systemd` module
- Prepare CI for Podman v3 backward compatibility
- Support SHA256 tag for podman images
- Update podman_image to specify CPU arch when pulling image
- added podman_prune module
- become plugin podman_unshare become_user default
- fix for buildah improper remote target
- for pod kube recreate
- pod - Support passing multiple networks with params
- podman-login - fix FIPS md5 issue and registry requirement
- podman-pod - Fix idempotency for pods in 4.4.x versions
- podman_systemd - Ignore header when comparing systemd files content
release_summary: Bugfixes and docs changes
release_date: '2023-05-31'
1.10.3:
changes:
bugfixes:
- podman_container - Add diff and change detection to systemd generation
- podman_container - Add example with quotes in command to docs
- podman_container - Fix healthcheck issue where defined in image
- podman_container - Fix idempoency issue with PID of container
- podman_container - Fix idempotency for RestartPolicy when MaximumRetryCount
- podman_container - Fix idempotency for devices
- podman_container - Fixed idempotency with cpus parameter
- podman_container - Improve docs about container env_file on remote machine
- podman_container - added cpu_quota parameter to podman_container
- podman_export,podman_import - Adding volume import and export option
- podman_generate_systemd - Add a force field to podman_generate_systemd
- podman_image - Add restart-sec and other options to systemd generation
- podman_image - Fix pulling short image name
release_summary: Bugfixes and new options for modules
release_date: '2023-08-15'
1.10.4:
changes:
bugfixes:
- Fix common file for Python 2.7
- podman_network - Do not force network removal by default
- podman_network - Fix network DNS enable idempotency issue
- podman_pod - Fix idempotency when running inside Podman container
minor_changes:
- podman_container - Add support for health-on-failure action
- podman_image -Add target support for podman build image
- podman_play - Add build and context_dir option to podman_play
- podman_pod - Add options for resource limits to podman_pod
release_summary: Bugfixes and new modules
modules:
- description: Executes a command in a running container
name: podman_container_exec
namespace: ''
- description: Run given label from given image
name: podman_runlabel
namespace: ''
release_date: '2023-11-01'
1.11.0:
changes:
minor_changes:
- Update docs
release_date: '2023-11-05'
1.12.0:
changes:
bugfixes:
- Add idempotency for podman_secret module
- Catch exceptions when no JSON output in podman_image
- Fail if systemd generation failed and it's explicitly set
- Fix example name
- Fix idempotency for podman_network
- Fix idempotency when using 0.0.0.0 in ports
- Fix multi-image support for podman_save
- Fix volume inspection by name in podman_volume
- Recreate stopped containers if recreate flag is enabled
minor_changes:
- Add log_opt and annotaion options to podman_play module
- Add option to parse CreateCommand easily for diff calc
- Add support for setting underlying interface in podman_network
- Alias generate systemd options stop_timeout and time
- Fix CI rootfs for podman_container
- Fix broken conmon version in CI install
- Improve security_opt comparison between existing container
- podman_container - Add new arguments to podman status commands
- podman_container - Update env_file to accept a list of files instead of a
single file
- podman_secret_info - Add secrets info module
release_summary: New podman_secret_info module, improvements and bugfixes
modules:
- description: Secrets info module
name: podman_secret_info
namespace: ''
release_date: '2024-01-30'
1.12.1:
changes:
bugfixes:
- podman_container - Add check and fixed for v5 network diff
- podman_container - Fix pasta networking idempotency for v5 (#728)
- podman_container_exec - Remove unnecessary quotes in podman_container_exec
module
- podman_image_info - Fix wrong return data type in podman_image_info
- podman_play - Fix kube play annotations
- podman_pod - Fix broken info of pods in Podman v5
- podman_pod - Fix pod for Podman v5
- podman_pod - Fix podman pod v5 broken info issue
minor_changes:
- CI - Fix rootfs test in CI
- CI - add custom podman path to tasks
- CI - add parametrized executables to tests
- podman_container - Add pasta as default network mode after v5
- podman_container_exec - Return data for podman exec module
- podman_generate_systemd - Fix broken example for podman_generate_systemd (#708)
- podman_login - Update podman_login.py
- podman_play - Add support for kube yaml files with multi-documents (#724)
- podman_play - Update the logic for deleting pods/containers in podman_play
- podman_pod_info - handle return being list in Podman 5 (#713)
release_summary: Support for Podman v5 and bugfixes
release_date: '2024-04-08'
1.13.0:
changes:
bugfixes:
- Fix pod info for non-existant pods
major_changes:
- Add quadlet support for Podman modules
release_summary: Quadlet support for Podman
release_date: '2024-04-22'
1.14.0:
changes:
bugfixes:
- Fix idempotency for pod with 0.0.0.0
- Fix transports issues in podman_image
- fix(#747) set correct HealthCmd
major_changes:
- Add mount and unmount for volumes
- Add multiple subnets for networks
- Add new options for podman_container
- Add new options to pod module
- Improve idempotency for networking in podman_container
- Redesign idempotency for Podman Pod module
minor_changes:
- Add autodiscovery for build context in podman_image
- Add docs, tests and more examples for podman_pod
- Add extra_args for podman_image push and pull
- Add idempotency for mounts and volumes in podman_container
- Add new functionality tests for podman_secret
- Add path and env options for podman_secret
- Add route, dns and ipam_driver to podman_network
- Create podman secret when skip_existing=True and it does not exist
release_summary: Idempotency redesign and a lot of new options
release_date: '2024-05-30'
1.15.0:
changes:
bugfixes:
- Fix issue with pushing podman image to repo name and org
major_changes:
- Add podman search
release_summary: Podman search module and bugfixes for Podman image
modules:
- description: Search for remote images using podman
name: podman_search
namespace: ''
release_date: '2024-06-03'
1.15.1:
changes:
bugfixes:
- Fix idempotency for pods in case of systemd generation
- Fix idempotency for systemd generations
release_summary: Bugfixes for systemd generation
release_date: '2024-06-07'
1.15.2:
changes:
minor_changes:
- Add option for inline Containerfile in podman_image
release_summary: Inline Containerfile option for podman_image
release_date: '2024-06-11'
1.15.3:
changes:
bugfixes:
- Fix idempotency for empty values
- params gpus should be exit_policy
minor_changes:
- CI Update python for latest Ansible to 3.11 in CI
release_summary: Bugfixes
release_date: '2024-06-20'
1.15.4:
changes:
bugfixes:
- Fix missing entries in network quadlet generated file
- Fix quadlet parameters for restart policy
- Idempotency improvements
release_summary: Bugfixes
release_date: '2024-07-12'
1.16.0:
changes:
bugfixes:
- CI - Add images removal for tests
- CI - Fix podman CI test container images
- CI - add ignore list for Ansible sanity for 2.19
- CI - bump artifacts versions for GHactions
- CI - change k8s.gcr.io to registry.k8s.io in tests
- CI - fix Podman search of invalid image
- Disable idempotency for pod_id_file
- Fix command idempotency with quotes
- Fix health-startup-cmd
- Fix logic in Podman images
- Fix quadlet parameters when container uses rootfs
- fix for tls_verify being ignored
- fix(podman_image) - skip empty volume items
- fix(podman_save) - always changed when force
- modify error and docs
minor_changes:
- Add arch to podman build command explicitly
- Add group_add parameter for podman quadlet
- Add support for check_mode in Quadlet
- Trigger a new image build when we detect that the Containerfile has changed.
- Update inspection info about objects in modules
release_summary: New features, podman copy module and bugfixes
modules:
- description: Copy file to or from a container
name: podman_container_copy
namespace: ''
release_date: '2024-09-24'
1.16.1:
changes:
bugfixes:
- Fix podman image permissions issue and runlable test
- don't document quadlet_dir as required when setting state=quadlet
release_summary: Bugfixes
release_date: '2024-09-26'
1.16.2:
changes:
bugfixes:
- Add missing parameters for podman container quadlet
- Add new options for podman_network
- Add option to specify kube file content in module
- Add quadlet file mode option to specify file permission
- Add secret to login module
- Don't check image availability in Quadlet
- Fix max_size idempotency issue
- Fix typo in quadlet generator
- Fix unsupported pull policy in example on podman_container.py
- fix quadlet cmd_args append mistake
- podman_login does not support check_mode
release_summary: Bugfixes and Quadlet improvements
release_date: '2024-11-03'
1.16.3:
changes:
bugfixes:
- Don't pull image when state is absent or pull=never (#889)
- Fix idempotency for containers with env vars containing MAX_SIZE (#893)
- Fix list tags failure in podman_search (#875)
- Fix podman_container_copy examples (#882)
- docs(podman_container) - improve comments on network property (#878)
release_summary: Bugfixes
release_date: '2025-01-29'
1.16.4:
changes:
bugfixes:
- Document that sdnotify can be set to healthy
- Fix CI for podman_image_info
- Fix None values in LogOpt in Quadlet
- Fix conditions in CI jobs
- Fix idempotency for any podman secret driver
- Fix idempotency for systemd keyword
- Fix setuptools
- Handle image arguments in podman_container
- Remove docker protocol when inspecting image
- Set custom tmpfs idempotency
- Use usedforsecurity for hashlib.sha256 only in python version >=3.9
- correctly quote labels and environment variables for quadlets
- doc - podman_secret - fix indentation error in example
- fix(podman_image) - correct intendation on 'loop' keyword
release_summary: Bugfixes
release_date: '2025-06-04'
1.17.0:
changes:
minor_changes:
- Add another test for volumes
- Added checks for volume opts
release_summary: Minor changes and system info module
modules:
- description: Get podman system information from host machine
name: podman_system_info
namespace: ''
release_date: '2025-06-26'
1.2.0:
changes:
minor_changes:
- Add changelog file to collection.
release_summary: Add changelog file.
release_date: '2020-08-17'
1.3.0:
changes:
bugfixes:
- podman_volume - Fix return data from podman_volume module
minor_changes:
- Create podman_network module for podman networks management
release_summary: New podman_network module and bugfixes
modules:
- description: Manage Podman networks
name: podman_network
namespace: ''
release_date: '2020-09-03'
1.3.1:
changes:
bugfixes:
- multiple modules - fix diff calculation for lower/upper cases
- podman_container - Add note about containerPort setting
- podman_container - Fix init option it's boolean not string
- podman_container - Remove pyyaml from requirements
- podman_network - Check if dnsname plugin installed for CNI
- podman_volume - Set options for a volume as list and fix idempotency
release_summary: bugfixes
release_date: '2020-10-09'
1.3.2:
changes:
bugfixes:
- podman_container - Fix signals case for podman_container
release_summary: bugfixes
release_date: '2020-10-20'
1.4.0:
changes:
bugfixes:
- podman_container - Fix force restart option for containers
- podman_container - Fix idempotency for volume GID and UID
- podman_container - Fix no_hosts idempotency for newer version
- podman_container - Remove 'detach' when creating container
- podman_image - Fix doc defaults for podman_image
- podman_logout - Handle podman logout not logging out when logged in via different
tool
- podman_network - Correct IP range example for podman_network
minor_changes:
- podman_container - Add log level for Podman in module
- podman_container - Add mac_address field to podman_container module
- podman_container - Add strict image compare with hashes
- podman_container - Improve compatibility with docker_container by adding aliases
- podman_container - Move containers logic to module utils
- podman_image - reuse existing results in present()
- podman_network - Add IPv6 to network
- podman_network - Add support of network options like MTU, VLAN
- podman_pod - Move pod logic to separate library
release_summary: New modules and bugfixes, new network options
modules:
- description: Manage multiple Podman containers at once
name: podman_containers
namespace: ''
- description: Get info about Podman logged in registries
name: podman_login_info
namespace: ''
- description: Log out with Podman from registries
name: podman_logout
namespace: ''
release_date: '2020-09-03'
1.4.1:
changes:
bugfixes:
- podman_container - Convert gidmap to list for podman_container
- podman_container - Convert log-opts to dictionary and idempotent
release_summary: Bugfixes for podman container
release_date: '2020-12-21'
1.4.2:
changes:
bugfixes:
- documentation - Add docs to Github
- podman_container - Add 'created' state for podman_container
- podman_container - Change default log level for 3+ versions
- podman_container - Convert systemd option to a string
- podman_container - Don't recreate container if env_file is specified
- podman_container - Fix 'cap_add' and 'cap_drop' idempotency
- podman_container - Fix idempotency for multiple ports
- podman_container - Fix slirp4netns options idempotency
- podman_container - Fix uid/gid checks for podman 1.6.4 volumes
- podman_container - Handle slash removals for root volumes mount
- podman_container - Restart container in a simple manner
- podman_container - podman_container_lib - fix command idempotency
- podman_image - Add debug log and podman_actions to podman_image
- podman_image - Don't set default for validate-certs in podman_image
release_summary: Bugfixes for podman container
release_date: '2021-02-14'
1.4.3:
changes:
bugfixes:
- Add docs generation
- Update documentation
release_summary: Documentation fixes and updates
release_date: '2021-02-14'
1.4.4:
changes:
bugfixes:
- Attempt graceful stop when recreating container
- Don't calculate image digest in check mode
- Fix internal networks and DNS plugin for v3
- Fix podman_pod* modules for Podman v3
- Fixes for podman_container for Podman v3
release_summary: Fixes for newest version 3 of Podman
release_date: '2021-03-01'
1.4.5:
changes:
bugfixes:
- Add IPv6 support for publishing ports
- Add sigrtmin+3 signal (required for systemd containers)
- Add support for Podman Pod restart
- Convert IPv6 to shorten form
- Fix error with images info where no images
- Fix idempotency for rootless networks from v3
- Fix no_log for newer ansible-test
- Fix uppercase labels idempotency issue
- Stop pods without recreating them
release_summary: Additional fixes for newest version 3 of Podman
release_date: '2021-04-02'
1.5.0:
changes:
minor_changes:
- Podman login module
release_summary: New module - Podman login
modules:
- description: Login to a container registry using podman
name: podman_login
namespace: ''
release_date: '2021-04-05'
1.6.0:
changes:
bugfixes:
- Fix ansible-test issues for CI
- Fix idempotency for environment
- Fix ipv6=false issue
- Fix multi-containers options
- Fix overlayfs issue in CI for buildah connection
minor_changes:
- Add Ansible 2.11 to all tests and use Ubuntu 20.04
- Add Ansible 2.11 to testing
- Add RPM building scripts
- Add support for timezones in containers
release_summary: New module podman_play for playing Kubernetes YAML and bugfixes
modules:
- description: Play Kubernetes YAML files with Podman
name: podman_play
namespace: ''
release_date: '2021-06-03'
1.6.1:
changes:
bugfixes:
- Fix failure when listing containers
release_summary: Bugfix for podman_container_info
release_date: '2021-06-08'
1.6.2:
changes:
bugfixes:
- Add meta/runtime.yml which is required for Galaxy now
- Avoid exposing pipelining support for podman connections
- Change present state to be as created state
- Disable no-hosts idempotency
- Fix idempotency with systemd podman files
- Remove idempotency for volume UID/GID
release_summary: Bugfixes for idempotency and pipelining
release_date: '2021-08-02'
1.7.0:
changes:
minor_changes:
- Podman secret module
release_summary: New module - Podman secret
modules:
- description: Manage podman secrets
name: podman_secret
namespace: ''
release_date: '2021-08-15'
1.7.1:
changes:
bugfixes:
- Add support for podman pod create --infra-name
- Fix idempotency when containers have a common network
- Remove idempotency leftovers of volumes GID,UID
release_summary: Bugfixes and new features
release_date: '2021-09-01'
1.8.0:
changes:
major_changes:
- Add systemd generation for pods
- Generate systemd service files for containers
release_summary: New modules for images and containers
modules:
- description: Export a podman container to tar file
name: podman_export
namespace: ''
- description: Import Podman container from a tar file
name: podman_import
namespace: ''
- description: Load image from a tar file
name: podman_load
namespace: ''
- description: Saves podman image to tar file
name: podman_save
namespace: ''
release_date: '2021-09-17'
1.8.1:
changes:
bugfixes:
- Add .service extension to systemd files
- Add aliases for image load/save
- Change python version for ansible-core to 3.9
- Fix suboption key in podman_container/podman_pod for generate_systemd documentation
release_summary: Fixes for systemd units generation
release_date: '2021-09-24'
1.8.2:
changes:
bugfixes:
- Add option for ansible-core in RPM spec file
- Add skip option for podman secret
- Add support for network-alias flag
- Allow to actually pass a list of string for "mounts"
- Don't add newlines to secrets
- Fix issue with podman and exposed ports
- Fix signal diff for truncated and RT signal names
- Support empty strings in prefixes
- Update error message when pull set to false
release_summary: Fixes for various modules
release_date: '2021-11-09'
1.8.3:
changes:
bugfixes:
- Add documentations for generate_systemd
- Hardcode RT signal numbers
- Remove default value of log-driver
- Support --new in generate_systemd
release_summary: Bugfixes
release_date: '2021-11-25'
1.9.0:
changes:
bugfixes:
- Don't include shared 'net' if network is host in pods
major_changes:
- Add podman_tag module
- Add secrets driver and driver opts support
minor_changes:
- Add a second example to podman_pod_module.html
release_summary: New podman_tag module and fixes
modules:
- description: Add an additional name to a local image
name: podman_tag
namespace: ''
release_date: '2021-12-05'
1.9.1:
changes:
bugfixes:
- Fix podman_pod_lib behavior for ports published to multiple IPs
- Handle tlsverify correctly in podman_login
- Update secrets description and add test with secret opts
minor_changes:
- Add new options for pod module
- Use yaml syntax highlighting where appropriate
release_summary: Bugfixes and new options for Pods
release_date: '2022-01-13'
1.9.2:
changes:
bugfixes:
- Add slirp4netns idempotency for pods
- Fix MAC address detection in created container
- Fix check for read-only change of root image in podman_container module
- Fix error with exitcommand for Podman v4
- Fix issue when missing plugins entry in podman_network module
- Fix new requirements for plugins documentation
- Fix podman collection for Podman version 4
- Fix tests for podman_container module
- Strip slashes from volumes
minor_changes:
- Add requires option to podman_container module
release_summary: Bugfixes and new requires option for podman_container
release_date: '2022-03-21'
1.9.3:
changes:
bugfixes:
- Remove idempotency for log level
minor_changes:
- Fix sanity issues with a new Ansible version
release_summary: Bugfixes and minor changes
release_date: '2022-03-29'
1.9.4:
changes:
bugfixes:
- connection_podman - Add missing docstring for method that executes the podman
commands
- podman_container - Change IpcMode default to shareable
- podman_container - Disable memory idempotency
- podman_container - Fix typo in the documentation
- podman_image - Update `podman_image` to remove image with image id
- podman_load - Loop over image names when multiple images present in archive
- podman_login - Fix idempotency for podman_login
- podman_network - Allow specify podman_network options MTU and VLAN separately
- podman_network - Fix internal networks idempotency
- podman_play - Fix play_kube not working when yaml not installed on target
- podman_play - Pass errors as a string instead of list
- podman_pod - Change network attribute from str to list in pods
- podman_pod - Fix pod network idempotency
- podman_pod - Fix pod tests in CI
- podman_pod - Fix pods list retrieve
minor_changes:
- Remove distutils as deprecated
- Run CI on Ubuntu 22.04
- Use 2.13 Ansible version in CI jobs instead of 2.11
release_summary: Bugfixes and minor changes
release_date: '2022-07-04'

31
changelogs/config.yaml Normal file
View File

@ -0,0 +1,31 @@
changelog_filename_template: ../CHANGELOG.rst
changelog_filename_version_depth: 0
changes_file: changelog.yaml
changes_format: combined
ignore_other_fragment_extensions: true
keep_fragments: false
mention_ancestor: true
new_plugins_after_name: removed_features
notesdir: fragments
prelude_section_name: release_summary
prelude_section_title: Release Summary
sections:
- - major_changes
- Major Changes
- - minor_changes
- Minor Changes
- - breaking_changes
- Breaking Changes / Porting Guide
- - deprecated_features
- Deprecated Features
- - removed_features
- Removed Features (previously deprecated)
- - security_fixes
- Security Fixes
- - bugfixes
- Bugfixes
- - known_issues
- Known Issues
title: Ansible Podman modules and plugins
trivial_section_name: trivial
use_fqcn: true

View File

@ -11,7 +11,7 @@
shell: >- shell: >-
{% if ansible_venv is defined %}source {{ ansible_venv }}/bin/activate; {% endif %} {% if ansible_venv is defined %}source {{ ansible_venv }}/bin/activate; {% endif %}
{{ repo_dir }}/ci/run_connection_test.sh {{ repo_dir }}/ci/run_connection_test.sh podman {{ test_executable | default('podman') }}
args: args:
chdir: "{{ repo_dir }}" chdir: "{{ repo_dir }}"
executable: /bin/bash executable: /bin/bash

View File

@ -6,3 +6,4 @@
name: podman_container name: podman_container
vars: vars:
idem_image: idempotency_test idem_image: idempotency_test
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"

View File

@ -0,0 +1,8 @@
---
- hosts: all
gather_facts: true
tasks:
- include_role:
name: podman_container_copy
vars:
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"

View File

@ -0,0 +1,8 @@
---
- hosts: all
gather_facts: true
tasks:
- include_role:
name: podman_container_exec
vars:
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"

View File

@ -6,3 +6,4 @@
name: podman_container_idempotency name: podman_container_idempotency
vars: vars:
idem_image: idempotency_test idem_image: idempotency_test
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"

View File

@ -4,3 +4,5 @@
tasks: tasks:
- include_role: - include_role:
name: podman_container_info name: podman_container_info
vars:
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"

View File

@ -0,0 +1,9 @@
---
- hosts: all
gather_facts: true
tasks:
- include_role:
name: podman_containers
vars:
idem_image: idempotency_test
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"

View File

@ -0,0 +1,8 @@
---
- hosts: all
gather_facts: true
tasks:
- include_role:
name: podman_export
vars:
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"

View File

@ -0,0 +1,8 @@
---
- hosts: all
gather_facts: true
tasks:
- include_role:
name: podman_generate_systemd
vars:
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"

View File

@ -4,3 +4,5 @@
tasks: tasks:
- include_role: - include_role:
name: podman_image name: podman_image
vars:
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"

View File

@ -4,3 +4,5 @@
tasks: tasks:
- include_role: - include_role:
name: podman_image_info name: podman_image_info
vars:
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"

View File

@ -0,0 +1,8 @@
---
- hosts: all
gather_facts: true
tasks:
- include_role:
name: podman_import
vars:
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"

View File

@ -0,0 +1,8 @@
---
- hosts: all
gather_facts: true
tasks:
- include_role:
name: podman_load
vars:
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"

View File

@ -0,0 +1,8 @@
---
- hosts: all
gather_facts: true
tasks:
- include_role:
name: podman_login
vars:
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"

View File

@ -0,0 +1,8 @@
---
- hosts: all
gather_facts: true
tasks:
- include_role:
name: podman_login_info
vars:
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"

View File

@ -0,0 +1,8 @@
---
- hosts: all
gather_facts: true
tasks:
- include_role:
name: podman_logout
vars:
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"

View File

@ -0,0 +1,8 @@
---
- hosts: all
gather_facts: true
tasks:
- include_role:
name: podman_network
vars:
ansible_python_interpreter: "/usr/bin/python"

View File

@ -4,3 +4,5 @@
tasks: tasks:
- include_role: - include_role:
name: podman_network_info name: podman_network_info
vars:
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"

View File

@ -0,0 +1,8 @@
---
- hosts: all
gather_facts: true
tasks:
- include_role:
name: podman_play
vars:
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"

View File

@ -6,3 +6,4 @@
name: podman_pod name: podman_pod
vars: vars:
idem_image: idempotency_test idem_image: idempotency_test
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"

View File

@ -4,3 +4,5 @@
tasks: tasks:
- include_role: - include_role:
name: podman_pod_info name: podman_pod_info
vars:
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"

View File

@ -0,0 +1,8 @@
---
- hosts: all
gather_facts: true
tasks:
- include_role:
name: podman_prune
vars:
ansible_python_interpreter: "/usr/bin/python"

View File

@ -0,0 +1,9 @@
---
- hosts: all
gather_facts: true
tasks:
- include_role:
name: podman_runlabel
vars:
runlabel_image: runlabel_test
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"

View File

@ -0,0 +1,8 @@
---
- hosts: all
gather_facts: true
tasks:
- include_role:
name: podman_save
vars:
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"

View File

@ -0,0 +1,8 @@
---
- hosts: all
gather_facts: true
tasks:
- include_role:
name: podman_search
vars:
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"

View File

@ -0,0 +1,9 @@
---
- hosts: all
gather_facts: true
tasks:
- include_role:
name: podman_secret
vars:
idem_image: idempotency_test
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"

View File

@ -0,0 +1,9 @@
---
- hosts: all
gather_facts: true
tasks:
- include_role:
name: podman_secret_info
vars:
idem_image: idempotency_test
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"

View File

@ -0,0 +1,8 @@
---
- hosts: all
gather_facts: true
tasks:
- include_role:
name: podman_system_connection
vars:
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"

View File

@ -0,0 +1,8 @@
---
- hosts: all
gather_facts: true
tasks:
- include_role:
name: podman_system_connection_info
vars:
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"

View File

@ -0,0 +1,8 @@
---
- hosts: all
gather_facts: true
tasks:
- include_role:
name: podman_system_info
vars:
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"

View File

@ -0,0 +1,8 @@
---
- hosts: all
gather_facts: true
tasks:
- include_role:
name: podman_tag
vars:
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"

View File

@ -0,0 +1,8 @@
---
- hosts: all
gather_facts: true
tasks:
- include_role:
name: podman_volume
vars:
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"

View File

@ -4,3 +4,5 @@
tasks: tasks:
- include_role: - include_role:
name: podman_volume_info name: podman_volume_info
vars:
ansible_python_interpreter: "{{ _ansible_python_interpreter }}"

View File

@ -1,4 +1,15 @@
--- ---
- name: Install repo for ubuntu
become: true
shell: |
. /etc/os-release
echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${VERSION_ID}/ /" > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${VERSION_ID}/Release.key | apt-key add -
apt-get update
when:
- ansible_distribution|lower == "ubuntu"
- podman_version_ubuntu | default('unstable') == 'unstable'
- name: Install repo for ubuntu - name: Install repo for ubuntu
become: true become: true
shell: | shell: |
@ -6,4 +17,6 @@
echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /" > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /" > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/Release.key | apt-key add - curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/Release.key | apt-key add -
apt-get update apt-get update
when: ansible_distribution|lower == "ubuntu" when:
- ansible_distribution|lower == "ubuntu"
- podman_version_ubuntu | default('unstable') == 'stable'

View File

@ -36,10 +36,8 @@
- distro == 'CentOS7' - distro == 'CentOS7'
- setup_python|default(true)|bool - setup_python|default(true)|bool
- name: Upgrade pip - name: Install Python packaging
pip: command: pip install --upgrade setuptools packaging pip
name: pip
extra_args: --upgrade
environment: environment:
PATH: /usr/local/bin:{{ ansible_env.PATH }} PATH: /usr/local/bin:{{ ansible_env.PATH }}
@ -62,6 +60,41 @@
- git - git
- vim - vim
- dnsmasq - dnsmasq
- slirp4netns
state: latest
- name: Discover slirp4netns version
shell: slirp4netns -v | grep version | awk {'print $3'}
register: version
when:
- ansible_distribution == 'Ubuntu'
- ansible_distribution_major_version is version('22', '>=')
- name: Install newest slirp4netns version
shell: >-
curl -o /tmp/slirp4netns --fail -L https://github.com/rootless-containers/slirp4netns/releases/download/v1.2.0/slirp4netns-$(uname -m);
chmod +x /tmp/slirp4netns;
mv /tmp/slirp4netns /usr/bin/slirp4netns
when:
- ansible_distribution == 'Ubuntu'
- ansible_distribution_major_version is version('22', '>=')
- version.stdout is version('1.1.0', '<')
- name: Discover conmon version
shell: conmon --version | grep version | awk {'print $3'}
register: conmon_version
when:
- ansible_distribution == 'Ubuntu'
- ansible_distribution_major_version is version('22', '>=')
- name: Downgrade broken conmon
shell: >-
wget https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_22.04/amd64/conmon_2.1.2~0_amd64.deb -O /tmp/conmon_2.1.2.deb;
apt install -y /tmp/conmon_2.1.2.deb
when:
- ansible_distribution == 'Ubuntu'
- ansible_distribution_major_version is version('22', '>=')
- conmon_version.stdout is version('2.1.9', '==')
- name: Remove virtualenv if need - name: Remove virtualenv if need
file: file:

View File

@ -2,17 +2,26 @@
set -o pipefail set -o pipefail
set -eux set -eux
# New requirement from ansible-core 2.14
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
CON_TYPE="${1:-podman}" CON_TYPE="${1:-podman}"
SUDO=${ROOT:+"sudo -E"} SUDO=${ROOT:+"sudo -E"}
PODMAN_EXE="${2:-podman}"
echo "Print current Podman version"
$PODMAN_EXE version
ANSIBLECMD=${ANSIBLECMD:-$(command -v ansible-playbook)} ANSIBLECMD=${ANSIBLECMD:-$(command -v ansible-playbook)}
echo "Testing $CON_TYPE connection ${ROOT:+'with root'}" echo "Testing $CON_TYPE connection ${ROOT:+'with root'}"
if [[ "$CON_TYPE" == "podman" ]]; then if [[ "$CON_TYPE" == "podman" ]]; then
${SUDO} podman ps | grep -q "${CON_TYPE}-container" || \ ${SUDO} $PODMAN_EXE ps | grep -q "${CON_TYPE}-container" || \
${SUDO} podman run -d --rm --name "${CON_TYPE}-container" python:3-alpine sleep 1d ${SUDO} $PODMAN_EXE run -d --name "${CON_TYPE}-container" python:3.10-alpine sleep 1d
elif [[ "$CON_TYPE" == "buildah" ]]; then elif [[ "$CON_TYPE" == "buildah" ]]; then
${SUDO} buildah from --name=buildah-container python:2 ${SUDO} buildah from --name=buildah-container python:3.10-alpine
fi fi
pushd "tests/integration/targets/connection_${CON_TYPE}" pushd "tests/integration/targets/connection_${CON_TYPE}"
@ -26,6 +35,7 @@ exit_code=0
CMD="${SUDO:-} ${ANSIBLECMD:-ansible-playbook} \ CMD="${SUDO:-} ${ANSIBLECMD:-ansible-playbook} \
-i tests/integration/targets/connection_${CON_TYPE}/test_connection.inventory \ -i tests/integration/targets/connection_${CON_TYPE}/test_connection.inventory \
-e connection_type=containers.podman.${CON_TYPE} \ -e connection_type=containers.podman.${CON_TYPE} \
-e ansible_podman_executable=$PODMAN_EXE \
ci/playbooks/connections/test.yml" ci/playbooks/connections/test.yml"
$CMD -vv || exit_code=$? $CMD -vv || exit_code=$?

View File

@ -2,6 +2,11 @@
set -o pipefail set -o pipefail
set -ex set -ex
# New requirement from ansible-core 2.14
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
[[ -z "$TEST2RUN" || ! -f "ci/playbooks/containers/${TEST2RUN}.yml" ]] && { [[ -z "$TEST2RUN" || ! -f "ci/playbooks/containers/${TEST2RUN}.yml" ]] && {
echo "Please specify test to run, for example TEST2RUN=podman_container"; echo "Please specify test to run, for example TEST2RUN=podman_container";
exit 1; exit 1;
@ -16,7 +21,7 @@ CMD="ANSIBLE_ROLES_PATH=${CURWD}/../tests/integration/targets \
${ANSIBLECMD:-ansible-playbook} \ ${ANSIBLECMD:-ansible-playbook} \
-i localhost, -c local --diff \ -i localhost, -c local --diff \
ci/playbooks/containers/${TEST2RUN}.yml \ ci/playbooks/containers/${TEST2RUN}.yml \
-e ansible_python_interpreter=$(command -v python)" -e _ansible_python_interpreter=$(command -v python)"
bash -c "$CMD -vv" || exit_code=$? bash -c "$CMD -vv" || exit_code=$?
if [[ "$exit_code" != 0 ]]; then if [[ "$exit_code" != 0 ]]; then

11
contrib/ansible-lint.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
mkdir -p /tmp/ansible-lint-installs
mkdir -p /tmp/ansible-lint-collection
rm -rf /tmp/ansible-lint-collection/*
ansible-galaxy collection build --output-path /tmp/ansible-lint-collection --force
pushd /tmp/ansible-lint-collection/
ansible-galaxy collection install -vvv --force $(ls /tmp/ansible-lint-collection/) -p /tmp/ansible-lint-installs
pushd /tmp/ansible-lint-installs/ansible_collections/containers/podman
ansible-test sanity --docker --color --truncate 0 --no-redact --python 3.12 -v plugins/ tests/
popd
popd

11
contrib/ansible-unit.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
mkdir -p /tmp/ansible-lint-installs
mkdir -p /tmp/ansible-lint-collection
rm -rf /tmp/ansible-lint-collection/*
ansible-galaxy collection build --output-path /tmp/ansible-lint-collection --force
pushd /tmp/ansible-lint-collection/
ansible-galaxy collection install -vvv --force $(ls /tmp/ansible-lint-collection/) -p /tmp/ansible-lint-installs
pushd /tmp/ansible-lint-installs/ansible_collections/containers/podman
ansible-test units --python 3.12 -vvv
popd
popd

View File

@ -9,6 +9,6 @@ if len(sys.argv) < 2:
version = sys.argv[1] version = sys.argv[1]
with open("galaxy.yml.in") as f: with open("galaxy.yml.in") as f:
y = yaml.safe_load(f) y = yaml.safe_load(f)
y['version'] = version y["version"] = version
with open("galaxy.yml", "w") as ff: with open("galaxy.yml", "w") as ff:
yaml.safe_dump(y, ff) yaml.safe_dump(y, ff)

29
contrib/build_docs.sh Executable file
View File

@ -0,0 +1,29 @@
#!/usr/bin/bash
DOCS=${1:-$HOME/podman-docs}
COLL_DIR="/tmp/docs_new_path/ansible_collections/containers/podman"
DOCS_TMP="${COLL_DIR}/tmpdocs"
HTML="${DOCS_TMP}/build/html"
# Build current collection
rm -rf /tmp/docs_new_collection
ansible-galaxy collection build --output-path /tmp/docs_new_collection --force
pkg=$(ls -t /tmp/docs_new_collection/* | head -1)
ansible-galaxy collection install -vvv --force $pkg -p /tmp/docs_new_path
pushd /tmp/docs_new_path/ansible_collections/containers/podman
mkdir -p $DOCS_TMP
chmod g-w $DOCS_TMP
ANSIBLE_COLLECTIONS_PATH=../../../ antsibull-docs sphinx-init --use-current --dest-dir $DOCS_TMP containers.podman
pushd $DOCS_TMP
python -m venv .env
source .env/bin/activate
pip install -r requirements.txt
# sed -i "s@--use-current@--squash-hierarchy --use-current@g" build.sh
ANSIBLE_COLLECTIONS_PATH=../../../../ ./build.sh
rm -rf "$HTML/_sources" "$HTML/.buildinfo" "$HTML/.doctrees"
cp -r $HTML/* $DOCS/
popd
popd

16
contrib/build_rpm.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh
export PKG_NAME=ansible-podman-collections
export TMPINSTALLDIR=/tmp/${PKG_NAME}-fpm-install
export VERSION=$(python3 setup.py --version 2>/dev/null | sed "s/\([0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/g")
rm -rf "${TMPINSTALLDIR}"
mkdir -p ~/rpmbuild/SOURCES/
mkdir -p "${TMPINSTALLDIR}/${PKG_NAME}-${VERSION}"
cp -r * ${TMPINSTALLDIR}/${PKG_NAME}-${VERSION}/
tar -zcvf ~/rpmbuild/SOURCES/${VERSION}.tar.gz -C ${TMPINSTALLDIR} ${PKG_NAME}-${VERSION}
cp ansible-collection-containers-podman.spec ansible-collection-containers-podman-build.spec
sed -i "s/Version:.*/Version: ${VERSION}/g" ansible-collection-containers-podman-build.spec
sed -i "s/Release:.*/Release: 999%{?dist}/g" ansible-collection-containers-podman-build.spec
sed -i "s/^version: .*/version: ${VERSION}/" ${TMPINSTALLDIR}/${PKG_NAME}-${VERSION}/galaxy.yml
rpmbuild -bb ansible-collection-containers-podman-build.spec

View File

@ -1,3 +1,2 @@
PyYAML PyYAML
galaxy-importer #galaxy-importer
virtualenv

View File

@ -10,7 +10,7 @@ ANSIBLE_GALAXY_BIN=${GALAXY_PATH:-'ansible-galaxy'}
echo "Start building collection" echo "Start building collection"
echo "Generating galaxy.yml for version $1" echo "Generating galaxy.yml for version $1"
./contrib/build.py "$1" ${PYTHON_PATH:-python} ./contrib/build.py "$1"
rm -rf build_artifact rm -rf build_artifact
mkdir -p build_artifact mkdir -p build_artifact
@ -20,11 +20,15 @@ COLLECTION_P=$(ls build_artifact/*tar.gz)
echo "Publishing collection $COLLECTION_P" echo "Publishing collection $COLLECTION_P"
output=$(python -m galaxy_importer.main $COLLECTION_P) # output=$(${PYTHON_PATH:-python} -m galaxy_importer.main $COLLECTION_P)
if echo $output | grep ERROR: ; then # if echo $output | grep ERROR: ; then
echo "Failed check of galaxy importer!" # echo "Failed check of galaxy importer!"
exit 1 # exit 1
fi # fi
echo "Running: ${ANSIBLE_GALAXY_BIN} collection publish --api-key HIDDEN $COLLECTION_P" echo "Running: ${ANSIBLE_GALAXY_BIN} collection publish --api-key HIDDEN $COLLECTION_P"
${ANSIBLE_GALAXY_BIN} collection publish --api-key $API_GALAXY_TOKEN $COLLECTION_P if [[ "${DRYRUN:-0}" == "1" ]]; then
${ANSIBLE_GALAXY_BIN} collection publish --api-key testkey $COLLECTION_P || true
else
${ANSIBLE_GALAXY_BIN} collection publish --api-key $API_GALAXY_TOKEN $COLLECTION_P
fi

Some files were not shown because too many files have changed in this diff Show More