Bertrand Lanson
2a3e54aa53
All checks were successful
test / Linting (push) Successful in 29s
test / Molecule tests (default, ubuntu2204) (push) Successful in 1m3s
test / Molecule tests (default, debian12) (push) Successful in 1m36s
test / Molecule tests (with_custom_packages, debian11) (push) Successful in 1m37s
test / Molecule tests (with_custom_packages, debian12) (push) Successful in 1m31s
test / Molecule tests (with_custom_packages, ubuntu2004) (push) Successful in 1m57s
test / Molecule tests (with_custom_packages, ubuntu2204) (push) Successful in 1m48s
test / Molecule tests (default, debian11) (push) Successful in 56s
test / Molecule tests (default, ubuntu2004) (push) Successful in 50s
38 lines
1.3 KiB
YAML
38 lines
1.3 KiB
YAML
---
|
|
- name: Verify
|
|
hosts: all
|
|
gather_facts: 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"
|
|
vars:
|
|
etc_hosts_group:
|
|
ubuntu: "adm"
|
|
debian: "root"
|
|
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 == etc_hosts_group[(ansible_distribution|lower)]
|
|
|
|
- name: "Test: packages mariadb-server, apache2, consul:1.13.1-1"
|
|
block:
|
|
- name: "Get packages facts"
|
|
ansible.builtin.package_facts:
|
|
manager: auto
|
|
|
|
- name: "Verify packages mariadb-server, apache2, consul:1.13.1-1"
|
|
ansible.builtin.assert:
|
|
that:
|
|
- "ansible_facts.packages['mariadb-server'][0]['name'] == 'mariadb-server'"
|
|
- "ansible_facts.packages['apache2'][0]['name'] == 'apache2'"
|
|
- "ansible_facts.packages['consul'][0]['name'] == 'consul'"
|
|
- "ansible_facts.packages['consul'][0]['version'] == '1.13.1-1'"
|