2023-03-09 20:47:42 +00:00
|
|
|
---
|
|
|
|
- name: Verify
|
|
|
|
hosts: all
|
|
|
|
gather_facts: false
|
|
|
|
tasks:
|
|
|
|
- name: Include vars
|
|
|
|
ansible.builtin.include_vars:
|
|
|
|
file: ../../defaults/main.yml
|
|
|
|
|
2023-03-10 13:18:19 +00:00
|
|
|
- name: Get portainer container state
|
2023-03-09 20:47:42 +00:00
|
|
|
community.docker.docker_container:
|
2023-03-10 13:18:19 +00:00
|
|
|
name: "{{ portainer_container_name }}"
|
2023-03-09 20:47:42 +00:00
|
|
|
register: result
|
|
|
|
|
2023-03-10 13:18:19 +00:00
|
|
|
- name: Check if portainer containers are running
|
2023-03-09 20:47:42 +00:00
|
|
|
ansible.builtin.assert:
|
|
|
|
that:
|
|
|
|
- result.container['State']['Status'] == "running"
|
|
|
|
- result.container['State']['Restarting'] == false
|