added default test for container health

This commit is contained in:
Bertrand Lanson 2023-05-26 22:19:56 +02:00
parent a676159989
commit 11702792f3
2 changed files with 30 additions and 2 deletions

View File

@ -1,9 +1,23 @@
--- ---
# This is an example playbook to execute Ansible tests.
- name: Verify - name: Verify
hosts: all hosts: all
gather_facts: false gather_facts: false
tasks: tasks:
- name: "Test: file /etc/hosts"
block:
- name: "Stat file /etc/hosts"
ansible.builtin.stat:
path: "/etc/hosts"
register: stat_etc_hosts
- name: "Verify file /etc/hosts"
ansible.builtin.assert:
that:
- stat_etc_hosts.stat.exists
- stat_etc_hosts.stat.isreg
- stat_etc_hosts.stat.pw_name == 'root'
- stat_etc_hosts.stat.gr_name == 'root'
- name: "Test: directory /usr/local/share/ca-certificates" - name: "Test: directory /usr/local/share/ca-certificates"
block: block:
- name: "Stat directory /usr/local/share/ca-certificates" - name: "Stat directory /usr/local/share/ca-certificates"

View File

@ -1,9 +1,23 @@
--- ---
# This is an example playbook to execute Ansible tests.
- name: Verify - name: Verify
hosts: all hosts: all
gather_facts: false gather_facts: false
tasks: tasks:
- name: "Test: file /etc/hosts"
block:
- name: "Stat file /etc/hosts"
ansible.builtin.stat:
path: "/etc/hosts"
register: stat_etc_hosts
- name: "Verify file /etc/hosts"
ansible.builtin.assert:
that:
- stat_etc_hosts.stat.exists
- stat_etc_hosts.stat.isreg
- stat_etc_hosts.stat.pw_name == 'root'
- stat_etc_hosts.stat.gr_name == 'root'
- name: "Test: directory /usr/local/share/ca-certificates" - name: "Test: directory /usr/local/share/ca-certificates"
block: block:
- name: "Stat directory /usr/local/share/ca-certificates" - name: "Stat directory /usr/local/share/ca-certificates"