zergrush_cf 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +19 -88
- data/lib/zergrush_cf/init.rb +29 -0
- data/lib/zergrush_cf/version.rb +1 -1
- data/resources/option_schema.template +36 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NTUyZDFmY2E5NThhOGNlNWZiZjI5ZjcyZjM3MzkxMDE1YTk1ZWRjZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YmFhYTBiZjA3NDRhZWU4MTkxOThhMWM3NWNkOTFhYmUxMmM5ZWQzNQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
M2I0MDMxNjUwODA0OWJjZDQwZGEzNjkwMjkzMjYyMGQwNzM0ZjFmZDEyNmZl
|
10
|
+
MThmODM4NmMzZjdkODc0YjdjNmFkYmRkY2RhMDllMzE0NWVlMmYzZGE2MGUw
|
11
|
+
Y2ExMTk2NDlkMTE3YTNjN2E3MmVhYmYzYTAxNzlhMGViOGM1NTM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZDRlMDMzYWIxMDA4Mzc2YThlYjc4MzY0YWZjYWI4ZmQ5ZjY3MTBlM2ExYTY0
|
14
|
+
MmJhNTdhNzBkYjc4N2M3YmNlNjNjNWQyNGEwYWQ4MDEzMWNjYmNhMWYxZDU2
|
15
|
+
NzM4MTBiYmY2YmE0ZDcyN2Y3MmQ5MjJmZTlmODRmYmI3Yzg0MjE=
|
data/README.md
CHANGED
@@ -1,113 +1,44 @@
|
|
1
|
-
|
1
|
+
Simple Amazon CloudFormation driver for Zerg
|
2
2
|
===
|
3
3
|
|
4
4
|
Dependencies
|
5
5
|
--------------
|
6
6
|
|
7
|
-
- [
|
8
|
-
- [vagrant-libvirt](https://github.com/pradels/vagrant-libvirt)
|
9
|
-
- [vagrant-omnibus](https://github.com/schisamo/vagrant-omnibus)
|
10
|
-
- [vagrant-berkshelf](https://github.com/berkshelf/vagrant-berkshelf)
|
7
|
+
- [fog](http://fog.io/)
|
11
8
|
|
12
9
|
Additional properties defined
|
13
10
|
--------------
|
14
11
|
|
15
|
-
######[Synchronized folders](resources/folder_schema.template)
|
16
|
-
|
17
|
-
Defined by [Vagrant synced folders](http://docs.vagrantup.com/v2/synced-folders/)
|
18
|
-
|
19
|
-
Example use:
|
20
|
-
```
|
21
|
-
...
|
22
|
-
"create": true,
|
23
|
-
"mount_options": ["rw", "vers=3", "tcp"]
|
24
|
-
...
|
25
|
-
```
|
26
|
-
|
27
|
-
######[Networks](resources/networks_schema.template)
|
28
|
-
|
29
|
-
Defined by [Vagrant networking](http://docs.vagrantup.com/v2/networking/index.html)
|
30
|
-
|
31
|
-
Example use:
|
32
|
-
```
|
33
|
-
...
|
34
|
-
"type": "public_network",
|
35
|
-
"bridge": "en1: Wi-Fi (AirPort)"
|
36
|
-
...
|
37
|
-
```
|
38
|
-
|
39
12
|
######[Driver options](resources/option_schema.template)
|
40
13
|
|
41
|
-
-
|
42
|
-
-
|
43
|
-
-
|
14
|
+
- access_key_id - AWS access key id
|
15
|
+
- secret_access_key - AWS secret.
|
16
|
+
- template - body of a AWS CloudFormation template
|
17
|
+
- template_parameters -
|
44
18
|
|
45
19
|
Example use:
|
46
20
|
```
|
47
21
|
...
|
48
22
|
"driver": {
|
49
|
-
"drivertype": "
|
23
|
+
"drivertype": "cloudformation",
|
50
24
|
"driveroptions": [
|
51
25
|
{
|
52
|
-
"
|
53
|
-
"
|
54
|
-
|
55
|
-
|
56
|
-
"secret_access_key": "yadda yadda",
|
57
|
-
"keypair_name": "HURGHBURGHLGHRL",
|
58
|
-
"ami": "ami-3fec7956",
|
59
|
-
"region": "us-east-1"
|
60
|
-
}
|
61
|
-
},
|
62
|
-
{
|
63
|
-
"providertype": "virtualbox",
|
64
|
-
"provider_options" : {
|
65
|
-
"gui": false,
|
66
|
-
"memory": 256
|
26
|
+
"access_key_id": "ENV['AWS_ACCESS_KEY_ID']",
|
27
|
+
"secret_access_key": "ENV['AWS_SECRET_ACCESS_KEY']",
|
28
|
+
"template": {
|
29
|
+
...
|
67
30
|
},
|
68
|
-
"
|
69
|
-
"
|
70
|
-
"
|
71
|
-
|
31
|
+
"template_parameters": {
|
32
|
+
"Param1": "value",
|
33
|
+
"Param2": "ENV['SOME_VARIABLE']"
|
34
|
+
}
|
72
35
|
}
|
73
|
-
|
36
|
+
}
|
74
37
|
}
|
75
38
|
...
|
76
39
|
```
|
77
40
|
|
78
|
-
|
79
|
-
|
80
|
-
Defined by [Vagrant forwarded ports](http://docs.vagrantup.com/v2/networking/forwarded_ports.html)
|
81
|
-
|
82
|
-
Example use:
|
83
|
-
```
|
84
|
-
...
|
85
|
-
"guest_port": 8080,
|
86
|
-
"host_port": 80,
|
87
|
-
"protocol": "tcp"
|
88
|
-
...
|
89
|
-
```
|
90
|
-
|
91
|
-
######[SSH](resources/ssh_schema.template)
|
92
|
-
|
93
|
-
Defined by [Vagrant SSH](http://docs.vagrantup.com/v2/vagrantfile/ssh_settings.html)
|
94
|
-
|
95
|
-
Example use:
|
96
|
-
```
|
97
|
-
...
|
98
|
-
"username": "ubuntu",
|
99
|
-
"private_key_path": "PATH_TO_YOUR_PK",
|
100
|
-
"shell": "bash -l"
|
101
|
-
...
|
102
|
-
```
|
103
|
-
|
104
|
-
######[Tasks](resources/tasks_schema.template)
|
105
|
-
|
106
|
-
Describes what tasks a VM should run at provisioning step
|
41
|
+
Additional properties defined
|
42
|
+
--------------
|
107
43
|
|
108
|
-
|
109
|
-
- shell task parameters are defined by [Vagrant shell provisioner](http://docs.vagrantup.com/v2/provisioning/shell.html)
|
110
|
-
- chef_client and chef_solo task parameters map directly to Vagrant provisioner docs, **EXCEPT the node_name parameter**:
|
111
|
-
- [chef_solo provisioner](http://docs.vagrantup.com/v2/provisioning/chef_solo.html)
|
112
|
-
- [chef_client provisioner](https://docs.vagrantup.com/v2/provisioning/chef_client.html)
|
113
|
-
- [chef common options](http://docs.vagrantup.com/v2/provisioning/chef_common.html)
|
44
|
+
num_instances is ignored (always 1)
|
data/lib/zergrush_cf/init.rb
CHANGED
@@ -53,6 +53,35 @@ class CloudFormation < ZergGemPlugin::Plugin "/driver"
|
|
53
53
|
task_hash)
|
54
54
|
template_body = renderer.render
|
55
55
|
|
56
|
+
# see if we need to upload anything to s3?
|
57
|
+
if task_hash["vm"]["driver"]["driveroptions"][0]["storage"] != nil
|
58
|
+
if task_hash["vm"]["driver"]["driveroptions"][0]["storage"]["s3_bucket"] != nil
|
59
|
+
bucket_name = task_hash["vm"]["driver"]["driveroptions"][0]["storage"]["s3_bucket"]["name"]
|
60
|
+
is_public = task_hash["vm"]["driver"]["driveroptions"][0]["storage"]["s3_bucket"]["public"]
|
61
|
+
files = task_hash["vm"]["driver"]["driveroptions"][0]["storage"]["s3_bucket"]["files"]
|
62
|
+
|
63
|
+
# create a connection
|
64
|
+
connection = Fog::Storage.new({
|
65
|
+
:provider => 'AWS',
|
66
|
+
:aws_access_key_id => aws_key_id,
|
67
|
+
:aws_secret_access_key => aws_secret
|
68
|
+
})
|
69
|
+
|
70
|
+
directory = connection.directories.create(
|
71
|
+
:key => bucket_name,
|
72
|
+
:public => is_public
|
73
|
+
)
|
74
|
+
|
75
|
+
files.each { |file|
|
76
|
+
directory.files.create(
|
77
|
+
:key => file,
|
78
|
+
:body => File.open(File.join(hive_location, task_name, file)),
|
79
|
+
:public => is_public
|
80
|
+
)
|
81
|
+
}
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
56
85
|
cf = Fog::AWS::CloudFormation.new(
|
57
86
|
:aws_access_key_id => aws_key_id,
|
58
87
|
:aws_secret_access_key => aws_secret
|
data/lib/zergrush_cf/version.rb
CHANGED
@@ -9,4 +9,40 @@
|
|
9
9
|
},
|
10
10
|
"template_parameters": {
|
11
11
|
"type": "object"
|
12
|
+
},
|
13
|
+
"storage": {
|
14
|
+
"type": "object",
|
15
|
+
"properties": {
|
16
|
+
"s3_bucket": {
|
17
|
+
"type": "object",
|
18
|
+
"properties": {
|
19
|
+
"name": {
|
20
|
+
"type": "string"
|
21
|
+
},
|
22
|
+
"public": {
|
23
|
+
"type": "boolean"
|
24
|
+
},
|
25
|
+
"files": {
|
26
|
+
"type": "array",
|
27
|
+
"items": {
|
28
|
+
"properties": {
|
29
|
+
"file": {
|
30
|
+
"type": "string"
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
35
|
+
},
|
36
|
+
"required": [
|
37
|
+
"name",
|
38
|
+
"public",
|
39
|
+
"files"
|
40
|
+
],
|
41
|
+
"additionalProperties": false
|
42
|
+
}
|
43
|
+
},
|
44
|
+
"required": [
|
45
|
+
"s3_bucket"
|
46
|
+
],
|
47
|
+
"additionalProperties": false
|
12
48
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zergrush_cf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MTN Satellite Communications
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|