dns_resolver_conf/molecule/default_vagrant/verify.yml
Bertrand Lanson c69bb51830
All checks were successful
test / Linting (push) Successful in 9s
test / Molecule tests (default, debian11) (push) Successful in 31s
test / Molecule tests (default, debian12) (push) Successful in 35s
test / Molecule tests (default, ubuntu2004) (push) Successful in 32s
test / Molecule tests (default, ubuntu2204) (push) Successful in 31s
test / Molecule tests (with_custom_config, debian12) (push) Successful in 31s
test / Molecule tests (with_custom_config, debian11) (push) Successful in 37s
test / Molecule tests (with_custom_config, ubuntu2004) (push) Successful in 32s
test / Molecule tests (with_custom_config, ubuntu2204) (push) Successful in 38s
feat(testing): remove /etc/hosts tests, fix #3
2023-12-08 19:55:14 +01:00

30 lines
1.0 KiB
YAML

---
- name: Verify
hosts: all
gather_facts: true
become: true
tasks:
- name: "Test: file /tmp/resolv.conf"
block:
- name: "Stat file /tmp/resolv.conf"
ansible.builtin.stat:
path: "/tmp/resolv.conf"
register: stat_tmp_resolv_conf
- name: "Slurp file /tmp/resolv.conf"
ansible.builtin.slurp:
src: "/tmp/resolv.conf"
register: slurp_tmp_resolv_conf
- name: "Verify file /tmp/resolv.conf"
ansible.builtin.assert:
that:
- stat_tmp_resolv_conf.stat.exists
- stat_tmp_resolv_conf.stat.isreg
- stat_tmp_resolv_conf.stat.pw_name == 'root'
- stat_tmp_resolv_conf.stat.gr_name == 'root'
- stat_tmp_resolv_conf.stat.mode == '0644'
- "'search local.lan' in (slurp_tmp_resolv_conf.content|b64decode)"
- "'nameserver 1.1.1.1' in (slurp_tmp_resolv_conf.content|b64decode)"
- "'nameserver 8.8.8.8' in (slurp_tmp_resolv_conf.content|b64decode)"