gantsign / ansible-role-intellij

Ansible role for installing the IntelliJ IDEA IDE

Home Page:https://galaxy.ansible.com/gantsign/intellij

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ansible_local variable is undefined

erikthered opened this issue · comments

I'm seeing the following errors trying to run with Ansible 2.3.1.0

If intellij_default_jdk_home is not set:

fatal: [10.9.76.140]: FAILED! => {"failed": true, "msg": "The conditional check 'intellij_default_jdk_home not in (None, '')' failed. The error was: error while evaluating conditional (intellij_default_jdk_home not in (None, '')): {{ ansible_local.java.general.home }}: 'ansible_local' is undefined"}

if intellij_default_maven_home is not set:

fatal: [10.9.76.140]: FAILED! => {"failed": true, "msg": "The conditional check 'intellij_default_maven_home not in (None, '')' failed. The error was: error while evaluating conditional (intellij_default_maven_home not in (None, '')): {{ ansible_local.maven.general.home }}: 'ansible_local' is undefined"}

This role is designed to be used with https://github.com/gantsign/ansible-role-java, which sets ansible_local.java.general.home and https://github.com/gantsign/ansible-role-maven, which sets ansible_local.maven.general.home, if you don't use the companion roles you have to specify the location of the the JDK and Maven to this role (see the longer example playbook in the readme https://github.com/gantsign/ansible-role-intellij/blob/master/README.md#example-playbooks).

I'll see what I can do about making the error messages more helpful when not using the companion roles.

Thanks for reporting the issue.

Also came across this one today. My workaround was to set the intellij_default_jdk_home and intellij_default_maven_home variables at the role invocation, but I have no idea if those values are correct.

@erikthered & @brandonheller thank you for your feedback. Sorry it took so long, but the issue you reported is resolved in the 4.0.0 release. intellij_default_jdk_home has been removed and intellij_default_maven_home has been made optional.