ceph-ansible/roles
Dimitri Savineau 6ba9c37fa5 container: inspect Id field instead of RepoDigests
When a container image managed by podman isn't tag anymore then the
RepoDigests field when inspecting the image doesn't return any value.
This is different from docker workflow and it breaks the ceph-ansible
container upgrade when collocated multiple services and using a non
fix container tag (like latest or 4).

$ podman images
REPOSITORY              TAG      IMAGE ID       CREATED        SIZE
docker.io/ceph/daemon   latest   680c9c0d38c3   8 days ago     957 MB
<none>                  <none>   011ee108bfc9   2 months ago   1.01 GB

$ podman inspect 680c9c0d38c3 | jq .[0].RepoDigests[0]
"docker.io/ceph/daemon@sha256:20cf789235e23ddaf38e109b391d1496bb88011239d16862c4c106d0e05fea9e"
$ podman inspect 011ee108bfc9 | jq .[0].RepoDigests[0]
null

Because this field returns "null" then the ansible task trying to
determine this value is failing

-----------------------------
fatal: [foo]: FAILED! =>
  msg: |-
    The task includes an option with an undefined variable. The error
    was: None has no element 0

    The error appears to be in
    'roles/ceph-container-common/tasks/fetch_image.yml': line 137,
    column 3, but may be elsewhere in the file depending on the exact
    syntax problem.

    The offending line appears to be:

    - name: set_fact ceph_osd_image_repodigest_before_pulling
      ^ here
-----------------------------

We don't have this behaviour with docker.

$ docker images
REPOSITORY              TAG      IMAGE ID       CREATED        SIZE
docker.io/ceph/daemon   latest   680c9c0d38c3   8 days ago     928 MB
docker.io/ceph/daemon   <none>   011ee108bfc9   2 months ago   986 MB

$ docker inspect 680c9c0d38c3 | jq .[0].RepoDigests[0]
"docker.io/ceph/daemon@sha256:45e6f28bb67c81b826acb64fad5c0da1cac3dffb41a88992fe4ca2be79575fa6"
$ docker inspect 011ee108bfc9 | jq .[0].RepoDigests[0]
"docker.io/ceph/daemon@sha256:b393a73309d72e43ca7d65cd3519036007947671e373eb59aa75a46185c52231"

Instead we should just get the Id field.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1844496

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>

(cherry picked from commit cdb30bd125)
2020-06-16 13:12:35 -04:00
..
ceph-client common: fix target_size_ratio task enablement 2020-06-03 13:22:57 -04:00
ceph-common Updated use of deprecated filter 2020-04-20 13:37:42 -04:00
ceph-config osd: use default crush rule name when needed 2020-03-31 19:42:40 -04:00
ceph-container-common container: inspect Id field instead of RepoDigests 2020-06-16 13:12:35 -04:00
ceph-container-engine ceph-container-engine: add CentOS 8 support 2020-04-23 13:26:29 +02:00
ceph-dashboard dashboard: allow disabling grafana api ssl verify 2020-06-15 17:33:05 +02:00
ceph-defaults dashboard: allow disabling grafana api ssl verify 2020-06-15 17:33:05 +02:00
ceph-facts facts: always set ceph_run_cmd and ceph_admin_command 2020-06-03 13:22:45 -04:00
ceph-fetch-keys meta: set the right minimum ansible version required for galaxy 2018-12-11 09:59:25 +01:00
ceph-grafana docker2podman: manage dashboard nodes 2020-06-03 13:20:24 -04:00
ceph-handler handler: add rgw multi-instances support 2020-03-12 19:04:26 -04:00
ceph-infra ceph-infra: open radosgw ports for multi instances 2020-03-12 19:04:26 -04:00
ceph-iscsi-gw Updated use of deprecated filter 2020-04-20 13:37:42 -04:00
ceph-mds common: fix target_size_ratio task enablement 2020-06-03 13:22:57 -04:00
ceph-mgr Updated use of deprecated filter 2020-04-20 13:37:42 -04:00
ceph-mon Updated use of deprecated filter 2020-04-20 13:37:42 -04:00
ceph-nfs ceph-nfs: bind mount ganesha log directory 2020-06-03 13:19:47 -04:00
ceph-node-exporter docker2podman: manage dashboard nodes 2020-06-03 13:20:24 -04:00
ceph-osd common: fix target_size_ratio task enablement 2020-06-03 13:22:57 -04:00
ceph-prometheus docker2podman: manage dashboard nodes 2020-06-03 13:20:24 -04:00
ceph-rbd-mirror Updated use of deprecated filter 2020-04-20 13:37:42 -04:00
ceph-rgw rgw multisite: add master zone endpoints to zonegroup 2020-06-09 12:30:05 -04:00
ceph-rgw-loadbalancer ceph-rgw-loadbalancer: Fix SSL newline issue 2020-02-17 11:36:09 -05:00
ceph-validate ceph-validate: Expand templates in rgw_create_pools 2020-06-03 13:18:43 -04:00