vagrant-yarrs-and-yamls 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4827f2adbb6b62564cc348077b3a13ebf28869ac
4
- data.tar.gz: 34e8bdb21d75adb2716367b092af997d7a671498
3
+ metadata.gz: 56a27e5be2a3fa276fbbba42596bc74910a255d1
4
+ data.tar.gz: 03a97984e2db9b80671251f83032fa80d84a7169
5
5
  SHA512:
6
- metadata.gz: 6c17c77066f4901386f5bb3b39f1d829c69ec127e5f8212fcdc4f8bd4813ad574999ee68c9003c2cf11d4428c4c2962429a61864a0c3fe1bca7458db275da5e7
7
- data.tar.gz: 80c5b021abe7dc77b380e75d03d590ceb1232acfb44d285f568caa1ce2181e571139e4643ffe43dce0b177ec159999cf7f4c4047404520df53d98c47a552fbb0
6
+ metadata.gz: 6cbb96839b6d8806d72b45bb17561efade3da338acab1dfa94feda919e17a41dd0ed218c7dfdb5fdd981f18f2d55ca0bdbcd79f6910a2a8b8d3d9a03edcfe8b3
7
+ data.tar.gz: d9177a80fcb033fc8505b3b40030eee01ff4af82d6c12fc914c6dfc16bf5e9fe3c8b745b1708806d8361a6e86f77274ce14bbdd5e5c2139202d798c94625acbc
@@ -20,6 +20,9 @@ def yarrs(yamlfile, vagrant_config)
20
20
  # format nodes into instances
21
21
  instances = prepare(config)
22
22
 
23
+ # DEBUG:
24
+ # puts "instances", instances
25
+
23
26
  # loop through each instance and apply settings
24
27
  instances.each do |hostname, settings|
25
28
 
@@ -45,10 +48,9 @@ end
45
48
  def apply_vagrant_hostupdater(node, settings)
46
49
  if defined? VagrantPlugins::HostsUpdater && settings["hostname"] && settings["ip"]
47
50
  sites = get_config_part('sites', settings)
48
- puts "yarrs-and-yamls: updating your host file with: #{sites}"
49
51
  node.hostsupdater.aliases = sites
50
52
  else
51
- puts "yarrs-and-yamls: vagrant-hostsupdater not installed. Please update your /etc/hosts file for: #{settings}"
53
+ puts "yarrs-and-yamls: ERROR - vagrant-hostsupdater not installed. Please update your /etc/hosts file for: #{settings}"
52
54
  end
53
55
  end
54
56
 
@@ -169,7 +171,7 @@ def apply_aws_provider(node, settings)
169
171
  aws.instance_type = settings["aws"]["instance_type"] if settings["aws"]["instance_type"]
170
172
  aws.keypair_name = settings["aws"]["keypair_name"] if settings["aws"]["keypair_name"]
171
173
  override.ssh.username = settings["aws"]["username"] if settings["aws"]["username"]
172
- override.ssh.private_key_path = settings["aws"]["private_key_path"] if settings["aws"]["private_key_path"]
174
+ override.ssh.private_key_path = settings["aws"]["private_key_path"] || ENV["AWS_PRIVATE_KEY_PATH"]
173
175
 
174
176
  # Alternative approach: add keys into your .bashrc or .zshrc profile
175
177
  # export AWS_SECRET_KEY=secret_key
@@ -199,15 +201,19 @@ end
199
201
  def apply_digitalocean_providier(node, settings)
200
202
  return unless settings["digital_ocean"]
201
203
 
204
+ # DEBUG:
205
+ # puts "digital_ocean", settings["digital_ocean"]
206
+
202
207
  node.vm.provider :digital_ocean do |digital_ocean, override|
203
208
  override.vm.box_url = "https://github.com/smdahlen/vagrant-digitalocean/raw/master/box/digital_ocean.box"
204
209
 
205
210
  digital_ocean.token = settings["digital_ocean"].include?("token") ? settings["digital_ocean"]["token"] : ENV["DIGITAL_OCEAN_TOKEN"]
206
211
 
207
- # Optional
208
- override.ssh.private_key_path = settings["digital_ocean"]["private_key_path"]
212
+ override.ssh.private_key_path = settings["digital_ocean"]["private_key_path"] || ENV["DIGITAL_OCEAN_PRIVATE_KEY_PATH"]
209
213
  override.ssh.username = settings["digital_ocean"]["username"] if settings["digital_ocean"]["username"]
210
214
  digital_ocean.ssh_key_name = settings["digital_ocean"].include?("ssh_key_name") ? settings["digital_ocean"]["ssh_key_name"] : 'Vagrant'
215
+
216
+ # Optional
211
217
  digital_ocean.image = settings["digital_ocean"].include?("image") ? settings["digital_ocean"]["image"] : "ubuntu-14-04-x64"
212
218
  digital_ocean.region = settings["digital_ocean"].include?("region") ? settings["digital_ocean"]["region"] : "nyc2"
213
219
  digital_ocean.size = settings["digital_ocean"].include?("size") ? settings["digital_ocean"]["size"] : "512mb"
@@ -228,6 +234,10 @@ def get_config_from_file(configfile)
228
234
  localfile = File.expand_path(configfile.dup)
229
235
  localfile = localfile.insert(configfile.index('.yaml'), '.local')
230
236
 
237
+ # DEBUG:
238
+ # puts "configfile", configfile
239
+ # puts "localfile", localfile
240
+
231
241
  if File.exists? localfile
232
242
  config = YAML.load_file(localfile)
233
243
  elsif File.exists? configfile
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module YarrsAndYamls
3
- VERSION = '1.0.4'
3
+ VERSION = '1.0.5'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-yarrs-and-yamls
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pirate Dunbar