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 48bf764
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 @@
---
# 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

- when: container_status.stdout | length == 0
block:
- 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 48bf764

Please sign in to comment.