2015-07-15 17:14:39 +07:00
|
|
|
# -*- mode: ruby -*-
|
|
|
|
# vi: set ft=ruby :
|
|
|
|
# vi: set tabstop=2 :
|
|
|
|
# vi: set shiftwidth=2 :
|
|
|
|
|
|
|
|
Vagrant.configure("2") do |config|
|
|
|
|
|
2016-03-09 16:28:06 +07:00
|
|
|
vms_debian = [
|
2017-10-26 15:59:24 +07:00
|
|
|
{ :name => "debian-jessie", :box => "debian/jessie64", :vars => { "nginx_php": [{"version": "5.6"}] }},
|
|
|
|
{ :name => "debian-jessie-backports", :box => "debian/jessie64", :vars => { "nginx_php": [{"version": "5.6"}], "nginx_backports": true }},
|
|
|
|
{ :name => "debian-jessie-dotdeb", :box => "debian/jessie64", :vars => { "nginx_php": [{"version": "7.0"}, {"version": "5.6", "upstream_name": "legacy"} ], "dotdeb": true }},
|
|
|
|
{ :name => "debian-stretch", :box => "debian/stretch64", :vars => { "nginx_php": [{"version": "7.0"}] }},
|
|
|
|
{ :name => "debian-stretch-sury", :box => "debian/stretch64", :vars => { "nginx_php": [{"version": "7.1"}], "sury": true }}
|
2016-03-09 16:28:06 +07:00
|
|
|
]
|
|
|
|
|
|
|
|
vms_freebsd = [
|
2017-06-05 21:21:47 +07:00
|
|
|
{ :name => "freebsd-10.2", :box => "freebsd/FreeBSD-10.2-STABLE" }
|
2015-07-15 17:14:39 +07:00
|
|
|
]
|
|
|
|
|
2017-06-05 21:21:47 +07:00
|
|
|
conts = [
|
2017-10-26 15:59:24 +07:00
|
|
|
{ :name => "docker-debian-jessie", :docker => "hanxhx/vagrant-ansible:debian8", :vars => { "nginx_php" => [{"version" => "5.6"}] }},
|
|
|
|
{ :name => "docker-debian-jessie-backports", :docker => "hanxhx/vagrant-ansible:debian8", :vars => { "nginx_php": [{"version": "5.6"}], "nginx_backports": true }},
|
|
|
|
{ :name => "docker-debian-jessie-dotdeb", :docker => "hanxhx/vagrant-ansible:debian8", :vars => { "nginx_php": [{"version": "7.0"}, {"version": "5.6", "upstream_name": "legacy"} ], "dotdeb": true }},
|
|
|
|
{ :name => "docker-debian-stretch", :docker => "hanxhx/vagrant-ansible:debian9", :vars => { "nginx_php": [{"version": "7.0"}] }},
|
|
|
|
{ :name => "docker-debian-stretch-sury", :docker => "hanxhx/vagrant-ansible:debian9", :vars => { "nginx_php": [{"version": "7.1"}], "sury": true }}
|
2017-06-05 21:21:47 +07:00
|
|
|
]
|
2015-07-15 17:14:39 +07:00
|
|
|
|
2017-06-05 21:21:47 +07:00
|
|
|
config.vm.network "private_network", type: "dhcp"
|
|
|
|
|
|
|
|
conts.each do |opts|
|
2016-10-13 15:19:24 +07:00
|
|
|
config.vm.define opts[:name] do |m|
|
2017-06-05 21:21:47 +07:00
|
|
|
m.vm.provider "docker" do |d|
|
|
|
|
d.image = opts[:docker]
|
|
|
|
d.remains_running = true
|
|
|
|
d.has_ssh = true
|
|
|
|
end
|
2016-03-09 16:28:06 +07:00
|
|
|
m.vm.provision "ansible" do |ansible|
|
|
|
|
ansible.playbook = "tests/test.yml"
|
|
|
|
ansible.verbose = 'vv'
|
|
|
|
ansible.sudo = true
|
2017-06-05 21:21:47 +07:00
|
|
|
ansible.extra_vars = opts[:vars]
|
2016-03-05 21:07:39 +07:00
|
|
|
end
|
2016-03-09 16:28:06 +07:00
|
|
|
end
|
|
|
|
end
|
2017-06-05 21:21:47 +07:00
|
|
|
|
|
|
|
vms_debian.each do |opts|
|
2016-10-13 15:19:24 +07:00
|
|
|
config.vm.define opts[:name] do |m|
|
|
|
|
m.vm.box = opts[:box]
|
2017-06-05 21:21:47 +07:00
|
|
|
m.vm.provider "virtualbox" do |v|
|
|
|
|
v.cpus = 1
|
|
|
|
v.memory = 256
|
2015-07-15 17:14:39 +07:00
|
|
|
end
|
2017-06-05 21:21:47 +07:00
|
|
|
m.vm.provision "ansible" do |ansible|
|
|
|
|
ansible.playbook = "tests/test.yml"
|
|
|
|
ansible.verbose = 'vv'
|
|
|
|
ansible.sudo = true
|
2017-10-26 15:59:24 +07:00
|
|
|
ansible.extra_vars = opts[:vars]
|
2017-06-05 21:21:47 +07:00
|
|
|
end
|
2015-07-15 17:14:39 +07:00
|
|
|
end
|
|
|
|
end
|
2017-06-05 21:21:47 +07:00
|
|
|
|
|
|
|
# See: https://forums.freebsd.org/threads/52717/
|
|
|
|
# vms_freebsd.each do |opts|
|
|
|
|
# config.vm.define opts[:name] do |m|
|
|
|
|
# m.vm.box = opts[:box]
|
|
|
|
# m.vm.provider "virtualbox" do |v|
|
|
|
|
# v.vm.cpus = 1
|
|
|
|
# v.vm.memory = 256
|
|
|
|
# v.vm.guest = :freebsd
|
|
|
|
# v.vm.synced_folder ".", "/vagrant", id: "vagrant-root", disabled: true
|
|
|
|
# v.vm.base_mac = "080027D14C66"
|
|
|
|
# end
|
|
|
|
# config.ssh.shell = "sh"
|
|
|
|
# m.vm.provision "shell", inline: "pkg install -y python bash"
|
|
|
|
# m.vm.provision "ansible" do |ansible|
|
|
|
|
# ansible.playbook = "tests/test.yml"
|
|
|
|
# ansible.verbose = 'vv'
|
|
|
|
# ansible.sudo = true
|
|
|
|
# ansible.extra_vars = {
|
|
|
|
# ansible_python_interpreter: '/usr/local/bin/python'
|
|
|
|
# }
|
|
|
|
# end
|
|
|
|
# end
|
|
|
|
# end
|
2015-07-15 17:14:39 +07:00
|
|
|
end
|