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

UnixPB: Add Vagrant Playbook Checks On Ubuntu 22.04 #3270

Merged
merged 12 commits into from
Nov 30, 2023
5 changes: 4 additions & 1 deletion ansible/pbTestScripts/vmDestroy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ checkOS() {
osToDestroy="U20";;
"Ubuntu2104" | "U21" | "u21" )
osToDestroy="U21";;
"Ubuntu2204" | "U22" | "u22" )
osToDestroy="U22";;
"CentOS6" | "centos6" | "C6" | "c6" )
osToDestroy="C6" ;;
"CentOS7" | "centos7" | "C7" | "c7" )
Expand All @@ -66,7 +68,7 @@ checkOS() {
"Windows2022" | "Win2022" | "W22" | "w22" )
osToDestroy="W2022";;
"all" )
osToDestroy="U16 U18 U20 U21 C6 C7 C8 D8 D10 FBSD12 Sol10 W2012" ;;
osToDestroy="U16 U18 U20 U21 U22 C6 C7 C8 D8 D10 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 @@ -80,6 +82,7 @@ listOS() {
- Ubuntu1804
- Ubuntu2004
- Ubuntu2104
- Ubuntu2204
- CentOS6
- CentOS7
- CentOS8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,19 @@
- (nasm_installed.rc is defined) and ((nasm_installed.rc != 0 ) or (nasm_installed.rc == 0 and nasm.stdout is version_compare('2.13.03', operator='ne')) )
tags: nasm

- name: Running ./configure & make for nasm
shell: cd /tmp/nasm-2.13.03 && CC={{ CC }} ./configure -prefix=/usr/local && make install
- name: Running ./configure & make for nasm ( Not Ubuntu 22+ )
shell: cd /tmp/nasm-2.13.03 && CC={{ CC }} && ./configure -prefix=/usr/local && make install
when:
- (nasm_installed.rc is defined) and ((nasm_installed.rc != 0 ) or (nasm_installed.rc == 0 and nasm.stdout is version_compare('2.13.03', operator='ne')) )
- (ansible_distribution != "Ubuntu" or ansible_distribution == "Ubuntu" and ansible_distribution_major_version < "22") and (nasm_installed.rc is defined) and ((nasm_installed.rc != 0 ) or (nasm_installed.rc == 0 and nasm.stdout is version_compare('2.13.03', operator='ne')) )
tags: nasm

- name: Running ./configure & make for nasm ( Ubuntu 22+ x64 )
sxa marked this conversation as resolved.
Show resolved Hide resolved
shell: cd /tmp/nasm-2.13.03 && CC={{ CC }} && ./configure -prefix=/usr/local && make install
environment:
CC: "{{ CC }}"
LIBRARY_PATH: /usr/lib/x86_64-linux-gnu
when:
- (ansible_distribution == "Ubuntu" and ansible_distribution_major_version >= "22" and ansible_architecture == "x86_64") and (nasm_installed.rc is defined) and ((nasm_installed.rc != 0 ) or (nasm_installed.rc == 0 and nasm.stdout is version_compare('2.13.03', operator='ne')) )
tags: nasm

- name: Remove downloaded packages for nasm
Expand Down
27 changes: 27 additions & 0 deletions ansible/vagrant/Vagrantfile.Ubuntu2204
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

$script = <<SCRIPT
# 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 :adoptopenjdkU22 do |adoptopenjdkU22|
adoptopenjdkU22.vm.box = "bento/ubuntu-22.04"
adoptopenjdkU22.vm.synced_folder ".", "/vagrant"
adoptopenjdkU22.vm.hostname = "adoptopenjdkU22"
adoptopenjdkU22.vm.network :private_network, type: "dhcp"
adoptopenjdkU22.vm.provision "shell", inline: $script, privileged: false
end
config.vm.provider "virtualbox" do |v|
v.gui = false
v.memory = 4096
v.cpus = 2
v.customize ["modifyvm", :id, "--cpuexecutioncap", "50"]
end
end
Loading