diff --git a/molecule/default/verify.yml b/molecule/default/verify.yml index 29b6c1d..47a9f72 100644 --- a/molecule/default/verify.yml +++ b/molecule/default/verify.yml @@ -1,9 +1,23 @@ --- -# This is an example playbook to execute Ansible tests. - name: Verify hosts: all gather_facts: false 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" block: - name: "Stat directory /usr/local/share/ca-certificates" diff --git a/molecule/with_custom_ca/verify.yml b/molecule/with_custom_ca/verify.yml index 4a028a6..977fce5 100644 --- a/molecule/with_custom_ca/verify.yml +++ b/molecule/with_custom_ca/verify.yml @@ -1,9 +1,23 @@ --- -# This is an example playbook to execute Ansible tests. - name: Verify hosts: all gather_facts: false 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" block: - name: "Stat directory /usr/local/share/ca-certificates"