Skip to content

Commit 9a52f29

Browse files
committed
TMP: test build on AMD64
1 parent 837c5cf commit 9a52f29

File tree

2 files changed

+7
-28
lines changed

2 files changed

+7
-28
lines changed

Vagrantfile

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ current_dir = File.dirname(File.expand_path(__FILE__))
66
inventory = YAML.load_file("#{current_dir}/inventory.yml")
77
# host specific variables take priority over global ones
88
gconfig = inventory['all']['vars']
9-
playbook = ENV["BUILD_PLAYBOOK"] || "playbook-build.yml"
109
launch_gui = ENV.has_key?('VAGRANT_NO_GUI') ? false : true
1110

1211
# Currently on GitHub Actions it fails if accelerate3d activated
@@ -79,24 +78,6 @@ Vagrant.configure(2) do |config|
7978
# Disable the default shared folder of vagrant
8079
config.vm.synced_folder ".", "/vagrant", disabled: true
8180

82-
# provisioner: set up VM via ansible. To (re-)run this step:
83-
# vagrant provision --provision-with ansible
84-
# Note we use a static inventory, see: https://www.vagrantup.com/docs/provisioning/ansible_intro#static-inventory
85-
86-
# Generate SSH config for Ansible, then run playbook
87-
# Uses NAT port forwarding instead of private_network IP (more reliable)
88-
config.trigger.before :provision do |trigger|
89-
trigger.info = "Generating vagrant-ssh config file..."
90-
trigger.run = {inline: "vagrant ssh-config > vagrant-ssh"}
91-
end
92-
93-
config.vm.provision "ansible" do |ansible|
94-
ansible.inventory_path = "inventory.yml"
95-
ansible.limit = "vagrant-ssh"
96-
ansible.playbook = playbook
97-
98-
ansible.raw_arguments = Shellwords.shellsplit(ENV['ANSIBLE_ARGS']) if ENV['ANSIBLE_ARGS']
99-
# Ensure that public key auth is not disabled by the user's config
100-
ansible.raw_ssh_args = ['-o PubKeyAuthentication=yes -o DSAAuthentication=yes']
101-
end
81+
# Note: provisioning is done separately via `tox -e ansible`, which first
82+
# generates the vagrant-ssh config file and then runs the playbook.
10283
end

tox.ini

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,13 @@ basepython = python3.13
88
skip_install = true
99

1010
[testenv:vagrant]
11-
description = Build a vagrant box VM then provision with ansible
11+
description = Create and boot the Vagrant VM (without provisioning)
1212
deps = -rrequirements.txt
1313
passenv =
1414
HOME
15-
ANSIBLE_ARGS
1615
VAGRANT_NO_GUI
1716
VAGRANT_ON_GH
18-
BUILD_PLAYBOOK
1917
allowlist_externals = vagrant
20-
commands_pre =
21-
ansible-galaxy install -r requirements.yml
2218
commands = vagrant {posargs:up}
2319

2420
[testenv:ansible]
@@ -27,10 +23,12 @@ deps = -rrequirements.txt
2723
passenv =
2824
HOME
2925
BUILD_PLAYBOOK
30-
allowlist_externals = vagrant
26+
allowlist_externals =
27+
vagrant
28+
bash
3129
commands_pre =
3230
ansible-galaxy install -r requirements.yml -vvv
33-
; vagrant ssh-config > vagrant-ssh
31+
bash -c "vagrant ssh-config > vagrant-ssh"
3432
commands = ansible-playbook {env:BUILD_PLAYBOOK:playbook-build.yml} {posargs}
3533
# to run against a specific host:
3634
# tox -e ansible -- --extra-vars "build_hosts=aws"

0 commit comments

Comments
 (0)