Skip to content

getting the error; The error was: 'java_artifact' is undefined #121

@hectoralicea

Description

@hectoralicea
SUMMARY

getting error on ansible run

ISSUE TYPE
  • Bug Report
COMPONENT NAME

ansible-role-java

ANSIBLE VERSION
ha2021$ ansible --version
ansible 2.10.5
  config file = None
  configured module search path = ['/Users/ha2021/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.9/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.9.1 (default, Feb  3 2021, 07:04:15) [Clang 12.0.0 (clang-1200.0.32.29)]
[~/gitrepos/ansible-role-java] (master)

CONFIGURATION
ha2021$ ansible-config dump --only-changed
HOST_KEY_CHECKING(env: ANSIBLE_HOST_KEY_CHECKING) = False
OS / ENVIRONMENT

Ansible workstation is running:
MacOS 10.15.7

Server being configured is:
Red Hat Enterprise Linux 8.3 (Ootpa)

STEPS TO REPRODUCE
---
- name: Install AdoptOpenJDK
  hosts: dev_vm
  vars:
    - username: ansible
    - user_ssh_private_key: /Users/ha2021/gitrepos/ansible-bootstrap-server/ssh-keys/ansible-ssh-key.key
    - ansible_connection: ssh 
    - ansible_ssh_user: "{{ username }}"
    - ansible_ssh_private_key_file: "{{ user_ssh_private_key }}"

  roles:
    - role: java
      # adoptopenjdk does not work - gives error "The error was: 'java_artifact' is undefined"
      # java_download_path: /tmp
      # java_distribution: adoptopenjdk
      # transport: fallback
      # java_package: jre
      # adoptopenjdk_impl: hotspot
      # java_major_version: 13

      # openjdk 15 does not work - gives error "The error was: 'java_artifact' is undefined"
      java_distribution: openjdk
      transport: fallback
      java_major_version: 15
      java_setup_path: true
      java_download_path: /tmp
      java_tarball_install: true

      # openjdk 8 works
      # java_distribution: openjdk
      # transport: repositories
      # java_major_version: 8
      # java_setup_path: true
      # java_path: /usr/lib/jvm
      # java_tarball_install: false
      # java_alternative_priority: 100
      # java_unlimited_policy_enabled: false
EXPECTED RESULTS

java installs with no errors

ACTUAL RESULTS
TASK [java : Install java packages] **********************************************************************************************************************************************************************************
fatal: [172.X.X.X]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'java_artifact' is undefined\n\nThe error appears to be in '/Users/ha2021/gitrepos/ansible-role-java/roles/java/tasks/Linux/install/RedHat.yml': line 2, 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 java packages\n  ^ here\n"}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions