Skip to content

Commit

Permalink
Setting default hostname with Vagrant
Browse files Browse the repository at this point in the history
It can't set "ubuntu1404.php7.local" on Ubuntu 14.04 by Vagrant,
so we can change it with Ansible via enable the debug mode.
  • Loading branch information
chusiang committed May 5, 2017
1 parent ee95101 commit 16b0fba
Showing 1 changed file with 21 additions and 16 deletions.
37 changes: 21 additions & 16 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|

# Ubuntu 14.04
config.vm.define "ubuntu1404", primary: true do |node|
node.vm.box = "ubuntu/trusty64"
node.vm.hostname = "ubuntu1404.php7.local"
node.vm.provision "ansible" do |ansible|
ansible.playbook = "setup.yml"
ansible.sudo = true
Expand All @@ -14,25 +13,28 @@ Vagrant.configure("2") do |config|

# Debian 7
#config.vm.define "debian7" do |node|
# node.vm.box = "debian/wheezy64"
# node.vm.box = "debian/wheezy64"
# node.vm.hostname = "php7-debian7.local"
# node.vm.provision "ansible" do |ansible|
# ansible.playbook = "setup.yml"
# ansible.sudo = true
# end
# ansible.playbook = "setup.yml"
# ansible.sudo = true
# end
#end

# Debian 8
config.vm.define "debian8" do |node|
node.vm.box = "debian/jessie64"
node.vm.provision "ansible" do |ansible|
ansible.playbook = "setup.yml"
ansible.sudo = true
end
node.vm.box = "debian/jessie64"
node.vm.hostname = "debian8.php7.local"
node.vm.provision "ansible" do |ansible|
ansible.playbook = "setup.yml"
ansible.sudo = true
end
end

# CentOS 6.7
config.vm.define "centos6" do |node|
node.vm.box = "bento/centos-6.7"
node.vm.hostname = "centos6.php7.local"
node.vm.provision "ansible" do |ansible|
ansible.playbook = "setup.yml"
ansible.sudo = true
Expand All @@ -41,11 +43,14 @@ Vagrant.configure("2") do |config|

# CentOS 7.2
config.vm.define "centos7" do |node|
node.vm.box = "bento/centos-7.2"
node.vm.provision "ansible" do |ansible|
ansible.playbook = "setup.yml"
ansible.sudo = true
end
node.vm.box = "bento/centos-7.2"
node.vm.hostname = "centos7.php7.local"
node.vm.provision "ansible" do |ansible|
ansible.playbook = "setup.yml"
ansible.sudo = true
end
end

end

# vi: set ft=ruby :

0 comments on commit 16b0fba

Please sign in to comment.