313a832d7c
We further split libvm from vagrant. It no longer does 'vagrant ssh-config'. Instead, it always assumes that an ssh-config is provided. We now have complete separation of libvm from vagrant. We change the ansible provisioner as follows: - Allow passing in a VAGRANT_BOX env var to override the default CentOS box. - No longer assume that the root user account is unlocked and has a valid 'vagrant' password. This worked for the centos box but isn't sure to work on every box. Instead, we now just run ansible as the default vagrant user, and during provisioning set up the root account and generate an ssh-config so that libvm can connect directly as root. - No longer build the buildimg during provisioning. This actually stopped working a while ago since the default rsync is disabled. We can just let the buildimg get created on the first compilation. In practice, the bigger issue isn't creating the buildimg, but being able to easily update the host and buildimg pkgs. Closes: #516 Approved by: jlebon
36 lines
922 B
Ruby
36 lines
922 B
Ruby
# vi: set ft=ruby :
|
|
|
|
# See `HACKING.md` for more information on this.
|
|
|
|
Vagrant.configure(2) do |config|
|
|
|
|
if ENV['VAGRANT_BOX']
|
|
config.vm.box = ENV['VAGRANT_BOX']
|
|
else
|
|
config.vm.box = "centos/atomic-host"
|
|
end
|
|
|
|
config.vm.hostname = "centosah-dev"
|
|
|
|
config.vm.define "vmcheck" do |vmcheck|
|
|
end
|
|
|
|
# turn off the default rsync in the vagrant box (the vm tooling does this
|
|
# for use already)
|
|
config.vm.synced_folder ".", "/home/vagrant/sync", disabled: true
|
|
|
|
config.vm.provider "libvirt" do |libvirt, override|
|
|
libvirt.cpus = 2
|
|
libvirt.memory = 2048
|
|
libvirt.driver = 'kvm'
|
|
end
|
|
|
|
config.vm.provision "ansible" do |ansible|
|
|
ansible.playbook = "vagrant/setup.yml"
|
|
ansible.host_key_checking = false
|
|
ansible.raw_ssh_args = ['-o ControlMaster=no']
|
|
# for debugging the ansible playbook
|
|
#ansible.raw_arguments = ['-v']
|
|
end
|
|
end
|