2021-05-02 17:12:46 +12:00
|
|
|
---
|
|
|
|
|
# This is an example playbook to execute Ansible tests.
|
|
|
|
|
|
|
|
|
|
- name: Verify
|
|
|
|
|
hosts: all
|
|
|
|
|
tasks:
|
|
|
|
|
- name: Retrieve yum repofile
|
2023-08-19 23:13:56 +12:00
|
|
|
ansible.builtin.shell: cat /etc/yum.repos.d/epel.repo
|
2021-05-02 17:12:46 +12:00
|
|
|
ignore_errors: true
|
|
|
|
|
register: repofile
|
|
|
|
|
|
2023-08-19 23:13:56 +12:00
|
|
|
- name: Output repofile
|
|
|
|
|
ansible.builtin.debug:
|
2021-05-02 17:12:46 +12:00
|
|
|
var: repofile
|
|
|
|
|
|
2023-08-19 23:13:56 +12:00
|
|
|
- name: Metalink is present
|
|
|
|
|
ansible.builtin.assert:
|
2021-05-02 17:12:46 +12:00
|
|
|
that:
|
|
|
|
|
- "'metalink=' in repofile.stdout"
|
|
|
|
|
|
2023-08-19 22:38:57 +12:00
|
|
|
# - name: baseurl is not defined
|
|
|
|
|
# assert:
|
|
|
|
|
# that:
|
|
|
|
|
# - "'baseurl=' not in repofile.stdout"
|
2021-05-02 23:13:31 +12:00
|
|
|
|
2023-08-19 23:13:56 +12:00
|
|
|
- name: Try to install htop from EPEL
|
|
|
|
|
ansible.builtin.package:
|
2021-05-02 23:13:31 +12:00
|
|
|
name: htop
|
2023-08-19 23:13:56 +12:00
|
|
|
state: installed
|
2021-05-02 23:13:31 +12:00
|
|
|
|
|
|
|
|
- name: Gather the rpm package facts
|
2023-08-19 23:13:56 +12:00
|
|
|
ansible.builtin.package_facts:
|
2021-05-02 23:13:31 +12:00
|
|
|
manager: auto
|
|
|
|
|
|
2023-08-19 23:13:56 +12:00
|
|
|
- name: Is htop actually installed?
|
|
|
|
|
ansible.builtin.assert:
|
2021-05-02 23:17:27 +12:00
|
|
|
that: "'htop' in ansible_facts.packages"
|