jellyfish-fog 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +21 -6
- data/config/product_questions/vmware_infrastructure.json +29 -0
- data/config/provisioners.json +2 -1
- data/lib/jellyfish_fog/infrastructure.rb +26 -0
- data/lib/jellyfish_fog/version.rb +1 -1
- data/lib/jellyfish_fog.rb +18 -6
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 427b613fa9699e771158869c39d66e8f4200f650
|
4
|
+
data.tar.gz: 81b93d5915c284d0b503240a11bf186f26659d30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 599f527a9e1528f45bbd8d0c542dc42c40edb0c5a010e16df03155e859a2b8021c9060c84dfff3298b2d817a2dae0f3ad4bad7c2ff603a3b284417436167caa5
|
7
|
+
data.tar.gz: 2adf5df6acdb6cb4371f28edf275a10138b30668b52a6e15a5106dcede98cf49276cc0c7c3fe3591272ee723a2518d8cb0c6364b47dfee5c66e9f28a7a94a726
|
data/README.md
CHANGED
@@ -27,16 +27,23 @@ Add the following keys which can be set using the `.env` file or explicitly by t
|
|
27
27
|
|
28
28
|
```
|
29
29
|
# GENERAL
|
30
|
-
JELLYFISH_MOCK_FOG
|
30
|
+
JELLYFISH_MOCK_FOG = true
|
31
31
|
|
32
32
|
# AWS SPECIFIC
|
33
|
-
JELLYFISH_AWS_ACCESS_KEY_ID
|
34
|
-
JELLYFISH_AWS_SECRET_ACCESS_KEY_ID
|
33
|
+
JELLYFISH_AWS_ACCESS_KEY_ID = key
|
34
|
+
JELLYFISH_AWS_SECRET_ACCESS_KEY_ID = secret
|
35
35
|
|
36
36
|
# AZURE SPECIFIC
|
37
|
-
JELLYFISH_AZURE_SUB_ID
|
38
|
-
JELLYFISH_AZURE_PEM_PATH
|
39
|
-
JELLYFISH_AZURE_API_URL
|
37
|
+
JELLYFISH_AZURE_SUB_ID = azure_subscription_id
|
38
|
+
JELLYFISH_AZURE_PEM_PATH = azure_certificate.pem
|
39
|
+
JELLYFISH_AZURE_API_URL = https://management.core.windows.net
|
40
|
+
|
41
|
+
# VMWARE SPECIFIC
|
42
|
+
JELLYFISH_VMWARE_USERNAME = vmware_user
|
43
|
+
JELLYFISH_VMWARE_PASSWORD = vmware_password
|
44
|
+
JELLYFISH_VMWARE_SERVER = vmware_server
|
45
|
+
JELLYFISH_VMWARE_EXPECTED_PUBKEY_HASH = vmware_pubkey_hash
|
46
|
+
|
40
47
|
|
41
48
|
```
|
42
49
|
|
@@ -52,6 +59,14 @@ JELLYFISH_AZURE_API_URL = https://management.core.windows.net
|
|
52
59
|
|
53
60
|
- `JELLYFISH_AZURE_API_URL` is the API endpoint used for Azure provisioning
|
54
61
|
|
62
|
+
- `JELLYFISH_VMWARE_USERNAME` is the vSphere user
|
63
|
+
|
64
|
+
- `JELLYFISH_VMWARE_PASSWORD` is the vSphere password
|
65
|
+
|
66
|
+
- `JELLYFISH_VMWARE_SERVER` is the vSphere server
|
67
|
+
|
68
|
+
- `JELLYFISH_VMWARE_EXPECTED_PUBKEY_HASH` is the public key hash of the vSphere environment. Can be obtained by passing a dummy value and checking error logs. See [here](https://gist.github.com/jedi4ever/1216529#file-gistfile1-txt-L77-L79) for details.
|
69
|
+
|
55
70
|
## License
|
56
71
|
|
57
72
|
See [LICENSE](https://github.com/projectjellyfish/jellyfish-fog/blob/master/LICENSE)
|
@@ -0,0 +1,29 @@
|
|
1
|
+
{
|
2
|
+
"type": "object",
|
3
|
+
"title": "VMWare Fog Infrastructure",
|
4
|
+
"description": "VMWare Fog Infrastructure",
|
5
|
+
"required" : ["instance_uuid", "name", "datacenter", "template_path"],
|
6
|
+
"properties" : {
|
7
|
+
"instance_uuid" :{
|
8
|
+
"title": "Instance UUID",
|
9
|
+
"type": "string",
|
10
|
+
"default": "42189f8b-b8d9-3a77-36c1-19f41f749e4f"
|
11
|
+
},
|
12
|
+
"name" :{
|
13
|
+
"title": "Name",
|
14
|
+
"type": "string",
|
15
|
+
"default": "RHEL6_TEST_CLONE"
|
16
|
+
},
|
17
|
+
"datacenter" :{
|
18
|
+
"title": "Datacenter",
|
19
|
+
"type": "string",
|
20
|
+
"default": "RSP"
|
21
|
+
},
|
22
|
+
"template_path" :{
|
23
|
+
"title": "Template Path",
|
24
|
+
"type": "string",
|
25
|
+
"default": "TestRHEL6"
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
data/config/provisioners.json
CHANGED
@@ -2,5 +2,6 @@
|
|
2
2
|
"AWS Fog Databases": "Jellyfish::Fog::AWS::Databases",
|
3
3
|
"AWS Fog Storage": "Jellyfish::Fog::AWS::Storage",
|
4
4
|
"AWS Fog Infrastructure": "Jellyfish::Fog::AWS::Infrastructure",
|
5
|
-
"Azure Fog Infrastructure": "Jellyfish::Fog::Azure::Infrastructure"
|
5
|
+
"Azure Fog Infrastructure": "Jellyfish::Fog::Azure::Infrastructure",
|
6
|
+
"VMWare Fog Infrastructure": "Jellyfish::Fog::VMWare::Infrastructure"
|
6
7
|
}
|
@@ -1,5 +1,30 @@
|
|
1
1
|
module Jellyfish
|
2
2
|
module Fog
|
3
|
+
module VMWare
|
4
|
+
class Infrastructure < Jellyfish::Provisioner
|
5
|
+
def provision
|
6
|
+
server = nil
|
7
|
+
|
8
|
+
handle_errors do
|
9
|
+
server = connection.vm_clone(details)
|
10
|
+
end
|
11
|
+
|
12
|
+
minimized_payload = {}
|
13
|
+
minimized_payload[:id] = server['new_vm']['id']
|
14
|
+
minimized_payload[:name] = server['new_vm']['name']
|
15
|
+
minimized_payload[:uuid] = server['new_vm']['uuid']
|
16
|
+
@order_item.provision_status = 'ok'
|
17
|
+
@order_item.payload_response = minimized_payload.to_json
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def connection
|
23
|
+
::Fog::Compute.new(Jellyfish::Fog::VMWare.settings)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
3
28
|
module AWS
|
4
29
|
class Infrastructure < Jellyfish::Provisioner
|
5
30
|
def provision
|
@@ -31,6 +56,7 @@ module Jellyfish
|
|
31
56
|
end
|
32
57
|
end
|
33
58
|
end
|
59
|
+
|
34
60
|
module Azure
|
35
61
|
class Infrastructure < Jellyfish::Provisioner
|
36
62
|
def provision
|
data/lib/jellyfish_fog.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'rbvmomi'
|
1
2
|
require 'azure'
|
2
3
|
require 'fog'
|
3
4
|
require 'fog/azure'
|
@@ -10,6 +11,23 @@ require 'jellyfish_fog/storage'
|
|
10
11
|
|
11
12
|
module Jellyfish
|
12
13
|
module Fog
|
14
|
+
def self.aws_settings
|
15
|
+
{
|
16
|
+
aws_access_key_id: ENV.fetch('JELLYFISH_AWS_ACCESS_KEY_ID'),
|
17
|
+
aws_secret_access_key: ENV.fetch('JELLYFISH_AWS_SECRET_ACCESS_KEY')
|
18
|
+
}
|
19
|
+
end
|
20
|
+
module VMWare
|
21
|
+
def self.settings
|
22
|
+
{
|
23
|
+
provider: 'vsphere',
|
24
|
+
vsphere_username: ENV.fetch('JELLYFISH_VMWARE_USERNAME'),
|
25
|
+
vsphere_password: ENV.fetch('JELLYFISH_VMWARE_PASSWORD'),
|
26
|
+
vsphere_server: ENV.fetch('JELLYFISH_VMWARE_SERVER'),
|
27
|
+
vsphere_expected_pubkey_hash: ENV.fetch('JELLYFISH_VMWARE_EXPECTED_PUBKEY_HASH')
|
28
|
+
}
|
29
|
+
end
|
30
|
+
end
|
13
31
|
module Azure
|
14
32
|
def self.settings
|
15
33
|
{
|
@@ -20,11 +38,5 @@ module Jellyfish
|
|
20
38
|
}
|
21
39
|
end
|
22
40
|
end
|
23
|
-
def self.aws_settings
|
24
|
-
{
|
25
|
-
aws_access_key_id: ENV.fetch('JELLYFISH_AWS_ACCESS_KEY_ID'),
|
26
|
-
aws_secret_access_key: ENV.fetch('JELLYFISH_AWS_SECRET_ACCESS_KEY')
|
27
|
-
}
|
28
|
-
end
|
29
41
|
end
|
30
42
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jellyfish-fog
|
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
|
- mafernando
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 0.6.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rbvmomi
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: fog
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -125,6 +139,7 @@ files:
|
|
125
139
|
- config/product_questions/database.json
|
126
140
|
- config/product_questions/infrastructure.json
|
127
141
|
- config/product_questions/storage.json
|
142
|
+
- config/product_questions/vmware_infrastructure.json
|
128
143
|
- config/provisioners.json
|
129
144
|
- lib/jellyfish-fog.rb
|
130
145
|
- lib/jellyfish_fog.rb
|