vagrant-flow 1.0.14 → 1.0.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 80519287c51d5fecfce4b0fb0064976b0930a57d
4
- data.tar.gz: dffb854411e5df8b0be42380923ca13c66c2d2ce
3
+ metadata.gz: 7b20ef24ebbdf159fc7d1e1569a191935b45ae5e
4
+ data.tar.gz: e540c87586b2984b4ea63f58fd21e7c13e27172a
5
5
  SHA512:
6
- metadata.gz: 67ba5d4c35627c6bf3c8a9ff393eaccd661fa6943345dc64635d5b9374ff7fa77a235f38e342745e96f9dcffad8db0556dc783a71465308213f6d9d64ccbc5b2
7
- data.tar.gz: c2e838fe6ec032f545eb7f68cf2120d465dcb2bea0cfa6cec253a86a4ad1168c8b1df266c8e8e75c8b5e3b999eeb34abfe0b3cec0cebc7a3cf0c749dc569bafe
6
+ metadata.gz: 9644ad9aa6c184bb2b923dbfd4aa7f6fde14ee860b02e9ea40d461086ef4f7af7e8d73e5aca9a88a68c4ebcc7b5fd894c81f6acd5d36acf9098b96ddad9c7fd7
7
+ data.tar.gz: ea7b51750ba3ddd471c5cb2c2bc060dd5afa5fe1c711291fa1a5a2eb1391eee6c0a59ea9db95a5f90ba8a888bc552ed08ef5cd6dce687af6445cebc4c9e5e5b5
data/README.md CHANGED
@@ -125,8 +125,9 @@ Example multiinitconfig.yml file (for use with no optional command line argument
125
125
  ---
126
126
  :intnetName: neverwinterDP
127
127
  machines:
128
+ #This will use all defaults and create a guest named machine1
128
129
  - name: machine1
129
- url: demandcube/centos-65_x86_64-VB-4.3.8
130
+ #Create another machine, but specify which .box to use with virtual box
130
131
  - name: server1
131
132
  url: demandcube/centos-64_x86_64-VB-4.3.8
132
133
  - name: jenkinstestmachine
@@ -137,21 +138,35 @@ machines:
137
138
  Example multiinitconfig.yml file for use with virtualbox and digitalocean providers. All the extra parameters are required to make digitalocean work.
138
139
  ```
139
140
  ---
140
- :sshPrivateKeyPath: ~/.ssh/id_rsa #Points to your private key file
141
- :digitalOceanApiKey: yourkeygoeshere #Get your digitalocen api key and client id from https://cloud.digitalocean.com/api_access
142
- :digitalOceanClientId: youclientidgoeshere
143
- :digitalOceanRegion: San Francisco 1 #This corresponds to the region option when creating droplets
141
+ #Where your ssh private key lives (for use with digital ocean)
142
+ #~/.ssh/id_rsa is the default, so you can omit this value if you want
143
+ :sshPrivateKeyPath: ~/.ssh/id_rsa
144
+
145
+ #These two keys (digitalOceanApiKey and digitalOceanClientId) must be set for digitalocean to work
146
+ #Omit them if you don't want digitalocean as a provider option in your vagrantfile
147
+ :digitalOceanApiKey: 782a1d830f62e57d985eb7b1c938f94f
148
+ :digitalOceanClientId: ae856c82c79398598838f3f93b7a7d5e
149
+
144
150
  :intnetName: neverwinterDP
145
151
  machines:
146
- - name: sparkngin1
147
- url: demandcube/centos-65_x86_64-VB-4.3.8
148
- digitalOceanImage: CentOS 6.5 x64 #This is the Image name you choose when creating a new droplet
149
- - name: sparkngin2
150
- url: demandcube/centos-65_x86_64-VB-4.3.8
151
- digitalOceanImage: CentOS 6.5 x64
152
- - name: jenkinsdp
153
- url: demandcube/centos-65_x86_64-VB-4.3.8
154
- digitalOceanImage: CentOS 6.5 x64
152
+ #Create a box with all defaults set for you
153
+ - name: fulldefaults
154
+
155
+ #Use a custom url for your virtual box image
156
+ - name: customvboxurl
157
+ url: demandcube/centos-64_x86_64-VB-4.3.8
158
+
159
+ #Set custom config for digitalocean
160
+ - name: digitaloceancustom
161
+ digitalOceanRegion: New York 2
162
+ digitalOceanImage: Debian 7.0 x64
163
+
164
+ #Set custom config for vbox and digitaloceanprovider
165
+ - name: digitaloceanvboxcustom
166
+ url: demandcube/centos-64_x86_64-VB-4.3.8
167
+ digitalOceanRegion: New York 2
168
+ digitalOceanImage: Debian 7.0 x64
169
+
155
170
 
156
171
  ```
157
172
 
@@ -4,15 +4,20 @@ require 'yaml'
4
4
 
5
5
  ###This shows how to make a valid configuration file in YAML format for vagrant-flow to consume with the ansible-inventory command
6
6
  x = {
7
+ #~/.ssh/id_rsa is also the default
7
8
  :sshPrivateKeyPath =>"~/.ssh/id_rsa",
8
- :digitalOceanApiKey => "digitaloceanapikeygoeshere",
9
- :digitalOceanClientId => "digitaloceanclientidgoeshere",
10
- :digitalOceanRegion => "San Francisco 1",
9
+
10
+ #These two keys must be set for digitalocean to work
11
+ #Omit them if you don't want digitalocean as a provider option in your vagrantfile
12
+ :digitalOceanApiKey => "123456789098765432",
13
+ :digitalOceanClientId => "fytudisughfsdalk",
14
+
11
15
  :intnetName=>"neverwinterDP",
12
16
  "machines" => [
13
- {"name"=>"sparkngin1", "url"=>"demandcube/centos-65_x86_64-VB-4.3.8", "digitalOceanImage"=>"CentOS 6.5 x64"},
14
- {"name"=>"sparkngin2", "url"=>"demandcube/centos-65_x86_64-VB-4.3.8", "digitalOceanImage"=>"CentOS 6.5 x64"},
15
- {"name"=>"jenkinsdp", "url"=>"demandcube/centos-65_x86_64-VB-4.3.8", "digitalOceanImage"=>"CentOS 6.5 x64"},
17
+ {"name"=>"fulldefaults"},
18
+ {"name"=>"customvboxurl", "url"=>"demandcube/centos-64_x86_64-VB-4.3.8",},
19
+ {"name"=> "digitaloceancustom", "digitalOceanRegion" => "New York 2", "digitalOceanImage"=>"Debian 7.0 x64"},
20
+ {"name"=> "digitaloceanvboxcustom", "url"=>"demandcube/centos-64_x86_64-VB-4.3.8", "digitalOceanRegion" => "New York 2", "digitalOceanImage"=>"Debian 7.0 x64" },
16
21
  ]
17
22
  }
18
23
 
@@ -26,6 +26,15 @@ module VagrantPlugins
26
26
  options[:provision_ignore_sentinel] = false
27
27
  options[:quiet] = false
28
28
 
29
+
30
+ #Defaults for machine and configs
31
+ default_sshPrivateKeyPath ="~/.ssh/id_rsa"
32
+ machineDefaults = {
33
+ "url" => "demandcube/centos-65_x86_64-VB-4.3.8",
34
+ "digitalOceanImage" =>"CentOS 6.5 x64",
35
+ "digitalOceanRegion" => "San Francisco 1"
36
+ }
37
+
29
38
  #Default virtualbox__intnet name for private network
30
39
  options[:vboxintnet] = "neverwinterDP"
31
40
 
@@ -128,6 +137,22 @@ module VagrantPlugins
128
137
  machine["ip"] = ip.to_s
129
138
  }
