* 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>
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>
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>
* 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>
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>
* 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>
* 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>
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>
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>
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>
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>
* 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>