2022-09-09 21:24:34 +00:00
|
|
|
---
|
|
|
|
# This is an example playbook to execute Ansible tests.
|
|
|
|
|
|
|
|
- name: Verify
|
|
|
|
hosts: all
|
|
|
|
gather_facts: false
|
|
|
|
tasks:
|
2023-03-10 21:24:14 +00:00
|
|
|
- name: Include vars
|
|
|
|
include_vars:
|
2022-09-11 16:07:18 +00:00
|
|
|
file: ../../defaults/main.yml
|
|
|
|
|
2022-09-09 21:24:34 +00:00
|
|
|
- name: Get container state
|
|
|
|
docker_container_info:
|
2022-09-11 16:07:18 +00:00
|
|
|
name: "{{ hello_world_container_name }}"
|
2022-09-09 21:24:34 +00:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- name: Check Hello World is running
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- result.container['State']['Status'] == "running"
|
|
|
|
- result.container['State']['Restarting'] == false
|