# Getting an undefined variable error in galaxy-role geerlingguy.repo-epel

**URL:** <https://forum.ansible.com/t/getting-an-undefined-variable-error-in-galaxy-role-geerlingguy-repo-epel/18808>\
**Category:** Ansible Project\
**Tags:** galaxy-ng\
**Created:** [July 20, 2015, 6:04pm UTC](https://forum.ansible.com/t/getting-an-undefined-variable-error-in-galaxy-role-geerlingguy-repo-epel/18808 "2015-07-20T18:04:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bob\_Brown1](https://avatars.discourse-cdn.com/v4/letter/b/dfb087/32.png) [@Bob\_Brown1](https://forum.ansible.com/u/Bob_Brown1)\
**Post date:** [July 20, 2015, 6:04pm UTC](https://forum.ansible.com/t/getting-an-undefined-variable-error-in-galaxy-role-geerlingguy-repo-epel/18808/1 "2015-07-20T18:04:17Z")

</div>

I’m trying to use galaxy roles for the first time and started with installing the geerlingguy.logstash role on an Amazon Linux Instance.

It mostly seems to work, at least up until it gets to the repo-epel role

I"m getting:

TASK: [geerlingguy.repo-epel | Install EPEL repo.] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [[ec2-54-237-72-83.compute-1.amazonaws.com](http://ec2-54-237-72-83.compute-1.amazonaws.com)] =\> One or more undefined variables: ‘dict object’ has no attribute u’NA’

It appears that the value of “ansible\_distribution\_major\_version” is showing as “NA”. I am using version 1.9.1 of ansible.

Do I need to restructure epel\_release or perhaps manually set ansible\_distribution\_major\_version someplace?

In the defaults/main.yml it is showing

epel\_release:  
“4”: 10  
“5”: 4  
“6”: 8  
“7”: 5

epel\_repo\_url: “[http://download.fedoraproject.org/pub/epel/{{](http://download.fedoraproject.org/pub/epel/%7B%7B) ansible\_distribution\_major\_version }}/{{ ansible\_userspace\_architecture }}{{ ‘/’ if ansible\_distribution\_major\_version \< ‘7’ else ‘/e/’ }}epel-release-{{ ansible\_distribution\_major\_version }}-{{ epel\_release[ansible\_distribution\_major\_version] }}.noarch.rpm”  
epel\_repo\_gpg\_key\_url: “/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-{{ ansible\_distribution\_major\_version }}”

I’m not sure how to adjust things to make it work correctly.

Any thoughts?

Bob

---

<div class="post-metadata">

**Author:** ![Greg\_DeKoenigsberg1](https://avatars.discourse-cdn.com/v4/letter/g/838e76/32.png) [@Greg\_DeKoenigsberg1](https://forum.ansible.com/u/Greg_DeKoenigsberg1)\
**Post date:** [July 20, 2015, 6:14pm UTC](https://forum.ansible.com/t/getting-an-undefined-variable-error-in-galaxy-role-geerlingguy-repo-epel/18808/2 "2015-07-20T18:14:06Z")

</div>

Galaxy roles are maintained by individual contributors in the Ansible  
community.

On the web page for each role, there's a link to the Github repo,  
where you can contact the author directly. That would be my advice.

--g

---

<div class="post-metadata">

**Author:** ![Bob\_Brown1](https://avatars.discourse-cdn.com/v4/letter/b/dfb087/32.png) [@Bob\_Brown1](https://forum.ansible.com/u/Bob_Brown1)\
**Post date:** [July 21, 2015, 4:26pm UTC](https://forum.ansible.com/t/getting-an-undefined-variable-error-in-galaxy-role-geerlingguy-repo-epel/18808/3 "2015-07-21T16:26:37Z")

</div>

Thanks.

Logged an Issue a few days ago at: [https://github.com/geerlingguy/ansible-role-repo-epel/issues/11](https://github.com/geerlingguy/ansible-role-repo-epel/issues/11)

Haven’t heard anything yet.

Bob

---

<div class="post-metadata">

**Author:** ![Scott\_Sturdivant](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@Scott\_Sturdivant](https://forum.ansible.com/u/Scott_Sturdivant)\
**Post date:** [July 21, 2015, 5:10pm UTC](https://forum.ansible.com/t/getting-an-undefined-variable-error-in-galaxy-role-geerlingguy-repo-epel/18808/4 "2015-07-21T17:10:29Z")

</div>

What’s the output of “python -c ‘import platform; print platform.dist()’” executed on the target ([ec2-54-237-72-83.compute-1.amazonaws.com](http://ec2-54-237-72-83.compute-1.amazonaws.com/))?

---

<div class="post-metadata">

**Author:** ![The\_Pax](https://avatars.discourse-cdn.com/v4/letter/t/b77776/32.png) [@The\_Pax](https://forum.ansible.com/u/The_Pax)\
**Post date:** [July 22, 2015, 11:05am UTC](https://forum.ansible.com/t/getting-an-undefined-variable-error-in-galaxy-role-geerlingguy-repo-epel/18808/5 "2015-07-22T11:05:51Z")

</div>

ansible\_distribution\_major\_version is a fact. Just don’t disable gathering facts.

---

<div class="post-metadata">

**Author:** ![Bob\_Brown1](https://avatars.discourse-cdn.com/v4/letter/b/dfb087/32.png) [@Bob\_Brown1](https://forum.ansible.com/u/Bob_Brown1)\
**Post date:** [July 27, 2015, 5:21am UTC](https://forum.ansible.com/t/getting-an-undefined-variable-error-in-galaxy-role-geerlingguy-repo-epel/18808/6 "2015-07-27T05:21:49Z")

</div>

Python 2.7.9 (default, Apr 1 2015, 18:18:03)  
[GCC 4.8.2 20140120 (Red Hat 4.8.2-16)] on linux2  
Type “help”, “copyright”, “credits” or “license” for more information.

> > > import platform  
> > > print platform.dist()  
> > > (‘’, ‘’, ‘’)
