2015-07-23 21:35:25 +07:00
|
|
|
# -*- mode: ruby -*-
|
|
|
|
# vi: set ft=ruby :
|
|
|
|
# vi: set tabstop=2 :
|
|
|
|
# vi: set shiftwidth=2 :
|
|
|
|
|
|
|
|
Vagrant.configure("2") do |config|
|
|
|
|
|
2017-06-06 21:27:11 +07:00
|
|
|
vms_debian = [
|
2017-06-13 16:51:51 +07:00
|
|
|
{ :name => "debian-stretch-php70", :box => "debian/stretch64", :vars => { }},
|
2018-03-18 23:28:57 +07:00
|
|
|
{ :name => "debian-stretch-php71", :box => "debian/stretch64", :vars => { "php_version": '7.1' }},
|
2018-03-19 01:30:21 +07:00
|
|
|
{ :name => "debian-stretch-php72", :box => "debian/stretch64", :vars => { "php_version": '7.2' }},
|
2018-10-28 18:29:56 +07:00
|
|
|
{ :name => "debian-stretch-php73", :box => "debian/stretch64", :vars => { "php_version": '7.3' }},
|
2019-04-19 19:36:20 +07:00
|
|
|
{ :name => "debian-buster-php73", :box => "debian/buster64", :vars => { }},
|
2018-03-19 01:30:21 +07:00
|
|
|
{ :name => "ubuntu-xenial-php70", :box => "ubuntu/xenial64", :vars => { }},
|
|
|
|
{ :name => "ubuntu-bionic-php72", :box => "ubuntu/bionic64", :vars => { }},
|
2015-07-23 21:35:25 +07:00
|
|
|
]
|
|
|
|
|
2018-03-19 03:29:47 +07:00
|
|
|
vms_freebsd = [
|
|
|
|
{ :name => "freebsd-11", :box => "freebsd/FreeBSD-11.1-STABLE", :vars => {} },
|
|
|
|
{ :name => "freebsd-12", :box => "freebsd/FreeBSD-12.0-CURRENT", :vars => {} }
|
|
|
|
]
|
|
|
|
|
2017-06-06 21:27:11 +07:00
|
|
|
conts = [
|
2018-03-19 03:46:47 +07:00
|
|
|
{ :name => "docker-debian-stretch-php70", :docker => "hanxhx/vagrant-ansible:debian9", :vars => { }},
|
|
|
|
{ :name => "docker-debian-stretch-php71", :docker => "hanxhx/vagrant-ansible:debian9", :vars => { "php_version": '7.1' }},
|
|
|
|
{ :name => "docker-debian-stretch-php72", :docker => "hanxhx/vagrant-ansible:debian9", :vars => { "php_version": '7.2' }},
|
2018-10-28 18:29:56 +07:00
|
|
|
{ :name => "docker-debian-stretch-php73", :docker => "hanxhx/vagrant-ansible:debian9", :vars => { "php_version": '7.3' }},
|
2019-04-19 19:36:20 +07:00
|
|
|
{ :name => "docker-debian-buster-php73", :docker => "hanxhx/vagrant-ansible:debian10", :vars => { }},
|
2018-03-19 03:46:47 +07:00
|
|
|
{ :name => "docker-ubuntu-xenial-php70", :docker => "hanxhx/vagrant-ansible:ubuntu16.04", :vars => { }},
|
|
|
|
{ :name => "docker-ubuntu-bionic-php72", :docker => "hanxhx/vagrant-ansible:ubuntu18.04", :vars => { }},
|
2017-06-06 21:27:11 +07:00
|
|
|
]
|
2015-07-23 21:35:25 +07:00
|
|
|
|
2017-06-06 21:27:11 +07:00
|
|
|
config.vm.network "private_network", type: "dhcp"
|
2015-07-23 21:35:25 +07:00
|
|
|
|
2017-06-06 21:27:11 +07:00
|
|
|
conts.each do |opts|
|
|
|
|
config.vm.define opts[:name] do |m|
|
|
|
|
m.vm.provider "docker" do |d|
|
|
|
|
d.image = opts[:docker]
|
|
|
|
d.remains_running = true
|
|
|
|
d.has_ssh = true
|
|
|
|
end
|
2018-10-29 20:15:02 +07:00
|
|
|
m.vm.provision "shell", inline: "apt-get update && apt-get install -y python python-apt"
|
2015-07-23 21:35:25 +07:00
|
|
|
m.vm.provision "ansible" do |ansible|
|
|
|
|
ansible.playbook = "tests/test.yml"
|
|
|
|
ansible.verbose = 'vv'
|
2017-11-22 22:28:35 +07:00
|
|
|
ansible.become = true
|
2017-06-06 21:27:11 +07:00
|
|
|
ansible.extra_vars = opts[:vars]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
vms_debian.each do |opts|
|
|
|
|
config.vm.define opts[:name] do |m|
|
|
|
|
m.vm.box = opts[:box]
|
|
|
|
m.vm.provider "virtualbox" do |v|
|
|
|
|
v.cpus = 1
|
|
|
|
v.memory = 256
|
2015-07-23 21:35:25 +07:00
|
|
|
end
|
2018-03-19 01:30:21 +07:00
|
|
|
m.vm.provision "shell", inline: "apt-get update && apt-get install -y ifupdown python"
|
|
|
|
m.vm.provision "ansible" do |ansible|
|
|
|
|
ansible.playbook = "tests/test.yml"
|
|
|
|
ansible.verbose = 'vv'
|
|
|
|
ansible.become = true
|
|
|
|
ansible.extra_vars = opts[:vars]
|
|
|
|
end
|
2015-07-23 21:35:25 +07:00
|
|
|
end
|
|
|
|
end
|
2018-03-19 03:29:47 +07:00
|
|
|
|
|
|
|
vms_freebsd.each do |opts|
|
2018-10-28 18:29:56 +07:00
|
|
|
config.vm.synced_folder ".", "/vagrant", disabled: true
|
2018-03-19 03:29:47 +07:00
|
|
|
config.vm.base_mac = "080027D14C66"
|
|
|
|
config.vm.define opts[:name] do |m|
|
|
|
|
m.vm.box = opts[:box]
|
|
|
|
m.vm.provider "virtualbox" do |v, override|
|
|
|
|
override.ssh.shell = "csh"
|
|
|
|
v.cpus = 2
|
|
|
|
v.memory = 512
|
|
|
|
end
|
|
|
|
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.become = true
|
|
|
|
ansible.extra_vars = opts[:vars].merge({ "ansible_python_interpreter": '/usr/local/bin/python' })
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-07-23 21:35:25 +07:00
|
|
|
end
|