open-dock 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +22 -15
- data/lib/open-dock/providers/google_cloud.rb +2 -1
- data/lib/open-dock/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 940bc242b6140cb9154b064972a5b8d88cdcb5ce
|
4
|
+
data.tar.gz: bc22f1af66a05fa1b1bfe4c3db57e4c45689594d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f4eab6c8fb5614e00f63b3c0fa70ddb1eb6a7b5f40ed6886b43a016d36b389923d472c67f1d568e663d1c906bccedb1baeaa8e255a2e23d7aa98793b55b25d4
|
7
|
+
data.tar.gz: 19e326b569aa712f28b5d358af66f0836b954394b9fc35567034872d13cc3027a023c850fb22da9198e3edbc49c5bc7061320b92080c867b20d37912b5e5e590
|
data/README.md
CHANGED
@@ -49,17 +49,29 @@ TODO: Create more providers (aws, linode, gcloud, ...)
|
|
49
49
|
|
50
50
|
### Digital Ocean
|
51
51
|
|
52
|
-
|
52
|
+
Pre-requisites:
|
53
|
+
|
54
|
+
* Create DigitalOcean account
|
55
|
+
* Activate Read/Write token at: DigitalOcean console > Apps & API > Generate new token. Be sure to give write permissions.
|
56
|
+
|
57
|
+
For a Digital Ocean provider create a file (ops/providers/digital_ocean.yml) with your account API key:
|
53
58
|
|
54
59
|
```yml
|
55
60
|
token: a206ae60dda6bxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcf0cbf41
|
56
61
|
```
|
57
62
|
|
58
|
-
Token can be activated in your DigitaOcean console > Apps & API > Generate new token. Be sure to give write premissions.
|
59
|
-
|
60
63
|
### Google Cloud
|
61
64
|
|
62
|
-
|
65
|
+
Pre-requisites:
|
66
|
+
|
67
|
+
* Create GoogleCloud account
|
68
|
+
* Create a Project at the console
|
69
|
+
* Create a service account in the project console:
|
70
|
+
* [Here the instructions](https://developers.google.com/accounts/docs/OAuth2ServiceAccount#creatinganaccount)
|
71
|
+
* Download the .p12 file (for the ‘google_key_location’ parameter) and annotate ‘google_client_email’
|
72
|
+
* Create a firewall rule to connect properly the servers (i.e. Allow tcp:1-65535): Project console > Compute > Compute Engine > Networks > default> Firewall rules > Create New
|
73
|
+
|
74
|
+
To configure Google Cloud provider create a file (ops/providers/digital_ocean.yml) with these params:
|
63
75
|
|
64
76
|
```yml
|
65
77
|
google_client_email: "850xxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxtauvbl@developer.gserviceaccount.com"
|
@@ -67,12 +79,17 @@ google_project: "project_name"
|
|
67
79
|
google_key_location: "path_to_your_p12_file"
|
68
80
|
```
|
69
81
|
|
70
|
-
You can see how to create
|
82
|
+
You can see how to create at https://developers.google.com/accounts/docs/OAuth2ServiceAccount#creatinganaccount
|
71
83
|
|
72
84
|
## Configure HOST
|
73
85
|
|
74
86
|
With these files you can configure your instances/servers/droplets/ships on every provider you have configured in the last point.
|
75
87
|
|
88
|
+
Helpful commands:
|
89
|
+
|
90
|
+
* `ops list digital_ocean` list all possible parameter values to use in the yml file
|
91
|
+
* `ops create example.com` will create your host
|
92
|
+
|
76
93
|
### Digital Ocean Host
|
77
94
|
|
78
95
|
For a Digital Ocean host we can make the following file (ops/hosts/example.com.yml):
|
@@ -88,11 +105,6 @@ ssh_keys:
|
|
88
105
|
- e7:51:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:88:57
|
89
106
|
```
|
90
107
|
|
91
|
-
Helpful commands:
|
92
|
-
|
93
|
-
* `ops list digital_ocean` list all possible parameter values to use in the yml file
|
94
|
-
* `ops create example.com` will create your host
|
95
|
-
|
96
108
|
### Google Cloud Host
|
97
109
|
|
98
110
|
For a Google Cloud host we can make the following file (ops/hosts/example.com.yml):
|
@@ -108,11 +120,6 @@ source_image: coreos-stable-444-5-0-v20141016
|
|
108
120
|
disk_size_gb: 10
|
109
121
|
```
|
110
122
|
|
111
|
-
Helpful commands:
|
112
|
-
|
113
|
-
* `ops list google_cloud` list all possible parameter values to use in the yml file
|
114
|
-
* `ops create example.com` will create your host
|
115
|
-
|
116
123
|
##Configure hosted CONTAINERS (Docker)
|
117
124
|
|
118
125
|
In this file we can configure all containers to run in the host provided in the name:
|
@@ -11,13 +11,14 @@ class GoogleCloud < Provider
|
|
11
11
|
size_gb: config["disk_size_gb"],
|
12
12
|
zone_name: config["zone_name"],
|
13
13
|
source_image: config["source_image"]
|
14
|
-
|
14
|
+
disk.wait_for{ disk.ready? }
|
15
15
|
server = @connection.servers.bootstrap name: config["name"].parameterize,
|
16
16
|
machine_type: config["machine_type"],
|
17
17
|
zone_name: config["zone_name"],
|
18
18
|
disks: [disk.get_as_boot_disk(true)],
|
19
19
|
user: config["user"],
|
20
20
|
public_key_path: File.expand_path(config["public_key_path"])
|
21
|
+
server.wait_for{ server.ready? }
|
21
22
|
server.set_disk_auto_delete true, server.disks[0]["deviceName"]
|
22
23
|
|
23
24
|
ip = server.network_interfaces[0]["accessConfigs"][0]["natIP"]
|
data/lib/open-dock/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: open-dock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Lebrijo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|