Skip to content

Commit

Permalink
Force pull quay image even if already present (for debugging only)
Browse files Browse the repository at this point in the history
  • Loading branch information
harishsurf committed Jun 3, 2024
1 parent 7bf9502 commit 002031a
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,25 @@
src: ../templates/quay.service.j2
dest: "{{ systemd_unit_dir }}/quay-app.service"

- name: Check if Quay image is loaded
command: podman inspect --type=image {{ quay_image }}
register: q
ignore_errors: yes
# - name: Check if Quay image is loaded
# command: podman inspect --type=image {{ quay_image }}
# register: q
# ignore_errors: yes

# - name: Pull Quay image
# containers.podman.podman_image:
# name: "{{ quay_image }}"
# when: q.rc != 0
# retries: 5
# delay: 5

- name: Pull Quay image
containers.podman.podman_image:
name: "{{ quay_image }}"
when: q.rc != 0
retries: 5
delay: 5
register: result
until: result is succeeded

- name: Create Quay Storage named volume
containers.podman.podman_volume:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,28 @@
- name: Fail the playbook due to Quay not becoming alive
fail:
msg: "Quay did not become alive. Check debug logs above for details."

- name: Check if quay-app container log file exists
stat:
path: "/run/systemd/%n-quaypodlogs.log"
register: quay_log_file

- name: Read quay-app container log file
slurp:
src: "/run/systemd/%n-quaypodlogs.log"
register: quay_log_content
when: quay_log_file.stat.exists

- name: Debug quay-app container log content
debug:
msg: "{{ quay_log_content.content | b64decode }}"
when: quay_log_file.stat.exists

- name: Retrieve Podman logs for quay-app container
command: podman logs quay-app
register: podman_logs
ignore_errors: yes

- name: Debug Podman logs output
debug:
var: podman_logs.stdout_lines
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ExecStart=/usr/bin/podman run \
{{ quay_image }}

ExecStop=-/usr/bin/podman stop --ignore --cidfile %t/%n-cid -t 10
ExecStopPost=-/usr/bin/podman rm --ignore -f --cidfile %t/%n-cid
ExecStopPost=-/usr/bin/podman logs --cidfile %t/%n-cid > %t/%n-quaypodlogs.log
PIDFile=%t/%n-pid
KillMode=none
Restart=always
Expand Down

0 comments on commit 002031a

Please sign in to comment.