This kludge is necessary because the OpenJDK 11 packages,
unlike the OpenJDK 8 packages, install all binaries outside
of $PATH.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
Pushed so that I could bring the CI environment back online; if
people have objections to the approach, we can make the necessary
changes as a follow-up.
guests/playbooks/update/main.yml | 2 +-
guests/playbooks/update/tasks/kludges.yml | 14 ++++++++++++++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/guests/playbooks/update/main.yml b/guests/playbooks/update/main.yml
index 753bac4..e82055b 100644
--- a/guests/playbooks/update/main.yml
+++ b/guests/playbooks/update/main.yml
@@ -48,10 +48,10 @@
- flavor == "jenkins"
# Configure environment. Needs to happen after installing packages
+ - include: '{{ playbook_base }}/tasks/kludges.yml'
- include: '{{ playbook_base }}/tasks/paths.yml'
- include: '{{ playbook_base }}/tasks/bootloader.yml'
- include: '{{ playbook_base }}/tasks/services.yml'
- - include: '{{ playbook_base }}/tasks/kludges.yml'
- include: '{{ playbook_base }}/tasks/users.yml'
# Configure the Jenkins agent
diff --git a/guests/playbooks/update/tasks/kludges.yml
b/guests/playbooks/update/tasks/kludges.yml
index 3648514..22d8ce5 100644
--- a/guests/playbooks/update/tasks/kludges.yml
+++ b/guests/playbooks/update/tasks/kludges.yml
@@ -1,4 +1,18 @@
---
+# FreeBSD allows multiple versions of OpenJDK to be installed and used
+# in parallel, which is neat but also means they must all live outside
+# of $PATH. Create a symlink so that we can still find the main Java
+# executable.
+- name: Create java symlink
+ file:
+ src: /usr/local/openjdk11/bin/java
+ dest: /usr/local/bin/java
+ state: link
+ owner: root
+ group: wheel
+ when:
+ - os_name == 'FreeBSD'
+
# FreeBSD compiles bash without defining SSH_SOURCE_BASHRC, which means
# it won't try to detect when it's spawned by ssh and source ~/.bashrc
# when that's the case. Our workaround is setting $BASH_ENV globally
--
2.21.0