Skip to content

Commit

Permalink
[common] Add debug to container tests when container is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
elfiesmelfie committed Feb 14, 2025
1 parent c651cc1 commit 1879e3d
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion roles/common/tasks/container_test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---

Check failure on line 1 in roles/common/tasks/container_test.yml

View workflow job for this annotation

GitHub Actions / build

load-failure[runtimeerror]

Failed to load YAML file

Check failure on line 1 in roles/common/tasks/container_test.yml

View workflow job for this annotation

GitHub Actions / build

load-failure[runtimeerror]

Failed to load YAML file
# The containers are run by root, so need to become true
# The containers are run by root, so need to become true
- name: Get container status
become: true
ansible.builtin.shell:
Expand All @@ -8,6 +8,19 @@
changed_when: false
register: container_status

- block:
when: container_status.stdout | length == 0
- name: Show the containers
ansible.builtin.shell:
cmd: |
podman ps -a --format "{{ '{{.Names}} {{.Status}}' }}"
changed_when: false
register: debug_output

- name: Show the output of container list
ansible.builtin.debug:
var: debug_output.stdout_lines

# NOTE: leaving the existing fail message to get the status and see if it is okay
- name: |
TEST Verify {{ container_name }} container status
Expand Down

0 comments on commit 1879e3d

Please sign in to comment.