christiangda.epel_repo

Ansible Role: christiangda.epel_repo

Master branch workflow Develop branch workflow Ansible Role

This role helps you install the EPEL Repository.

To install this role, use the command ansible-galaxy install christiangda.epel_repo. You can find this role on the Ansible Galaxy repository here.

The repository code is available here.

Requirements

This role works on RedHat, CentOS, and Amazon Linux distributions:

  • RedHat: 6, 7, 8, 9
  • CentOS: 6, 7, 8
  • CentOS Stream: 8, 9
  • Rocky Linux: 8, 9
  • Oracle Linux: 8, 9
  • Amazon Linux: 1, 2

To check the compatibility of Python and Ansible, see the project Travis-CI build matrix.

Role Variables

Variable Default Value
epel_enable_extras_repos false
epel_debug false

More Details: Check the file defaults/main.yaml.

Dependencies

None.

Example Playbook

RedHat

- hosts: servers
  gather_facts: True
  roles:
    - role: christiangda.epel_repo
      vars:
        epel_enable_redhat_extras_repos: true

Redhat/CentOS 6/7/8

- hosts: servers
  gather_facts: True
  roles:
    - role: christiangda.epel_repo

Amazon Linux 1/2 (my-playbook.yml)

- hosts: all
  gather_facts: True
  become: true
  become_user: root
  become_method: sudo
  remote_user: ec2-user
  roles:
    - christiangda.epel_repo

Sample Inventory File

[all]
10.14.x.y
10.14.v.z

[amazon-1]
10.14.x.y

[amazon-2]
10.14.v.z
ansible-playbook my-playbook.yml \
    --inventory inventory \
    --private-key [~/location of my key.pem] \
    --become \
    --become-user=ec2-user \
    --user ec2-user

Development / Contributing

This role is tested with Molecule and developed using Python Virtual Environments.

We use two main git branches:

  • master
  • develop

To contribute:

References

Prepare your environment

  • Python 3
mkdir ansible-roles
cd ansible-roles/

python3 -m venv venv
source venv/bin/activate
pip install pip --upgrade
pip install ansible
pip install molecule
pip install 'molecule[docker]'
pip install 'molecule[podman]'
pip install 'molecule[lint]'
pip install molecule-vagrant
pip install python-vagrant
pip install selinux
pip install docker
pip install pytest
pip install pytest-mock
pip install pylint
pip install rope
pip install autopep8
pip install yamllint
pip install flake8
pip install ansible-lint
git clone https://github.com/<your github user>/ansible-role-epel-repo.git
ln -s ansible-role-epel-repo christiangda.epel_repo
cd christiangda.epel_repo

Run the molecule test

Available scenarios:

molecule list

Default scenario

Step by step:

molecule create [--scenario-name default]
molecule converge [--scenario-name default]
molecule verify [--scenario-name default]
molecule destroy [--scenario-name default]

Or all in one command:

molecule test [--scenario-name default]

If you want to test using VMs, check out the nice ansible-playground project using Vagrant and VirtualBox!

License

This module is licensed under the GNU General Public License Version 3:

Author Information

Installa
ansible-galaxy install christiangda.epel_repo
Licenza
gpl-3.0
Download
49.6k