I'm attempting to use a registered variable from the output from the containers.podman.podman_container_info ansible module. Basically I'm doing this the following
- name: checking if gitlab-runner is present
containers.podman.podman_container_info:
name: gitlab-runner
register: gitlabrunner_status
However, the next step I want to add a conditional to only run the next step if this container is defined based on the name. For testing I'm just using the debug module, so here is what I have tried.
- name: debug
debug:
var: gitlabrunner_status.containers.Name
- name: debug
debug:
var: gitlabrunner_status["containers"]["Name"]
each attempt I ended up getting VARIABLE IS NOT DEFINED! So how can I just pull the name from the output to use in a conditional, from this complex output.