From 670c2d6bda6873a62ba3a34a9760f2385b30bdb8 Mon Sep 17 00:00:00 2001 From: Mira Kuntz Date: Tue, 17 Dec 2024 09:07:52 +0100 Subject: [PATCH] add fixed for Jenkins runner image --- ansible/group_vars/jenkins.yml | 6 ++++++ ansible/jenkins.yml | 31 +++++++++++++++++++++---------- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/ansible/group_vars/jenkins.yml b/ansible/group_vars/jenkins.yml index 58c94a8..ac9a2c4 100644 --- a/ansible/group_vars/jenkins.yml +++ b/ansible/group_vars/jenkins.yml @@ -1,2 +1,8 @@ --- miniconda_prefix: /scratch/miniconda +jenkins_public_ssh_key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDfQrCU7MkCPHoFt6kwBnh3kZMd38WMbP4TSmaYrRjqwNAqlW9zoyHMy/eU+Gvb87hjSm9EZG8GOoHAkkqy1s7G6qQWNfYoxyQmbxs/nj3mtvFRKfow8WUmt2Xew5tXWJX1GxWtpyNn4ytrB7iGJRyiGN1R/g6qyBu/rxWtVvWxz79THajJqt5zgJFvnnLDOj9wlUIdA6lXlMOE0fUzdXsBNhZGWMwMCo+hd3i+SHsuK5QvBGPz/c9SdfzyKfg8JFmb2dfMCfybhsAeGO315qZWe1t7fgwVYiFRcOvTpZ0SR7sFPfmEAzm4sIF10n1EIADB70tfmsWsPX42oC/l4Zp1" +software_groups_to_install: + - admin + - editors + - terminals + - utils diff --git a/ansible/jenkins.yml b/ansible/jenkins.yml index 3268c67..04cd676 100644 --- a/ansible/jenkins.yml +++ b/ansible/jenkins.yml @@ -1,14 +1,5 @@ --- - hosts: jenkins - - vars: - jenkins_public_ssh_key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDfQrCU7MkCPHoFt6kwBnh3kZMd38WMbP4TSmaYrRjqwNAqlW9zoyHMy/eU+Gvb87hjSm9EZG8GOoHAkkqy1s7G6qQWNfYoxyQmbxs/nj3mtvFRKfow8WUmt2Xew5tXWJX1GxWtpyNn4ytrB7iGJRyiGN1R/g6qyBu/rxWtVvWxz79THajJqt5zgJFvnnLDOj9wlUIdA6lXlMOE0fUzdXsBNhZGWMwMCo+hd3i+SHsuK5QvBGPz/c9SdfzyKfg8JFmb2dfMCfybhsAeGO315qZWe1t7fgwVYiFRcOvTpZ0SR7sFPfmEAzm4sIF10n1EIADB70tfmsWsPX42oC/l4Zp1" - software_groups_to_install: - - admin - - editors - - terminals - - utils - vars_files: - "group_vars/all.yml" - "group_vars/java.yml" @@ -45,6 +36,8 @@ - libcurl-devel - python-devel - rsync + - java-17-openjdk + - python3.9 state: present become: true when: ansible_os_family == 'RedHat' and ansible_distribution_major_version | int == 9 @@ -53,6 +46,19 @@ name: python path: /usr/bin/python3 link: /usr/bin/python + - name: Get Java version name + ansible.builtin.find: + path: /usr/lib/jvm + recurse: false + pattern: 'java-17-openjdk-17*' + register: java17 + - name: Create a symbolic link for Java for Jenkins + ansible.builtin.file: + src: "{{ java17.files[0].path }}" + dest: /usr/lib/jvm/java-17-openjdk + owner: root + group: root + state: link - name: Ensure SELinux is set to enforcing mode ansible.builtin.lineinfile: path: /etc/selinux/config @@ -64,7 +70,7 @@ ansible.builtin.alternatives: name: java link: /usr/bin/java - path: /usr/lib/jvm/java-11-openjdk/bin/java + path: /usr/lib/jvm/java-17-openjdk/bin/java - name: Download packer ansible.builtin.command: yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo @@ -84,6 +90,11 @@ user: centos state: present key: "{{ jenkins_public_ssh_key }}" + - name: DNF Autoremove + ansible.builtin.dnf: + autoremove: yes + enablerepo: "*" + when: ansible_os_family == 'RedHat' roles: - role: usegalaxy_eu.handy.os_setup