130
139
 
140
+ #Set default ssh private key (used by digitalocean provider option)
141
+ if not content.has_key?(:sshPrivateKeyPath)
142
+ content[:sshPrivateKeyPath] = default_sshPrivateKeyPath
143
+ end
144
+
145
+
146
+ content["machines"].each {|machine|
147
+ #Set defaults for digital ocean provicder if they're not provided in the config
148
+ machineDefaults.each {|key,val|
149
+ if not machine.has_key?(key)
150
+ machine[key] = val
151
+ end
152
+ }
153
+ }
154
+
155
+
131
156
 
132
157
  #Put Vagrantfile in pwd
133
158
  save_path = Pathname.new("Vagrantfile").expand_path(@env.cwd)
@@ -12,33 +12,35 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
12
12
 
13
13
  <% for machine in @machines %>
14
14
 
15
- config.vm.define :<%= machine["name"]%> do | <%= machine["name"]%> |
15
+ config.vm.define :<%= machine["name"]%> do | <%= machine["name"]%> |
16
+ <% if machine.has_key?("name") and machine.has_key?("url") %>
16
17
  <%= machine["name"]%>.vm.box = "<%= machine["url"]%>"
18
+ <% end %>
17
19
 
18
20
  # Create a private network
19
21
  <%= machine["name"]%>.vm.network :private_network, ip: "<%= machine["ip"]%>", virtualbox__intnet: "<%= @intnetName %>"
20
22
  <%= machine["name"]%>.vm.hostname = "<%= machine["name"]%>"
21
23
 
24
+ <% if machine.has_key?("digitalOceanImage") and machine.has_key?("digitalOceanRegion") and @digitalOceanApiKey and @digitalOceanClientId and @sshPrivateKeyPath %>
22
25
  #digitalOcean provider
23
- <% if machine.has_key?("digitalOceanImage") and @digitalOceanApiKey and @digitalOceanClientId and @sshPrivateKeyPath and @digitalOceanRegion%>
24
26
  <%= machine["name"]%>.vm.synced_folder ".", "/vagrant", disabled: true
25
27
  config.vm.provider :digital_ocean do |provider, override|
26
28
  override.ssh.private_key_path = '<%= @sshPrivateKeyPath %>'
27
29
  provider.client_id = '<%= @digitalOceanClientId %>'
28
30
  provider.api_key = '<%= @digitalOceanApiKey %>'
29
- provider.private_networking = 'true'
30
- provider.region = '<%= @digitalOceanRegion %>'
31
+ provider.region = '<%=machine["digitalOceanRegion"] %>'
31
32
  provider.image = '<%= machine["digitalOceanImage"] %>'
32
33
  end
33
34
  <% end %>
34
35
 
35
-
36
+ <% if machine.has_key?("name") and machine.has_key?("url") %>
36
37
  #VirtualBox provider
37
38
  config.vm.provider :virtualbox do |vb|
38
39
  vb.name = "<%= machine["name"]%>"
39
40
  # vb.customize ["modifyvm", :id, "--memory", "1024"]
40
41
  # vb.customize ["modifyvm", :id, "--cpus", "2"]
41
42
  end
43
+ <% end %>
42
44
 
43
45
  end
44
46
  <% end %>
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module VagrantFlow
3
- VERSION = "1.0.14"
3
+ VERSION = "1.0.15"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-flow
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.14
4
+ version: 1.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Morin