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

generate_systemd: After= and more options #431

Closed
d-513 opened this issue May 27, 2022 · 2 comments · Fixed by #432
Closed

generate_systemd: After= and more options #431

d-513 opened this issue May 27, 2022 · 2 comments · Fixed by #432

Comments

@d-513
Copy link

d-513 commented May 27, 2022

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

/kind feature

Description

According to the generate-systemd manpage, the After= option can be specified to describe dependencies of a container.

According to podman_container docs there is no such option for this in the ansible module.

It would be really useful to have this. For example, I can have a database container and have an app require it to be running

d-513 pushed a commit to d-513/ansible-podman-collections-contrib that referenced this issue May 28, 2022
d-513 pushed a commit to d-513/ansible-podman-collections-contrib that referenced this issue May 28, 2022
d-513 pushed a commit to d-513/ansible-podman-collections-contrib that referenced this issue May 28, 2022
@brettinternet
Copy link

I recently switched to this module's generate_systemd option, and one of my services was unable to connect to a separate postgres container. Even after modifying the unit configuration file to include Requires=db.service and After=db.service I still had issues reconnecting on startup until I added RestartSec=5 to give the database startup some breathing room. 🤷‍♂️

You may consider including the RestartSec option as well. In the meantime, I'll add it with the lineinfile module.

@d-513
Copy link
Author

d-513 commented Jun 14, 2022

I recently switched to this module's generate_systemd option, and one of my services was unable to connect to a separate postgres container. Even after modifying the unit configuration file to include Requires=db.service and After=db.service I still had issues reconnecting on startup until I added RestartSec=5 to give the database startup some breathing room. 🤷‍♂️

You may consider including the RestartSec option as well. In the meantime, I'll add it with the lineinfile module.

I will add that option to my PR, if Podman generate-systemd has a switch for RestartSec.

sshnaidm pushed a commit to d-513/ansible-podman-collections-contrib that referenced this issue Aug 31, 2022
sshnaidm added a commit that referenced this issue Sep 1, 2022
…432)

* generate_systemd: implement --wants, --after and --requires (GH-431)

Signed-off-by: dada513 <[email protected]>
Signed-off-by: Sagi Shnaidman <[email protected]>
Co-authored-by: Sagi Shnaidman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants