This Blog is to share our knowledge and expertise on Linux System Administration and VMware Administration

Friday, December 29, 2017

Enabling EPEL repository by using ansible playbook

Enabling EPEL repository by using ansible playbook

EPEL is the most important repository for Enterprise Linux and it contains a lot of additional packages. It's also a safe repository since no package in EPEL will conflict with packages in the base repository. To enable EPEL in RHEL/CentOS 7, it is enough to just install the epel-release package. To do so in Ansible, we will use:

$vi setup_epel.yaml

- name: Ensure EPEL is enabled 
  yum: 
    name: epel-release 
    state: present 
    become: True 

As you can see, we have used the yum module, specifying the name of the package and that we want it to be present.

Running this playbook
To instruct Ansible to execute a playbook instead of a module, we will have to use a command ansible-playbooks.

Syntax :  ansible-playbook -i HOST setup_epel.yaml

Command

$ ansible-playbook -i test01.fale.io setup_epel.yaml

here,

i   - group of server or server name (Inventory)

No comments:

Post a Comment