From c4723d43eba3580093081833b2895ac8226eff1c Mon Sep 17 00:00:00 2001
From: Jeff Ohrstrom <johrstrom@osc.edu>
Date: Thu, 19 Dec 2024 15:35:52 -0500
Subject: [PATCH] update defaults for next version (#254)

Update defaults to prepare for next version.  This installs from latest, so will need to be updated when we get real 4.0 packages built.
---
 .github/workflows/tests.yml       | 20 +-------------------
 defaults/main/install.yml         |  8 ++++----
 molecule/upgrade/prepare.yml      | 10 ++++++----
 molecule/upgrade/vars/prepare.yml |  6 +++---
 molecule/upgrade/verify.yml       |  2 +-
 5 files changed, 15 insertions(+), 31 deletions(-)

diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index fd33e3b..0d76064 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -48,26 +48,8 @@ jobs:
         run: |
           python3 -m pip install -r molecule/requirements.txt
           ansible-galaxy collection install community.general
-          sudo apt update && sudo apt install -y podman
+          sudo apt update && sudo apt upgrade -y && sudo apt install -y podman
 
-      # we have to patch crun here because Ubuntu fails with the errors similar to the 
-      # github issue below.
-      # https://github.com/containers/crun/issues/1308
-      - name: patch crun
-        run: |
-          export CRUN_VER='1.14.3'
-          mkdir -p "${HOME}/.local/bin"
-          curl -L "https://github.com/containers/crun/releases/download/${CRUN_VER}/crun-${CRUN_VER}-linux-amd64" -o "${HOME}/.local/bin/crun"
-          chmod +x "${HOME}/.local/bin/crun"
-
-          mkdir -p "${HOME}/.config/containers"
-          cat << EOF > "${HOME}/.config/containers/containers.conf"
-          [engine.runtimes]
-          crun = [
-            "${HOME}/.local/bin/crun",
-            "/usr/bin/crun"
-          ]
-          EOF
       - name: run tests
         run: molecule test --scenario-name=${{ matrix.scenario }}
         env:
diff --git a/defaults/main/install.yml b/defaults/main/install.yml
index 364177d..0568a68 100644
--- a/defaults/main/install.yml
+++ b/defaults/main/install.yml
@@ -17,8 +17,8 @@ apache_etc_dir: "/etc/{{ apache_service_name }}"
 apache_conf_dir: "{{ apache_etc_dir }}/conf.d"
 apache_log_dir: "/var/log/{{ apache_service_name }}"
 
-rpm_repo_url: "https://yum.osc.edu/ondemand/3.1/ondemand-release-web-3.1-1.{{ el_distro }}.noarch.rpm"
-apt_repo_url: "https://apt.osc.edu/ondemand/3.1/ondemand-release-web_3.1.1-{{ deb_distro }}_all.deb"
+rpm_repo_url: "https://yum.osc.edu/ondemand/latest/ondemand-release-web-latest-1-8.{{ el_distro }}.noarch.rpm"
+apt_repo_url: "https://apt.osc.edu/ondemand/latest/ondemand-release-web-latest_5-{{ deb_distro }}_all.deb"
 
 rpm_repo_key: "https://yum.osc.edu/ondemand/RPM-GPG-KEY-ondemand"
 deb_repo_key: "https://apt.osc.edu/ondemand/DEB-GPG-KEY-ondemand"
@@ -42,7 +42,7 @@ ondemand_dex_package: ondemand-dex # behaviour as for ondemand_package
 
 # needed for testing. no reason to change these in production.
 disable_htcacheclean: false
-nodejs_version: 18
-ruby_version: 3.1
+nodejs_version: 20
+ruby_version: 3.3
 
 ood_base_apache_dir: "/var/www/ood"
diff --git a/molecule/upgrade/prepare.yml b/molecule/upgrade/prepare.yml
index e95d10c..388e69a 100644
--- a/molecule/upgrade/prepare.yml
+++ b/molecule/upgrade/prepare.yml
@@ -22,14 +22,16 @@
   pre_tasks:
     - name: Set dependency versions on el8
       set_fact:
-        ruby_version: 3.0
-        nodejs_version: 14
-      when: ansible_os_family == "RedHat" and ansible_distribution_major_version == '8'
+        ruby_version: 3.1
+        nodejs_version: 18
+      when: ansible_os_family == "RedHat" and ansible_distribution_major_version >= '8'
 
-    - name: Use default versions on el8
+    - name: Use default versions on el9
       set_fact:
         additional_rpm_installs:
           - lua-posix
+          - "@ruby:{{ ruby_version }}"
+          - "@nodejs:{{ nodejs_version }}"
       when: ansible_os_family == "RedHat" and ansible_distribution_major_version == '9'
 
   roles:
diff --git a/molecule/upgrade/vars/prepare.yml b/molecule/upgrade/vars/prepare.yml
index 1de872b..01dee8f 100644
--- a/molecule/upgrade/vars/prepare.yml
+++ b/molecule/upgrade/vars/prepare.yml
@@ -1,4 +1,4 @@
-ondemand_package: "ondemand{% if ansible_os_family == 'RedHat' %}-{% else %}={% endif %}3.0.3"
+ondemand_package: "ondemand{% if ansible_os_family == 'RedHat' %}-{% else %}={% endif %}3.1.10"
 disable_htcacheclean: true
-apt_repo_url: "https://apt.osc.edu/ondemand/3.0/ondemand-release-web_3.0.0_all.deb"
-rpm_repo_url: "https://yum.osc.edu/ondemand/3.0/ondemand-release-web-3.0-1.noarch.rpm"
+apt_repo_url: "https://apt.osc.edu/ondemand/3.1/ondemand-release-web_3.1.2-{{ deb_distro }}_all.deb"
+rpm_repo_url: "https://yum.osc.edu/ondemand/3.1/ondemand-release-web-3.1-1.{{ el_distro }}.noarch.rpm"
\ No newline at end of file
diff --git a/molecule/upgrade/verify.yml b/molecule/upgrade/verify.yml
index 678db80..f8120dc 100644
--- a/molecule/upgrade/verify.yml
+++ b/molecule/upgrade/verify.yml
@@ -58,7 +58,7 @@
   - name: Verify OOD version
     ansible.builtin.shell: |
       set -o pipefail
-      grep -P '3.1.(\d)*' /opt/ood/VERSION
+      grep -P '4.0.(\d)*' /opt/ood/VERSION
     args:
       executable: /bin/bash
     changed_when: false
\ No newline at end of file