Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vagrant: Upgrade Fedora 35 vagrantfile to Fedora 40 #3663

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ansible/pbTestScripts/vagrantPlaybookCheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,11 @@ startVMPlaybook()
[ ! -r $HOME/.ssh/known_hosts ] && touch $HOME/.ssh/known_hosts && chmod 644 $HOME/.ssh/known_hosts
ssh-keygen -R $(cat playbooks/AdoptOpenJDK_Unix_Playbook/hosts.unx)

# For OSs that require an earlier version of python to be compatible with the version of Ansible on the host
if [ "$OS" == "Fedora40" ]; then
echo "[127.0.0.1]:${vagrantPORT} ansible_python_interpreter=/usr/bin/python3.8" > playbooks/AdoptOpenJDK_Unix_Playbook/hosts.unx
fi

sed -i -e "s/.*hosts:.*/ hosts: all/g" playbooks/AdoptOpenJDK_Unix_Playbook/main.yml
awk '{print}/^\[defaults\]$/{print "private_key_file = id_rsa"; print "remote_tmp = $HOME/.ansible/tmp"; print "timeout = 60"}' < ansible.cfg > ansible.cfg.tmp && mv ansible.cfg.tmp ansible.cfg

Expand Down
19 changes: 11 additions & 8 deletions ansible/pbTestScripts/vmDestroy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,27 @@ checkOS() {
"Ubuntu2204" | "U22" | "u22" )
osToDestroy="U22";;
"CentOS6" | "centos6" | "C6" | "c6" )
osToDestroy="C6" ;;
osToDestroy="C6";;
"CentOS7" | "centos7" | "C7" | "c7" )
osToDestroy="C7" ;;
osToDestroy="C7";;
"CentOS8" | "centos8" | "C8" | "c8" )
osToDestroy="C8" ;;
osToDestroy="C8";;
"Debian8" | "debian8" | "D7" | "d7" )
osToDestroy="D8" ;;
osToDestroy="D8";;
"Debian10" | "debian10" | "D10" | "d10" )
osToDestroy="D10" ;;
osToDestroy="D10";;
"Fedora40" | "fedora40" | "F40" | "f40" )
osToDestroy="F40";;
"FreeBSD12" | "freebsd12" | "F12" | "f12" )
osToDestroy="FBSD12" ;;
osToDestroy="FBSD12";;
"Solaris10" | "solaris10" | "Sol10" | "sol10" )
osToDestroy="Sol10" ;;
osToDestroy="Sol10";;
"Windows2012" | "Win2012" | "W12" | "w12" )
osToDestroy="W2012";;
"Windows2022" | "Win2022" | "W22" | "w22" )
osToDestroy="W2022";;
"all" )
osToDestroy="U16 U18 U20 U21 U22 C6 C7 C8 D8 D10 FBSD12 Sol10 W2012 W2022" ;;
osToDestroy="U16 U18 U20 U21 U22 C6 C7 C8 D8 D10 F40 FBSD12 Sol10 W2012 W2022" ;;
"")
echo "No OS detected. Did you miss the '-o' option?" ; usage; exit 1;;
*) echo "$OS is not a currently supported OS" ; listOS; exit 1;
Expand All @@ -83,6 +85,7 @@ listOS() {
- Ubuntu2004
- Ubuntu2104
- Ubuntu2204
- Fedora40
- CentOS6
- CentOS7
- CentOS8
Expand Down
26 changes: 0 additions & 26 deletions ansible/vagrant/Vagrantfile.Fedora35

This file was deleted.

37 changes: 37 additions & 0 deletions ansible/vagrant/Vagrantfile.Fedora40
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

$script = <<SCRIPT

# Install python3.8, make it the default python
sudo dnf -y install python3.8
sudo curl https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py
sudo python3.8 /tmp/get-pip.py
sudo pip install selinux
sudo rm /usr/bin/python3
sudo ln -s /usr/bin/python3.8 /usr/bin/python3

# Put the host machine's IP into the authorised_keys file on the VM
if [ -r /vagrant/id_rsa.pub ]; then
mkdir -p $HOME/.ssh && cat /vagrant/id_rsa.pub >> $HOME/.ssh/authorized_keys
fi
SCRIPT

# 2 = version of configuration file for Vagrant 1.1+ leading up to 2.0.x
Vagrant.configure("2") do |config|

config.vm.define :adoptopenjdkF40 do |adoptopenjdkF40|
adoptopenjdkF40.vm.box = "bento/fedora-40"
adoptopenjdkF40.vm.box_version = "202404.23.0"
adoptopenjdkF40.vm.synced_folder ".", "/vagrant"
adoptopenjdkF40.vm.hostname = "adoptopenjdkF40"
adoptopenjdkF40.vm.network :private_network, type: "dhcp"
adoptopenjdkF40.vm.provision "shell", inline: $script, privileged: false
adoptopenjdkF40.vm.boot_timeout = 900
end
config.vm.provider "virtualbox" do |v|
v.gui = false
v.memory = 2560
v.customize ["modifyvm", :id, "--cpuexecutioncap", "50"]
end
end