I have installed ansible to make automation deploy my system and i need some extra module to work with it. I downloaded module yumrepo.py on ansible github and add it to my library directory. But when i run, it show error ERROR: yumrepo is not a legal parameter of an Ansible Play
. Here is my configuration in file ansible.cfg.
inventory = /etc/ansible/hosts
library = /etc/ansible/module/
remote_tmp = $HOME/.ansible/tmp
and my playbook
---
- name: Add multiple repositories into the same file (1/2)
yumrepo:
name: epel
description: EPEL YUM repo
file: external_repos
baseurl: http://download.fedoraproject.org/pub/epel/$releasever/$basearch/
gpgcheck: no
Hope anybody help me. Thank so much
Best Answer
Which repository did you download
yumrepo.py
from?What you should probably be using instead is the
ansible-yumrepo
role : https://github.com/picotrading/ansible-yumrepo (See here for more about roles)You can install this in a
roles
directory which can be in the same directory as your playbook. I found I needed to rename the role fromansible-yumrepo
toyumrepo
locally when I cloned the repository from github.Then the following playbook can be used as a starting point for what you want to do: