Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alias parameters "stop_timeout" and "time" for podman generate systemd #683

Closed
fuljo opened this issue Dec 2, 2023 · 3 comments · Fixed by #685
Closed

Alias parameters "stop_timeout" and "time" for podman generate systemd #683

fuljo opened this issue Dec 2, 2023 · 3 comments · Fixed by #685

Comments

@fuljo
Copy link
Contributor

fuljo commented Dec 2, 2023

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind feature

Description

The problem involves the systemd part of module podman_container.
If using Podman version < 4 (e.g. from Ubuntu 22.04 LTS), parameter stop_timeout is not supported in podman generate systemd.
This was already present in v3, but it was named time, which is also a module parameter.

My proposal is to make stop_timeout and time aliases, so that:

  • either parameter (but not both) can be specified in the Ansible task
  • the parameter name fed to podman generate systemd is selected based on the detected Podman version

Version of the containers.podman collection:
Either git commit if installed from git: git show --summary
Or version from ansible-galaxy if installed from galaxy: ansible-galaxy collection list | grep containers.podman

commit edcb13dd8aff5959c98f25bafa9fda8e14a9dbc3
Author: Sergey <6213510+sshnaidm@users.noreply.github.com>
Date:   Thu Nov 30 16:04:51 2023 +0200

    Fail if systemd generation failed and it's explicitly set (#682)

Output of ansible --version:

ansible [core 2.16.0]
@fuljo
Copy link
Contributor Author

fuljo commented Dec 2, 2023

I'm already testing a prototype of this. Will update if everything is fine.
If the behavior is desirable, I will open a PR.

@fuljo
Copy link
Contributor Author

fuljo commented Dec 3, 2023

I'm just interested in discussing if the change is desirable.
I've already implemented it myself and can open a PR.

@sshnaidm
Copy link
Member

sshnaidm commented Dec 3, 2023

@fuljo sure, feel free to open

fuljo added a commit to fuljo/ansible-podman-collections that referenced this issue Dec 3, 2023
Closes containers#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>
sshnaidm added a commit that referenced this issue Dec 7, 2023
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants