Skip to content

Commit

Permalink
VPC: Improve playbook execution.
Browse files Browse the repository at this point in the history
  • Loading branch information
steelhead31 committed Sep 3, 2024
1 parent 394aa7f commit ab3ddc1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
18 changes: 14 additions & 4 deletions ansible/pbTestScripts/vagrantPlaybookCheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ buildHotspot=''
testDocker=false
scriptPath=$(realpath $0)
verbosity=''
sshargs=''

# Takes all arguments from the script, and determines options
processArgs()
Expand Down Expand Up @@ -275,13 +276,22 @@ startVMPlaybook()
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

# Add Solaris 10 specific ssh-rsa algorithms if the OS is Solaris10
if [ "$OS" == "Solaris10" ]; then
## Run The Playbook With ssh-rsa algorithms for Solaris 10 Only
ansible-playbook $verbosity -i playbooks/AdoptOpenJDK_Unix_Playbook/hosts.unx -u vagrant -b --ssh-extra-args='-o PubkeyAcceptedKeyTypes=ssh-rsa -o HostKeyAlgorithms=ssh-rsa' --skip-tags adoptopenjdk,jenkins${skipFullSetup} playbooks/AdoptOpenJDK_Unix_Playbook/main.yml 2>&1 | tee $WORKSPACE/adoptopenjdkPBTests/logFiles/$gitFork.$newGitBranch.$OS.log
else
ansible-playbook $verbosity -i playbooks/AdoptOpenJDK_Unix_Playbook/hosts.unx -u vagrant -b --skip-tags adoptopenjdk,jenkins${skipFullSetup} playbooks/AdoptOpenJDK_Unix_Playbook/main.yml 2>&1 | tee $WORKSPACE/adoptopenjdkPBTests/logFiles/$gitFork.$newGitBranch.$OS.log
sshargs="--ssh-extra-args='-o PubkeyAcceptedKeyTypes=ssh-rsa -o HostKeyAlgorithms=ssh-rsa'"
fi

# Initialize the args variable with common arguments
args="$verbosity -i playbooks/AdoptOpenJDK_Unix_Playbook/hosts.unx -u vagrant -b $sshargs --skip-tags adoptopenjdk,jenkins${skipFullSetup}"

##
echo "DEBUG - SF01"
echo $args
echo "DEBUG - SF01"

# Run the ansible playbook with the constructed args
ansible-playbook "$args playbooks/AdoptOpenJDK_Unix_Playbook/main.yml" 2>&1 | tee $WORKSPACE/adoptopenjdkPBTests/logFiles/$gitFork.$newGitBranch.$OS.log

echo The playbook finished at : `date +%T`
if ! grep -q 'unreachable=0.*failed=0' $pbLogPath; then
echo PLAYBOOK FAILED
Expand Down
15 changes: 1 addition & 14 deletions ansible/playbooks/vagrant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -348,20 +348,7 @@
state: present
when: virtualbox_installed.rc != 0
tags: VBox

## Configure Acceptance For VBox Extension Pack

- name: Set VirtualBox extension pack license agreement
shell: echo virtualbox-ext-pack virtualbox-ext-pack/license select true | sudo debconf-set-selections
when: virtualbox_installed.rc != 0

- name: Install VirtualBox Extension Pack
apt:
name: "virtualbox-ext-pack"
state: present
when: virtualbox_installed.rc != 0
tags: VBox


Check failure on line 351 in ansible/playbooks/vagrant.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

yaml[trailing-spaces]

Trailing spaces

Check failure on line 351 in ansible/playbooks/vagrant.yml

View workflow job for this annotation

GitHub Actions / Yamllint

351:1 [trailing-spaces] trailing spaces
##########
# QEMU #
##########
Expand Down
2 changes: 1 addition & 1 deletion ansible/vagrant/Vagrantfile.Win2022.Adopt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Vagrant.configure("2") do |config|
v.gui = false
v.memory = 8192
v.cpus = 2
v.customize ["modifyvm", :id, "--cpuexecutioncap", "80"]
v.customize ["modifyvm", :id, "--cpuexecutioncap", "50"]
end
config.vm.boot_timeout = 600
end

0 comments on commit ab3ddc1

Please sign in to comment.