Need Guidance

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

Hi Amar

Hi Experts,

I am getting the below error while executing the playbook.

It says exactly what is wrong here:

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.