Skip to content

Instantly share code, notes, and snippets.

@skamithi
Created August 12, 2015 03:07
Show Gist options
  • Select an option

  • Save skamithi/a06f58abb07e7b8e15bb to your computer and use it in GitHub Desktop.

Select an option

Save skamithi/a06f58abb07e7b8e15bb to your computer and use it in GitHub Desktop.
vagrantfile_for_simple_libvirt_vagrant_setup
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = "trusty64_2"
# vagrant issues #1673..fixes hang with configure_networks
config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'"
config.vm.provider :libvirt do |domain|
domain.memory = 256
domain.nested = true
end
# deployment server
config.vm.define :deployserver do |node|
node.vm.hostname = 'deployosad'
node.vm.synced_folder '.', '/vagrant', :disabled => true
node.vm.network :private_network,
:ip => '169.2.2.2/24', # bogus IP so tha vagrant-libvirt can create virt_network
:auto_config => false,
:libvirt__forward_mode => 'veryisolated',
:libvirt__dhcp_enabled => false,
:libvirt__network_name => 'host_mgmt'
node.vm.network :private_network,
:ip => '169.2.3.3/24',
:auto_config => false,
:libvirt__forward_mode => 'veryisolated',
:libvirt__dhcp_enabled => false,
:libvirt__network_name => 'container_mgmt'
node.vm.provision :ansible do |ansible|
ansible.playbook = 'deployserver.yml'
ansible.extra_vars = {
openstack_release: 'kilo',
ubuntu_repo: 'http://192.168.50.1:3142/ubuntu'
}
end
node.vm.network "forwarded_port", guest: 3142, host: 8090
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment