Need Guidance

15 views
Skip to first unread message

Amar Subudhi

unread,
Jul 28, 2020, 11:44:59 AM7/28/20
to Ansible Project
Hi Experts,

I am getting the below error while executing the playbook.
Thanks in Advance.

Playbook- 

- name: RedHat unlock OpenJdk version
  command: yum versionlock delete '{{openjdk_yumlock_version7}}'
  when: ansible_distribution_major_version == "7"
  ignore_errors: yes

Error
TASK [openjdk : RedHat unlock OpenJdk version] **********************************************************************************************************************************************************************************************
Tuesday 28 July 2020  10:54:25 -0400 (0:00:00.106)       0:00:03.705 **********
fatal: [hsdsqa09]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'openjdk_yumlock_version7' is undefined\n\nThe error appears to have been in '/opt/hd/sh/srv/ansible/development/axs8u3p/hadoop/roles/openjdk/tasks/main.yml': line 9, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: RedHat unlock OpenJdk version\n  ^ here\n"}
...ignoring


Playbook
- name: install openjdk from rhel-x86_64-server-7-datacenter
  package:
     name: "{{openjdk_package_name7}}"
     state: present
  when: ansible_distribution_major_version == "7"

Error
TASK [openjdk : install openjdk from rhel-x86_64-server-7-datacenter] ***********************************************************************************************************************************************************************
Tuesday 28 July 2020  10:54:26 -0400 (0:00:00.105)       0:00:03.916 **********
fatal: [hsdsqa09]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'openjdk_package_name7' is undefined\n\nThe error appears to have been in '/opt/hd/sh/srv/ansible/development/axs8u3p/hadoop/roles/openjdk/tasks/main.yml': line 20, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: install openjdk from rhel-x86_64-server-7-datacenter\n  ^ here\n"}

Dick Visser

unread,
Jul 28, 2020, 11:56:31 AM7/28/20
to ansible...@googlegroups.com
Hi Amar

On Tue, 28 Jul 2020 at 17:45, Amar Subudhi <amars...@gmail.com> wrote:
>
> Hi Experts,
>
> I am getting the below error while executing the playbook.

It says exactly what is wrong here:

> The task includes an option with an undefined variable. The error was: 'openjdk_yumlock_version7' is undefined





--
Dick Visser
Trust & Identity Service Operations Manager
GÉANT

Karl Auer

unread,
Jul 28, 2020, 12:15:00 PM7/28/20
to ansible-project
There needs to be a variable called "openjdk_yumlock_version7" containing the actual value that needs to follow the word "delete" in that command.

You are seeing that error because there is no such variable.

Regards, K.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/8f2cd7f4-dcfd-4eb1-b92f-8d29825332dao%40googlegroups.com.


--

Karl Auer { manager, systems support }
P: 1300 759 975
E: ka...@2pisoftware.com
2pisoftware.com

GPG/PGP : DF6A 43E5 FB9D D884 C6CA CD7F 5278 212D E80F C107
Previous: 301B 1F4E 624D AD99 242C 7A68 EC24 7113 E854 4A4E
Reply all
Reply to author
Forward
0 new messages