manage_apt_packages/molecule/default/verify.yml
Bertrand Lanson 3c1be4d599
All checks were successful
test / Linting (push) Successful in 18s
test / Molecule tests (default, debian12) (push) Successful in 46s
test / Molecule tests (default, ubuntu2004) (push) Successful in 51s
test / Molecule tests (default, debian11) (push) Successful in 1m5s
test / Molecule tests (default, ubuntu2204) (push) Successful in 42s
test / Molecule tests (with_custom_packages, debian11) (push) Successful in 1m16s
test / Molecule tests (with_custom_packages, debian12) (push) Successful in 1m22s
test / Molecule tests (with_custom_packages, ubuntu2004) (push) Successful in 1m35s
test / Molecule tests (with_custom_packages, ubuntu2204) (push) Successful in 1m48s
feat: remove become from role
2023-12-03 17:45:22 +01:00

32 lines
858 B
YAML

---
- name: Verify
hosts: all
gather_facts: true
become: true
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: package vim"
block:
- name: "Get packages facts"
ansible.builtin.package_facts:
manager: auto
- name: "Verify package vim"
ansible.builtin.assert:
that:
- "ansible_facts.packages['vim'][0]['name'] == 'vim'"