manage_apt_packages/molecule/default/verify.yml

32 lines
858 B
YAML
Raw Normal View History

---
- name: Verify
hosts: all
2023-12-03 16:45:22 +00:00
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'
2023-06-13 20:43:23 +00:00
- name: "Test: package vim"
block:
- name: "Get packages facts"
ansible.builtin.package_facts:
manager: auto
2023-06-13 20:43:23 +00:00
- name: "Verify package vim"
ansible.builtin.assert:
that:
2023-06-30 21:46:04 +00:00
- "ansible_facts.packages['vim'][0]['name'] == 'vim'"