Commit 3a95099d authored by godog's avatar godog

docker: add podman wrapper to detect new images

parent afb89e28
Pipeline #6070 passed with stage
in 7 minutes and 3 seconds
#!/bin/bash
# Detect if a different image has been pulled
set -u
image=${1:-}
if [ -z "$image" ]; then
echo "usage: <image url>"
exit 1
fi
pre_version=$(podman inspect --type image --format "{{.Id}}" $image)
podman pull $image
if [ $? -gt 0 ]; then
exit 1
fi
post_version=$(podman inspect --type image --format "{{.Id}}" $image)
if [ "$pre_version" == "$post_version" ]; then
exit 42
fi
......@@ -26,3 +26,9 @@
dest: /usr/bin/docker
state: link
force: true
- name: Install podman-pull-image script
copy:
src: podman-pull-image
dest: /usr/sbin/podman-pull-image
mode: 0755
......@@ -65,10 +65,11 @@
- name: Pull the Docker images
# Ansible >= 2.8 ships with podman_image
command: "podman pull {{ item.container.image }}"
command: "podman-pull-image {{ item.container.image }}"
register: podman_image
when: "container_runtime == 'podman'"
loop: "{{ float_enabled_containers }}"
changed_when: "podman_image.rc == 0"
- name: Start the systemd units
systemd:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment