vagrant-yarrs-and-yamls 1.0.5 → 1.0.7

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: 56a27e5be2a3fa276fbbba42596bc74910a255d1
4
- data.tar.gz: 03a97984e2db9b80671251f83032fa80d84a7169
3
+ metadata.gz: 396046b28407cc8957de6a9779e2cf802045088e
4
+ data.tar.gz: 97f06059b95efd38253577cbcf0e7d8965f0bdb4
5
5
  SHA512:
6
- metadata.gz: 6cbb96839b6d8806d72b45bb17561efade3da338acab1dfa94feda919e17a41dd0ed218c7dfdb5fdd981f18f2d55ca0bdbcd79f6910a2a8b8d3d9a03edcfe8b3
7
- data.tar.gz: d9177a80fcb033fc8505b3b40030eee01ff4af82d6c12fc914c6dfc16bf5e9fe3c8b745b1708806d8361a6e86f77274ce14bbdd5e5c2139202d798c94625acbc
6
+ metadata.gz: dd373c9aee208cade8131239434e9531032a623108acd39f26985515de091d5986c266275fb7785d6349d563c9f2d418bfe294bfb9d19f9603ffc7698b5c193d
7
+ data.tar.gz: 0a3483706d64ad60405153760b2adcc944a82b1cc51bdf3679ae2037eb2b2fd965c831bf724e69b5a936151419ecab521946dceb8fa2ad8796cd54e053c5078e
data/README.md CHANGED
@@ -29,43 +29,61 @@ Create a new file named `Yarrs.yaml`
29
29
  # For more information and examples, please see the online documentation at
30
30
  # https://github.com/ptahdunbar/yarrs-and-yamls
31
31
  ---
32
- boxes:
33
- - hostname: vagrant
34
- box: ubuntu/trusty64
35
- ip: "10.10.10.100"
36
- update: true
37
- nodejs: true
38
- php:
39
- - xdebug
40
- - composer
41
- - wp
42
- databases:
43
- - foo
44
- - bar
45
- synced_folders:
46
- - host: "."
47
- guest: "/var/www"
48
- # type: "nfs"
49
- owner: "www-data"
50
- group: "www-data"
51
- mount_options:
52
- - dmode=775
53
- - fmode=667
54
- rsync__args:
55
- - "--verbose"
56
- - "--archive"
57
- - "--delete"
58
- - "-z"
59
- rsync__exclude:
60
- - ".env.production"
61
- - ".env.production_network"
62
- provision:
63
- - path: provision/apache2.sh
64
- variables:
65
- - key: FOO
66
- value: bar
32
+ hostname: vagrant
33
+ box: ubuntu/trusty64
34
+ ip: "10.10.10.100"
35
+ update: true
36
+ nodejs: true
37
+ php:
38
+ - xdebug
39
+ - composer
40
+ - wp
41
+ databases:
42
+ - foo
43
+ - bar
44
+ synced_folders:
45
+ - host: "."
46
+ guest: "/var/www"
47
+ # type: "nfs"
48
+ owner: "www-data"
49
+ group: "www-data"
50
+ mount_options:
51
+ - dmode=775
52
+ - fmode=667
53
+ rsync__args:
54
+ - "--verbose"
55
+ - "--archive"
56
+ - "--delete"
57
+ - "-z"
58
+ rsync__exclude:
59
+ - ".env.production"
60
+ - ".env.production_network"
61
+ provision:
62
+ - path: provision/apache2.sh
63
+ variables:
64
+ - key: FOO
65
+ value: bar
66
+
67
+ digital_ocean:
68
+ token: secret-token-goes-here
69
+ private_key_path: ~/.ssh/id_rsa
70
+ ssh_key_name: do-ssh-key-name
71
+ username: root
72
+ size: 512mb
67
73
  ```
68
74
 
69
75
  That's it! Boot up your environment:
70
76
 
71
77
  ```vagrant up```
78
+
79
+
80
+ ### Environment variables:
81
+
82
+ - DIGITAL_OCEAN_TOKEN
83
+ - DIGITAL_OCEAN_PRIVATE_KEY_PATH
84
+ - DIGITAL_OCEAN_SSH_KEY_NAME
85
+
86
+ - AWS_PRIVATE_KEY_PATH
87
+ - AWS_ACCESS_KEY
88
+ - AWS_SECRET_KEY
89
+ - AWS_SESSION_TOKEN
@@ -5,15 +5,15 @@ server {
5
5
  <% if ssl? %>
6
6
 
7
7
  listen 443 ssl;
8
- ssl_certificate /etc/nginx/ssl/<% host %>.crt;
9
- ssl_certificate_key /etc/nginx/ssl/<% host %>.key;
8
+ ssl_certificate /etc/nginx/ssl/<%= host %>.crt;
9
+ ssl_certificate_key /etc/nginx/ssl/<%= host %>.key;
10
10
 
11
11
  <% end %>
12
12
  root <%= path %>;
13
13
  index index.html index.php;
14
14
  <% if host? %>
15
15
 
16
- server_name <% host %>;
16
+ server_name <%= host %>;
17
17
 
18
18
  <% end %>
19
19
  location / {
@@ -24,7 +24,7 @@ server {
24
24
  location = /robots.txt { access_log off; log_not_found off; }
25
25
 
26
26
  access_log off;
27
- error_log /var/log/nginx/<% host %>-error.log error;
27
+ error_log /var/log/nginx/<%= host %>-error.log error;
28
28
  sendfile off;
29
29
 
30
30
  location ~ \.php\$ {
@@ -46,7 +46,13 @@ def yarrs(yamlfile, vagrant_config)
46
46
  end
47
47
 
48
48
  def apply_vagrant_hostupdater(node, settings)
49
- if defined? VagrantPlugins::HostsUpdater && settings["hostname"] && settings["ip"]
49
+ return if ! defined? VagrantPlugins::HostsUpdater
50
+
51
+ return if !! ENV['VAGRANT_DEFAULT_PROVIDER'].to_s.index('digital_ocean')
52
+
53
+ return if ! get_cli_flag('digital_ocean')
54
+
55
+ if settings["hostname"] && settings["ip"]
50
56
  sites = get_config_part('sites', settings)
51
57
  node.hostsupdater.aliases = sites
52
58
  else
@@ -54,6 +60,14 @@ def apply_vagrant_hostupdater(node, settings)
54
60
  end
55
61
  end
56
62
 
63
+ def get_cli_flag(flag)
64
+ ARGV.each do |arg|
65
+ return true if arg.index(flag)
66
+ end
67
+
68
+ return false
69
+ end
70
+
57
71
  def apply_vagrant_settings(node, settings)
58
72
  node.vm.box = settings["box"]
59
73
  node.vm.box_url = settings["box_url"]
@@ -211,7 +225,7 @@ def apply_digitalocean_providier(node, settings)
211
225
 
212
226
  override.ssh.private_key_path = settings["digital_ocean"]["private_key_path"] || ENV["DIGITAL_OCEAN_PRIVATE_KEY_PATH"]
213
227
  override.ssh.username = settings["digital_ocean"]["username"] if settings["digital_ocean"]["username"]
214
- digital_ocean.ssh_key_name = settings["digital_ocean"].include?("ssh_key_name") ? settings["digital_ocean"]["ssh_key_name"] : 'Vagrant'
228
+ digital_ocean.ssh_key_name = settings["digital_ocean"].include?("ssh_key_name") ? settings["digital_ocean"]["ssh_key_name"] : ENV["DIGITAL_OCEAN_SSH_KEY_NAME"]
215
229
 
216
230
  # Optional
217
231
  digital_ocean.image = settings["digital_ocean"].include?("image") ? settings["digital_ocean"]["image"] : "ubuntu-14-04-x64"
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module YarrsAndYamls
3
- VERSION = '1.0.5'
3
+ VERSION = '1.0.7'
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.5
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pirate Dunbar