# Need Guidance

**URL:** <https://forum.ansible.com/t/need-guidance/33511>\
**Category:** Ansible Project\
**Tags:** rhel\
**Created:** [July 28, 2020, 3:44pm UTC](https://forum.ansible.com/t/need-guidance/33511 "2020-07-28T15:44:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![A11](https://avatars.discourse-cdn.com/v4/letter/a/b77776/32.png) [@A11](https://forum.ansible.com/u/A11)\
**Post date:** [July 28, 2020, 3:44pm UTC](https://forum.ansible.com/t/need-guidance/33511/1 "2020-07-28T15:44:59Z")

</div>

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”}

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [July 28, 2020, 3:55pm UTC](https://forum.ansible.com/t/need-guidance/33511/2 "2020-07-28T15:55:58Z")

</div>

Hi Amar

> Hi Experts,
> 
> I am getting the below error while executing the playbook.

It says exactly what is wrong here:

---

<div class="post-metadata">

**Author:** ![Karl\_Auer](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@Karl\_Auer](https://forum.ansible.com/u/Karl_Auer)\
**Post date:** [July 28, 2020, 4:14pm UTC](https://forum.ansible.com/t/need-guidance/33511/3 "2020-07-28T16:14:31Z")

</div>

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.
