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

549 commits

Author SHA1 Message Date
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