From fc4fd35750ea106c917d56fd8062998346f06da0 Mon Sep 17 00:00:00 2001 From: Conor Finn Date: Tue, 6 Jun 2023 15:26:49 +0100 Subject: [PATCH] Symlink java11 to make sure it's in the path RE #62 --- macOS/jenkins-node/ansible/roles/agent/tasks/main.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/macOS/jenkins-node/ansible/roles/agent/tasks/main.yml b/macOS/jenkins-node/ansible/roles/agent/tasks/main.yml index ffd4a26..03a6e25 100644 --- a/macOS/jenkins-node/ansible/roles/agent/tasks/main.yml +++ b/macOS/jenkins-node/ansible/roles/agent/tasks/main.yml @@ -31,6 +31,17 @@ name: java11 state: present +- name: Symlink Java 11. + shell: ln -sfn /opt/homebrew/opt/openjdk@11/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-11.jdk + become: true + become_user: root + +- name: Ensure that the java install has been added to the path + ansible.builtin.lineinfile: + path: ~/.zshrc + line: export PATH="/opt/homebrew/opt/openjdk@11/bin:$PATH" + create: true + # Configure macOS Settings. - name: Disable screensaver.