Windows 10: Added a simpler way to provision a VM just by using Vagrant (no WSL required)

Ansible will be installed by Vagrant in the VM and will then provision the machine from within, making the Windows Subsystem for Linux obsolete. The Vagrant host (Windows 10) only has to have Vagrant installed.
This commit is contained in:
Jan Beilicke 2020-11-26 07:56:51 +00:00
parent cc75f43109
commit 6cc72adeab
3 changed files with 49 additions and 15 deletions

24
Vagrantfile vendored
View file

@ -54,11 +54,29 @@ Vagrant.configure(2) do |config|
# https://www.virtualbox.org/manual/ch06.html#network_nat_service
dev.vm.network :private_network, ip: "192.168.23.42"
dev.vm.provision :ansible do |ansible|
# Provision the VM from the Vagrant host.
# The host has to have Ansible installed and will connect to the VM via SSH
# dev.vm.provision :ansible do |ansible|
# #ansible.verbose = "vvv"
# ansible.compatibility_mode = "2.0"
# ansible.playbook = "site.yml"
# ansible.inventory_path = "inventory.ini.sample"
# ansible.become = true
# end
# Provision by running Ansible from within the VM.
# Vagrant will try to install Ansible automatically using pip
# Advantage: Ansible doesn't have to be installed on the Vagrant host
# See also: https://www.vagrantup.com/docs/provisioning/ansible_local.html
dev.vm.provision "ansible_local" do |ansible|
#ansible.verbose = "vvv"
ansible.compatibility_mode = "2.0"
ansible.playbook = "./site.yml"
ansible.inventory_path = "./inventory.ini.sample"
ansible.install_mode = "pip"
ansible.version = "2.10.3"
ansible.playbook = "site.yml"
#ansible.inventory_path = "inventory.ini.sample"
ansible.galaxy_role_file = "requirements.yml"
ansible.galaxy_roles_path = "roles"
ansible.become = true
end
end