Yumrepo is not being located in ansible 2.1 using Ansible Tower

I am trying to use yumrepo https://docs.ansible.com/ansible/yumrepo_module.html
and it states that it is new in version 2.1

So i went ahead and updated ansible on my ansible tower machine:

`

sudo yum -y install git asciidoc rpm-build python2-devel
cd ~
git clone git://github.com/ansible/ansible.git --recursive
cd ansible

make rpm

sudo yum -y install rpm-build/ansible-2.1.0-0.git201603201549.6824f3a.devel.el7.centos.noarch.rpm

`

So now when I run ansible --version I get the following:

`

ansible 2.1.0
config file = /etc/ansible/ansible.cfg
configured module search path = Default w/o overrides

`

Now when I try to run my playbook (particularly this command in my role) :

`


- name: Add GOsa2 Repo
  yumrepo:
    name: GOsa Repository
    baseurl: http://oss.gonicus.de/pub/gosa/redhat
    gpgcheck: no
    enabled: yes

`

Ansible Tower 2.4.4 complains with the following error:

`
Using /etc/ansible/ansible.cfg as config file SSH password: SUDO password[defaults to SSH password]: ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path. The error appears to have been in ‘/var/lib/awx/projects/_8__my_repo/ansible/roles/gosa/tasks/main.yml’: line 17, column 3, but may be elsewhere in the file depending on the exact syntax problem. The offending line appears to be: - name : Add GOsa2 Repo ^ here The error appears to have been in ‘/var/lib/awx/projects/_8__my_repo/ansible/roles/gosa/tasks/main.yml’: line 17, column 3, but may be elsewhere in the file depending on the exact syntax problem. The offending line appears to be: - name : Add GOsa2 Repo ^ here

`

Can anyone help me with this as I don’t have any clue why it’s not detecting yumrepo at this point.

Tower isn’t using that version of Ansible, I believe it is still using Ansible 2.0 (or possibly earlier). I don’t think using arbitrary versions of Ansible is supported with Tower.

yumrepo was renamed to yum_repository somewhat recently.

You will need to use yum_repository instead. My guess is the docs haven’t been updated yet.