Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Error on Windows Server 2016

Open
#124 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
ansible, java
Domain
devops

Research direction

Start with tasks/Win32NT/finalize_paths.yml at line 12 and reproduce the reported playbook on Windows Server 2016 using Ansible 2.10.8. Trace why the Java path lookup has an empty sequence when using the jdk package, Chocolatey transport, and Java 11. Done means the role installs the Java SDK without the undefined-variable error or requiring manual directory creation.

Written by the indexing model from the issue text.

Description

SUMMARY

Got an error:

TASK [lean_delivery.java : Set actual java directory] ****************************************************************************************************************************************************************************************************************************************
fatal: [win-iiq]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: No last item, sequence was empty.\n\nThe error appears to be in '/etc/ansible/roles/lean_delivery.java/tasks/Win32NT/finalize_paths.yml': line 12, 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: Set actual java directory\n ^ here\n"}

ISSUE TYPE
  • Bug Report
ANSIBLE VERSION
ansible 2.10.8
  config file = None
  configured module search path = ['/home/vagrant/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.9.6 (default, Jun 29 2021, 10:19:25) [GCC 10.3.0]

CONFIGURATION
OS / ENVIRONMENT

Windows Server 2016 obtained via vagrant box "jborean93/WindowsServer2016"

STEPS TO REPRODUCE
---

- name: Install openjdk java
  hosts: win-dev
  
  roles:
    - role: lean_delivery.java
      java_package: jdk
      transport: chocolatey
      java_major_version: 11
      java_minor_version: 0.2
  

EXPECTED RESULTS

Java SDK installed on the system

ACTUAL RESULTS
TASK [lean_delivery.java : Set actual java directory] ****************************************************************************************************************************************************************************************************************************************
fatal: [win-iiq]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: No last item, sequence was empty.\n\nThe error appears to be in '/etc/ansible/roles/lean_delivery.java/tasks/Win32NT/finalize_paths.yml': line 12, 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: Set actual java directory\n  ^ here\n"}

Folder c:\Program Files\Java doesn't get created
If I create it manually, same error happens.
Dominant language
Jinja
Stars
60
Forks
30
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lean-delivery/ansible-role-java

All issues in lean-delivery/ansible-role-java

Similar issues

More DevOps issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.