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 +4 -4
- data/README.md +53 -35
- data/lib/templates/nginx_vhost.erb +4 -4
- data/lib/vagrant-yarrs-and-yamls/api.rb +16 -2
- data/lib/vagrant-yarrs-and-yamls/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 396046b28407cc8957de6a9779e2cf802045088e
|
4
|
+
data.tar.gz: 97f06059b95efd38253577cbcf0e7d8965f0bdb4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
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
|
9
|
-
ssl_certificate_key /etc/nginx/ssl
|
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
|
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
|
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
|
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"] :
|
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"
|