Skip to content

Commit

Permalink
(chocolatey#84) Update testing Vagrantfile install pwsh (chocolatey#86)
Browse files Browse the repository at this point in the history
Switch up the vagrant VM to use a LTS Ubuntu image as those are the only
ones supported for installing PowerShell from Microsoft. Updated the
provision script to install PowerShell so that sanity tests can be run
successfully.
  • Loading branch information
corbob authored Jun 30, 2022
1 parent 42a297f commit 85ee7fd
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion testing-chocolatey/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Vagrant.require_version ">= 1.6.0"
Vagrant.configure("2") do |config|

config.vm.define :choco_ansible_server do |server|
server.vm.box = "roboxes/ubuntu2010"
server.vm.box = "roboxes/ubuntu2204"

server.vm.hostname = "ansible-server"
server.vm.network :private_network, ip: "10.0.0.10"
Expand All @@ -28,9 +28,18 @@ Vagrant.configure("2") do |config|

server.vm.provision "shell" do |sh|
sh.inline = <<-SH
# Install python venv
sudo apt-get update
sudo apt-get install python3-venv -y
# Install PowerShell
sudo apt-get update
sudo apt-get install -y wget apt-transport-https software-properties-common
wget -q "https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb"
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install -y powershell
python3 -m venv ~/ansible
source ~/ansible/bin/activate
Expand Down

0 comments on commit 85ee7fd

Please sign in to comment.