瀏覽代碼

Fix trailing whitespace in Vagrantfile

Also replace the global variable with a local one
Greg Karékinian 11 年之前
父節點
當前提交
ba3b812bf9
共有 1 個檔案被更改,包括 14 行新增15 行删除
  1. 14
    15
      Vagrantfile

+ 14
- 15
Vagrantfile 查看文件

@@ -1,19 +1,6 @@
1 1
 # The following patch needs to be applied for ansible to run cleanly on vagrant up:
2 2
 # https://github.com/mitchellh/vagrant/pull/1723.diff on /opt/vagrant/embedded/gems/gems/vagrant-1.2.x
3 3
 
4
-$boxes = [
5
-  {
6
-    :name => 'ansible.local',
7
-    :forwards => { 22  => 22222,
8
-                   80  => 80,
9
-                   25  => 25,
10
-                   143 => 143,
11
-                   465 => 465,
12
-                   993 => 993 
13
-    }
14
-  }
15
-]
16
-
17 4
 Vagrant.configure('2') do |config|
18 5
   config.vm.provider :lxc do |lxc, override|
19 6
     override.vm.box     = 'precise64'
@@ -25,7 +12,19 @@ Vagrant.configure('2') do |config|
25 12
     override.vm.box_url = 'http://files.vagrantup.com/precise64.box'
26 13
   end
27 14
 
28
-  $boxes.each do |opts| 
15
+  boxes = [
16
+    {
17
+      :name => 'ansible.local',
18
+      :forwards => { 22  => 22222,
19
+                     80  => 80,
20
+                     25  => 25,
21
+                     143 => 143,
22
+                     465 => 465,
23
+                     993 => 993 }
24
+    }
25
+  ]
26
+
27
+  boxes.each do |opts|
29 28
     config.vm.hostname = opts[:name]
30 29
 
31 30
     opts[:forwards].each do |guest_port, host_port|
@@ -38,7 +37,7 @@ Vagrant.configure('2') do |config|
38 37
     config.vm.provision :ansible do |ansible|
39 38
       ansible.playbook = 'site.yml'
40 39
     end
41
-    
40
+
42 41
     config.vm.provision :shell,
43 42
                         :inline => "echo [test] > /vagrant/hosts.autogen && ifconfig eth0 | grep 'inet addr' | awk '{print $2}' | cut -d: -f2 >> /vagrant/hosts.autogen"
44 43
   end

Loading…
取消
儲存