@@ -6,7 +6,6 @@ current_dir = File.dirname(File.expand_path(__FILE__))
66inventory = YAML . load_file ( "#{ current_dir } /inventory.yml" )
77# host specific variables take priority over global ones
88gconfig = inventory [ 'all' ] [ 'vars' ]
9- playbook = ENV [ "BUILD_PLAYBOOK" ] || "playbook-build.yml"
109launch_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.
10283end
0 commit comments