forked from akondas/ansible-role-php7
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Vagrantfile
71 lines (59 loc) · 1.39 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# -*- mode: ruby -*-
DOMAIN = "php7.local"
instances = [
{
:name => "ubuntu1404",
:image => "ubuntu/trusty64"
},
{
:name => "ubuntu1604",
:image => "ubuntu/xenial64"
},
{
:name => "ubuntu1804",
:image => "ubuntu/bionic64"
},
{
:name => "debian8",
:image => "debian/jessie64"
},
{
:name => "debian9",
:image => "debian/stretch64"
},
{
:name => "centos6",
:image => "bento/centos-6.9"
},
{
:name => "centos7",
:image => "bento/centos-7.4"
}
]
# Main
######
Vagrant.configure("2") do |config|
# Loop by each.
instances.each do |instance|
config.vm.define instance[:name] do |node|
node.vm.box = instance[:image].to_s
# hostname = <instance name>.<DOMAIN>
node.vm.hostname = instance[:name].to_s + "." + DOMAIN
node.vm.provider "virtualbox" do |vb|
vb.linked_clone = true
end
# Only for Ubuntu 16.04.
if ( instance[:name].to_s == "ubuntu1604" )
node.vm.provision "shell",
inline: "sudo sed -i 's/archive.ubuntu.com/free.nchc.org.tw/g' /etc/apt/sources.list"
node.vm.provision "shell",
inline: "sudo apt update && sudo apt install -y python"
end
node.vm.provision "ansible" do |ansible|
ansible.playbook = "setup.yml"
ansible.become = true
end
end
end
end
# vi: set ft=ruby :