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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- Y2YzZmVlNzZjYzQzZmI2MjRiYWM1ZjczYWFlNGM3MzhkYmYxMGY4Yg==
4
+ NTUyZDFmY2E5NThhOGNlNWZiZjI5ZjcyZjM3MzkxMDE1YTk1ZWRjZA==
5
5
  data.tar.gz: !binary |-
6
- ZDg1NTk3ZThlMmIwNjg1ZTUwNWIxYWUyMzY2ZWJlZjYyOTQ3NmE5OA==
6
+ YmFhYTBiZjA3NDRhZWU4MTkxOThhMWM3NWNkOTFhYmUxMmM5ZWQzNQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- Njc4OWQ0MTI0Yjg3Njk5NzE0MTE5ZjNhODE4YTBjY2I3ZTEyMDFmODVjNjlk
10
- OTAwMWRhZjZiOWYyYjIwZmEzOTBhOTNhOTNlZGFiOTQwNWM0NjM4YjUxNzRl
11
- MGJlOGZlZTlmYjRlZTViZTNkNGIyNDg0MWRmZWVlNWJjZTQzOTU=
9
+ M2I0MDMxNjUwODA0OWJjZDQwZGEzNjkwMjkzMjYyMGQwNzM0ZjFmZDEyNmZl
10
+ MThmODM4NmMzZjdkODc0YjdjNmFkYmRkY2RhMDllMzE0NWVlMmYzZGE2MGUw
11
+ Y2ExMTk2NDlkMTE3YTNjN2E3MmVhYmYzYTAxNzlhMGViOGM1NTM=
12
12
  data.tar.gz: !binary |-
13
- NTM4YjM4MGYzNmMzNjVlMzljNTgwNDIwZDAzZDMyNzQ1YzgyMGFiZTAwOTUx
14
- MWRjYjE3ZmNlZmMwYzRmZjkzZTMzYTRkMjIyNzhlNzgyZjI2OWU4ZWEwMjlk
15
- Y2NjNjAwZWMxODVmMGM3MzlmMmI3YjhjMWI0MDgxNDJmYTFjOGU=
13
+ ZDRlMDMzYWIxMDA4Mzc2YThlYjc4MzY0YWZjYWI4ZmQ5ZjY3MTBlM2ExYTY0
14
+ MmJhNTdhNzBkYjc4N2M3YmNlNjNjNWQyNGEwYWQ4MDEzMWNjYmNhMWYxZDU2
15
+ NzM4MTBiYmY2YmE0ZDcyN2Y3MmQ5MjJmZTlmODRmYmI3Yzg0MjE=
data/README.md CHANGED
@@ -1,113 +1,44 @@
1
- Vagrant driver for Zerg
1
+ Simple Amazon CloudFormation driver for Zerg
2
2
  ===
3
3
 
4
4
  Dependencies
5
5
  --------------
6
6
 
7
- - [vagrant-aws](https://github.com/mitchellh/vagrant-aws)
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
- - providertype - One of the supported Vagrant providers. Currenlty supported providers are: virtualbox, libvirt, aws
42
- - provider_options - hash of provider specific options.
43
- - raw_options - if some of the provider options do not map to a hash format - you can specify them as an array of strings. Each string should start with '[provider].'
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": "vagrant",
23
+ "drivertype": "cloudformation",
50
24
  "driveroptions": [
51
25
  {
52
- "providertype": "aws",
53
- "provider_options" : {
54
- "instance_type": "t1.micro",
55
- "access_key_id": "blah blah blah",
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
- "raw_options": [
69
- "virtualbox.customize [\"modifyvm\", :id, \"--natdnsproxy1\", \"off\"]",
70
- "virtualbox.customize [\"modifyvm\", :id, \"--natdnshostresolver1\", \"off\"]"
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
- ######[Forwarded ports](resources/ports_schema.template)
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
- - type - Type of task payload. 'shell', 'chef_client' or 'chef_solo'
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)
@@ -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
@@ -22,5 +22,5 @@
22
22
  #++
23
23
 
24
24
  module ZergrushCF
25
- VERSION = "0.0.1"
25
+ VERSION = "0.0.2"
26
26
  end
@@ -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.1
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-03-14 00:00:00.000000000 Z
11
+ date: 2014-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler