diff --git a/defaults/main.yml b/defaults/main.yml index 7496c51..7bf955b 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,2 +1,3 @@ --- jdk_version: 17.0.2 +install_jdk_in_user_dir_on_linux: false diff --git a/tasks/main.yml b/tasks/main.yml index e429dbf..6993104 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -20,7 +20,7 @@ - name: Set destination directory based on OS ansible.builtin.set_fact: - jdk_dest: "{{ (ansible_facts.system == 'Linux') | ternary('/opt', ansible_facts.user_dir) }}" + jdk_dest: "{{ (ansible_facts.system == 'Linux' and not install_jdk_in_user_dir_on_linux) | ternary('/opt', ansible_facts.user_dir) }}" - name: Print jdk_dest ansible.builtin.debug: