-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
podman_container with generate_systemd does not update image tag in systemd unit file #638
Comments
Change are not reflected on a unit file or in the container? I think there is a race condition, related to #585 since you use flag |
I believe both are unchanged. I tried playing with the |
If you leave this issue open and need more input, and it reproduces, my teammates will try to set the `restart_sec: 5`` and will let you know here on how it goes. (will leave my current position tomorrow and won't have access to the stack anymore) |
Yeah, leaving it opened until we find an appropriate solution for |
I can confirm that Example: #Part of the play
- name: Create example container
containers.podman.podman_container:
name: "example"
image: "yourImage"
state: "created"
image_strict: true
rm: true
publish: "8080:8080"
detach: true
privileged: false
read_only: true
tty: false
user: "1090:1090"
userns: "keep-id"
become_user: "myappuser"
notify:
- restart example
- name: Generate systemd unit file for example container
containers.podman.podman_generate_systemd:
dest: "/home/myappuser/.config/systemd/user"
name: "example"
new: true
no_header: true
restart_sec: 10
restart_policy: "always"
become_user: "myappuser"
notify:
- restart example #Role Handler:
- name: restart example
ansible.builtin.systemd:
name: "container-example.service"
state: "restarted"
scope: "user"
daemon_reload: true
become_user: "myappuser"
environment:
XDG_RUNTIME_DIR: "/run/user/1090" |
can confirm here aswell, it was strange not seeing the service file update with the new image tag version, but using: restart_sec: 10 (this is needed or your systemd file still won't be updated) Specified in containers.podman.podman_generate_systemd Thank you for sharing :) |
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Not sure if it's a feature that me and my colleague didn't expect (systemd units arenot overwritten), or a bug.
Description
Sometimes, when using
podman_container
, after I update the image tag in theimage
field or add volumes, the changes do not get reflected on the systemd unit file. Note that a unit file already exists, and that the debug logs clearly show the fields are accounted for by Ansible task, but do not make it to the unit file.Steps to reproduce the issue:
Generate a systemd unit with the podman_container task
Update some fields
Re-run the job
Describe the results you received:
Systemd unit file is based on old task filed.
Describe the results you expected:
Systemd unit file is using the new values.
Additional information you deem important (e.g. issue happens only occasionally):
Note that this does not always happen, it can sometimes work, but it seems to happen only on certain projects that do not look like they have anything special when we investigate.
Version of the
containers.podman
collection:happens on both
1.10.2
and1.9.4
Either git commit if installed from git:
git show --summary
commit 33b28086ec551cbbd3970d6deb5ac8bab567d202 (HEAD, tag: 1.9.4)
Or version from
ansible-galaxy
if installed from galaxy:ansible-galaxy collection list | grep containers.podman
1.10.2
Output of
ansible --version
:Output of
podman version
:Output of
podman info --debug
: (taken from one of the remote server that is the target of this task)Package info (e.g. output of
rpm -q podman
orapt list podman
):Playbok you run with ansible (e.g. content of
playbook.yaml
):Command line and output of ansible run with high verbosity
Please NOTE: if you submit a bug about idempotency, run the playbook with
--diff
option, like:ansible-playbook -i inventory --diff -vv playbook.yml
Additional environment details (AWS, VirtualBox, physical, etc.):
Virtual machine in a private cloud. Machine using strange agents that interract with the network like McAffee services.
The text was updated successfully, but these errors were encountered: