geerlingguy / ansible-role-repo-epel

Ansible Role - EPEL Repository for RHEL/CentOS
https://galaxy.ansible.com/geerlingguy/repo-epel/
MIT License
185 stars 149 forks source link

Getting an undefined variable error #11

Closed efreedom79 closed 9 years ago

efreedom79 commented 9 years ago

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

efreedom79 commented 9 years ago

So 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/{{ 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.

geerlingguy commented 9 years ago

What kind of OS are you running? The role is set up for RHEL/CentOS, but other derivatives might not be set up properly, and in that case, you can manually knock things into submission by adding a task like the following before running the roles:

pre_tasks:
  - set_fact:
      ansible_distribution_major_version: "6"

This is assuming you're running the equivalent of RHEL/CentOS 6... change it according to what major version of RHEL your OS is emulating/derived from.

efreedom79 commented 9 years ago

I'm using the current Amazon Linux Distribution. The AMI description is "Amazon Linux AMI 2015.03 (HVM), SSD Volume Type - ami-1ecae776"

cat /proc/version Linux version 3.14.44-32.39.amzn1.x86_64 (mockbuild@gobi-build-64011) (gcc version 4.8.2 20140120 (Red Hat 4.8.2-16) (GCC) ) #1 SMP Thu Jun 11 20:33:38 UTC 2015

So I'm not sure how to determine the major version? Is it "4" from the Red Hat 4.8.2-16?

efreedom79 commented 9 years ago

Tried using "4" in the pre_tasks as you suggested. Got back this error:

TASK: [geerlingguy.repo-epel | Import EPEL GPG key.] ** failed: [ec2-54-237-72-83.compute-1.amazonaws.com] => {"failed": true} msg: Not a valid key /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-4

geerlingguy commented 9 years ago

I think you might want to try 6 instead of 4, as it seems 2015.03 may be based more on RHEL 6.0 packages and that version of EPEL.

efreedom79 commented 9 years ago

Much better. It gets past the repo issue. The error is now:

TASK: [geerlingguy.kibana | Create Kibana user account.] ** failed: [ec2-54-237-72-83.compute-1.amazonaws.com] => {"failed": true} msg: This module requires the passlib Python library

efreedom79 commented 9 years ago

and it looks like add "pip: name=passlib" into the Kibana role and everything works! Hmm, Kibana 3. Any plans to upgrade to Kibana 4?

Thanks for your help.

geerlingguy commented 9 years ago

Nice! And for Kibana, there's an issue for that: https://github.com/geerlingguy/ansible-role-kibana/issues/4

I'll get around to it soon, unless someone else can submit a PR to do all the work for me first :)

SambaSivaReddyB commented 6 years ago

TASK [ansible-role-repo-epel : Import EPEL GPG key.] *** task path: /etc/ansible/roles/ansible-role-repo-epel/tasks/main.yml:22 fatal: [52.53.194.111]: FAILED! => {"changed": false, "msg": "Not a valid key /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7"}

[ec2-user@ip-172-31-12-11 ~]$ cat /etc/redhat-release Red Hat Enterprise Linux Server release 7.5 (Maipo) How to solve Not a valid key /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 ?

kaihei777 commented 3 years ago

me too...

geerlingguy commented 3 years ago

@SambaSivaReddyB @kaihei777 are you running the latest version of this role?