Commit 83c8c8d7 by Renzo Lucioni

Merge pull request #2297 from edx/renzo/test-playbook

Vagrantfile for testing Ansible playbooks
parents e5c0065f 2d76f81e
# Vagrantfile for testing throwaway Ansible playbooks. To use, create a playbook
# under /playbooks (e.g., "foo.yml"), export its name (e.g., "foo") as the value
# of the environment variable VAGRANT_ANSIBLE_PLAYBOOK, and execute `vagrant provision`
# from within this directory.
MEMORY = 2048
CPU_COUNT = 2
Vagrant.configure("2") do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.network :private_network, ip: "192.168.33.20"
config.vm.network :forwarded_port, guest: 8080, host: 8080
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", MEMORY.to_s]
# You can adjust this to the amount of CPUs your system has available
vb.customize ["modifyvm", :id, "--cpus", CPU_COUNT.to_s]
# Allow DNS to work for Ubuntu 12.10 host
# http://askubuntu.com/questions/238040/how-do-i-fix-name-service-for-vagrant-client
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
["vmware_fusion", "vmware_workstation"].each do |vmware_provider|
config.vm.provider vmware_provider do |v, override|
override.vm.box = "precise64_vmware"
override.vm.box_url = "http://files.vagrantup.com/precise64_vmware.box"
v.vmx["memsize"] = MEMORY.to_s
v.vmx["numvcpus"] = CPU_COUNT.to_s
end
end
config.vm.provision :ansible do |ansible|
ansible.playbook = "../../../playbooks/" + ENV['VAGRANT_ANSIBLE_PLAYBOOK'] + ".yml"
ansible.verbose = "extra"
end
end
# config file for ansible -- http://ansible.github.com
# nearly all parameters can be overridden in ansible-playbook or with command line flags
# ansible will read ~/.ansible.cfg or /etc/ansible/ansible.cfg, whichever it finds first
[defaults]
jinja2_extensions=jinja2.ext.do
host_key_checking = False
roles_path=../../ansible-roles/roles:../../ansible-private/roles:../../ansible-roles/
ansible_managed=This file is created and updated by ansible, edit at your peril
# Use this Vagrantfile to test individual Ansible roles.
MEMORY = 2048
CPU_COUNT = 2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment