Skip to content

Instantly share code, notes, and snippets.

@mariusv
Last active February 28, 2024 21:06
Show Gist options
  • Save mariusv/71e6e75941d495956234 to your computer and use it in GitHub Desktop.
Save mariusv/71e6e75941d495956234 to your computer and use it in GitHub Desktop.
Ansible playbook to enable EPEL + REMI repo. Tested on CentOS 6+ and RHEL 7
---
- hosts: all
sudo: yes
tasks:
- name: Install EPEL repo.
yum:
name: https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm
state: present
- name: Import EPEL GPG key.
rpm_key:
key: /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-{{ ansible_distribution_major_version }}
state: present
- name: Install remi repo.
yum:
name: http://rpms.famillecollet.com/enterprise/remi-release-{{ ansible_distribution_major_version }}.rpm
state: present
- name: Import remi GPG key.
rpm_key:
key: http://rpms.remirepo.net/RPM-GPG-KEY-remi
state: present
@gehendraa
Copy link

May need to import the keys prior to installing the repo

@nbro
Copy link

nbro commented Apr 5, 2022

Isn't sudo: yes deprecated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment