You've already forked ansible-role-repo-epel
38 lines
864 B
YAML
38 lines
864 B
YAML
---
|
|
# This is an example playbook to execute Ansible tests.
|
|
|
|
- name: Verify
|
|
hosts: all
|
|
tasks:
|
|
- name: Retrieve yum repofile
|
|
ansible.builtin.shell: cat /etc/yum.repos.d/epel.repo
|
|
ignore_errors: true
|
|
register: repofile
|
|
|
|
- name: Output repofile
|
|
ansible.builtin.debug:
|
|
var: repofile
|
|
|
|
- name: Metalink is present
|
|
ansible.builtin.assert:
|
|
that:
|
|
- "'metalink=' in repofile.stdout"
|
|
|
|
# - name: baseurl is not defined
|
|
# assert:
|
|
# that:
|
|
# - "'baseurl=' not in repofile.stdout"
|
|
|
|
- name: Try to install htop from EPEL
|
|
ansible.builtin.package:
|
|
name: htop
|
|
state: installed
|
|
|
|
- name: Gather the rpm package facts
|
|
ansible.builtin.package_facts:
|
|
manager: auto
|
|
|
|
- name: Is htop actually installed?
|
|
ansible.builtin.assert:
|
|
that: "'htop' in ansible_facts.packages"
|