update_motd/molecule/with_custom_ascii/verify.yml
Bertrand Lanson 2ed6f6ce8b
All checks were successful
test / Linting (push) Successful in 20s
test / Molecule tests (default, debian11) (push) Successful in 56s
test / Molecule tests (default, debian12) (push) Successful in 1m8s
test / Molecule tests (default, ubuntu2004) (push) Successful in 1m0s
test / Molecule tests (with_custom_ascii, debian11) (push) Successful in 56s
test / Molecule tests (default, ubuntu2204) (push) Successful in 1m24s
test / Molecule tests (with_custom_ascii, debian12) (push) Successful in 1m8s
test / Molecule tests (with_custom_ascii, ubuntu2004) (push) Successful in 59s
test / Molecule tests (with_custom_ascii, ubuntu2204) (push) Successful in 1m7s
feat: remove become from role, fix #1
2023-12-03 18:26:11 +01:00

29 lines
1.1 KiB
YAML

---
- name: Verify
hosts: all
gather_facts: true
become: true
tasks:
- name: "Test: file /etc/profile.d/motd.cfg"
block:
- name: "Stat file /etc/profile.d/motd.cfg"
ansible.builtin.stat:
path: "/etc/profile.d/motd.cfg"
register: stat_etc_profile_d_motd_cfg
- name: "Slurp file /etc/profile.d/motd.cfg"
ansible.builtin.slurp:
src: "/etc/profile.d/motd.cfg"
register: slurp_etc_profile_d_motd_cfg
- name: "Verify file /etc/profile.d/motd.cfg"
ansible.builtin.assert:
that:
- stat_etc_profile_d_motd_cfg.stat.exists
- stat_etc_profile_d_motd_cfg.stat.isreg
- stat_etc_profile_d_motd_cfg.stat.pw_name == 'root'
- stat_etc_profile_d_motd_cfg.stat.gr_name == 'root'
- stat_etc_profile_d_motd_cfg.stat.mode == '0644'
- "'print_info()' in (slurp_etc_profile_d_motd_cfg.content|b64decode)"
- "'ascii_distro=\"{{ ansible_distribution|lower|string }}_small\"' in (slurp_etc_profile_d_motd_cfg.content|b64decode)"