Getting an undefined variable error
efreedom79 opened this issue · 11 comments
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'
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.
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.
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?
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
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.
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
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.
Nice! And for Kibana, there's an issue for that: geerlingguy/ansible-role-kibana#4
I'll get around to it soon, unless someone else can submit a PR to do all the work for me first :)
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 ?
me too...
@SambaSivaReddyB @kaihei777 are you running the latest version of this role?