sitefull-cloud 0.2 → 0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +2 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +183 -0
- data/lib/sitefull-cloud/provider/azure/instance.rb +12 -28
- data/lib/sitefull-cloud/provider/azure/networking.rb +5 -16
- data/lib/sitefull-cloud/version.rb +1 -1
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da3ddf3aa36b28ecf17a5c390808e09872161eed
|
4
|
+
data.tar.gz: 297001fa2261a4644b82a738351c79c257e47556
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5ae87d431219d01bbe1bd54e976d1b1bcd435ee1f9998c97c27201f46fe0ffe54841cdbb6d4a257ee0eb4bf02029a94796871cc9b868f7f701a76aea6b6f88b
|
7
|
+
data.tar.gz: ce935aebb00453482da55be9c866229eb5d73f9cb40fe77800f19aa8e890f5c219d26992ab41cea30e7427a04f39e0e2a7fe90c7e388748fcf6c7b562351ff78
|
data/.gitignore
CHANGED
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
sitefull-cloud
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.4.0
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,183 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
sitefull-cloud (0.3)
|
5
|
+
activesupport
|
6
|
+
aws-sdk
|
7
|
+
azure
|
8
|
+
azure_mgmt_compute
|
9
|
+
azure_mgmt_network
|
10
|
+
azure_mgmt_resources
|
11
|
+
azure_mgmt_storage
|
12
|
+
faraday
|
13
|
+
google-api-client
|
14
|
+
multi_json
|
15
|
+
net-ssh
|
16
|
+
signet
|
17
|
+
|
18
|
+
GEM
|
19
|
+
remote: https://rubygems.org/
|
20
|
+
specs:
|
21
|
+
activesupport (5.0.1)
|
22
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
23
|
+
i18n (~> 0.7)
|
24
|
+
minitest (~> 5.1)
|
25
|
+
tzinfo (~> 1.1)
|
26
|
+
addressable (2.5.0)
|
27
|
+
public_suffix (~> 2.0, >= 2.0.2)
|
28
|
+
aws-sdk (2.7.9)
|
29
|
+
aws-sdk-resources (= 2.7.9)
|
30
|
+
aws-sdk-core (2.7.9)
|
31
|
+
aws-sigv4 (~> 1.0)
|
32
|
+
jmespath (~> 1.0)
|
33
|
+
aws-sdk-resources (2.7.9)
|
34
|
+
aws-sdk-core (= 2.7.9)
|
35
|
+
aws-sigv4 (1.0.0)
|
36
|
+
azure (0.7.7)
|
37
|
+
addressable (~> 2.3)
|
38
|
+
azure-core (~> 0.1)
|
39
|
+
faraday (~> 0.9)
|
40
|
+
faraday_middleware (~> 0.10)
|
41
|
+
mime-types (>= 1, < 4.0)
|
42
|
+
nokogiri (~> 1.6)
|
43
|
+
systemu (~> 2.6)
|
44
|
+
thor (~> 0.19)
|
45
|
+
azure-core (0.1.7)
|
46
|
+
faraday (~> 0.9)
|
47
|
+
faraday_middleware (~> 0.10)
|
48
|
+
nokogiri (~> 1.6)
|
49
|
+
azure_mgmt_compute (0.9.0)
|
50
|
+
ms_rest_azure (~> 0.7.0)
|
51
|
+
azure_mgmt_network (0.9.0)
|
52
|
+
ms_rest_azure (~> 0.7.0)
|
53
|
+
azure_mgmt_resources (0.9.0)
|
54
|
+
ms_rest_azure (~> 0.7.0)
|
55
|
+
azure_mgmt_storage (0.9.0)
|
56
|
+
ms_rest_azure (~> 0.7.0)
|
57
|
+
codeclimate-test-reporter (1.0.5)
|
58
|
+
simplecov
|
59
|
+
concurrent-ruby (1.0.4)
|
60
|
+
declarative (0.0.9)
|
61
|
+
declarative-option (0.1.0)
|
62
|
+
diff-lcs (1.3)
|
63
|
+
docile (1.1.5)
|
64
|
+
domain_name (0.5.20161129)
|
65
|
+
unf (>= 0.0.5, < 1.0.0)
|
66
|
+
faraday (0.11.0)
|
67
|
+
multipart-post (>= 1.2, < 3)
|
68
|
+
faraday-cookie_jar (0.0.6)
|
69
|
+
faraday (>= 0.7.4)
|
70
|
+
http-cookie (~> 1.0.0)
|
71
|
+
faraday_middleware (0.11.0.1)
|
72
|
+
faraday (>= 0.7.4, < 1.0)
|
73
|
+
google-api-client (0.10.0)
|
74
|
+
addressable (~> 2.3)
|
75
|
+
googleauth (~> 0.5)
|
76
|
+
httpclient (~> 2.7)
|
77
|
+
hurley (~> 0.1)
|
78
|
+
memoist (~> 0.11)
|
79
|
+
mime-types (>= 1.6)
|
80
|
+
representable (~> 3.0)
|
81
|
+
retriable (>= 2.0, < 4.0)
|
82
|
+
googleauth (0.5.1)
|
83
|
+
faraday (~> 0.9)
|
84
|
+
jwt (~> 1.4)
|
85
|
+
logging (~> 2.0)
|
86
|
+
memoist (~> 0.12)
|
87
|
+
multi_json (~> 1.11)
|
88
|
+
os (~> 0.9)
|
89
|
+
signet (~> 0.7)
|
90
|
+
http-cookie (1.0.3)
|
91
|
+
domain_name (~> 0.5)
|
92
|
+
httpclient (2.8.3)
|
93
|
+
hurley (0.2)
|
94
|
+
i18n (0.8.0)
|
95
|
+
jmespath (1.3.1)
|
96
|
+
json (2.0.3)
|
97
|
+
jwt (1.5.6)
|
98
|
+
little-plugger (1.1.4)
|
99
|
+
logging (2.1.0)
|
100
|
+
little-plugger (~> 1.1)
|
101
|
+
multi_json (~> 1.10)
|
102
|
+
memoist (0.15.0)
|
103
|
+
mime-types (3.1)
|
104
|
+
mime-types-data (~> 3.2015)
|
105
|
+
mime-types-data (3.2016.0521)
|
106
|
+
mini_portile2 (2.1.0)
|
107
|
+
minitest (5.10.1)
|
108
|
+
ms_rest (0.6.3)
|
109
|
+
concurrent-ruby (~> 1.0)
|
110
|
+
faraday (~> 0.9)
|
111
|
+
timeliness (~> 0.3)
|
112
|
+
ms_rest_azure (0.7.0)
|
113
|
+
concurrent-ruby (~> 1.0)
|
114
|
+
faraday (~> 0.9)
|
115
|
+
faraday-cookie_jar (~> 0.0.6)
|
116
|
+
ms_rest (~> 0.6.3)
|
117
|
+
multi_json (1.12.1)
|
118
|
+
multipart-post (2.0.0)
|
119
|
+
net-ssh (4.0.1)
|
120
|
+
nokogiri (1.7.0.1)
|
121
|
+
mini_portile2 (~> 2.1.0)
|
122
|
+
os (0.9.6)
|
123
|
+
public_suffix (2.0.5)
|
124
|
+
rake (12.0.0)
|
125
|
+
representable (3.0.3)
|
126
|
+
declarative (< 0.1.0)
|
127
|
+
declarative-option (< 0.2.0)
|
128
|
+
uber (< 0.2.0)
|
129
|
+
retriable (3.0.0)
|
130
|
+
rspec (3.5.0)
|
131
|
+
rspec-core (~> 3.5.0)
|
132
|
+
rspec-expectations (~> 3.5.0)
|
133
|
+
rspec-mocks (~> 3.5.0)
|
134
|
+
rspec-core (3.5.4)
|
135
|
+
rspec-support (~> 3.5.0)
|
136
|
+
rspec-expectations (3.5.0)
|
137
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
138
|
+
rspec-support (~> 3.5.0)
|
139
|
+
rspec-mocks (3.5.0)
|
140
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
141
|
+
rspec-support (~> 3.5.0)
|
142
|
+
rspec-support (3.5.0)
|
143
|
+
shoulda-matchers (3.1.1)
|
144
|
+
activesupport (>= 4.0.0)
|
145
|
+
signet (0.7.3)
|
146
|
+
addressable (~> 2.3)
|
147
|
+
faraday (~> 0.9)
|
148
|
+
jwt (~> 1.5)
|
149
|
+
multi_json (~> 1.10)
|
150
|
+
simplecov (0.13.0)
|
151
|
+
docile (~> 1.1.0)
|
152
|
+
json (>= 1.8, < 3)
|
153
|
+
simplecov-html (~> 0.10.0)
|
154
|
+
simplecov-html (0.10.0)
|
155
|
+
systemu (2.6.5)
|
156
|
+
thor (0.19.4)
|
157
|
+
thread_safe (0.3.5)
|
158
|
+
timeliness (0.3.8)
|
159
|
+
tzinfo (1.2.2)
|
160
|
+
thread_safe (~> 0.1)
|
161
|
+
uber (0.1.0)
|
162
|
+
unf (0.1.4)
|
163
|
+
unf_ext
|
164
|
+
unf_ext (0.0.7.2)
|
165
|
+
|
166
|
+
PLATFORMS
|
167
|
+
ruby
|
168
|
+
|
169
|
+
DEPENDENCIES
|
170
|
+
activesupport
|
171
|
+
bundler
|
172
|
+
codeclimate-test-reporter
|
173
|
+
rake
|
174
|
+
rspec
|
175
|
+
shoulda-matchers
|
176
|
+
simplecov
|
177
|
+
sitefull-cloud!
|
178
|
+
|
179
|
+
RUBY VERSION
|
180
|
+
ruby 2.4.0p0
|
181
|
+
|
182
|
+
BUNDLED WITH
|
183
|
+
1.14.4
|
@@ -14,24 +14,18 @@ module Sitefull
|
|
14
14
|
private
|
15
15
|
|
16
16
|
def network_interface_setup(subnet, security_group, public_ip, name)
|
17
|
-
ip_configuration_props = NetworkInterfaceIPConfigurationPropertiesFormat.new
|
18
|
-
ip_configuration_props.private_ipallocation_method = 'Dynamic'
|
19
|
-
ip_configuration_props.subnet = subnet
|
20
|
-
ip_configuration_props.public_ipaddress = public_ip
|
21
|
-
|
22
17
|
ip_configuration = NetworkInterfaceIPConfiguration.new
|
23
18
|
ip_configuration.name = name
|
24
|
-
ip_configuration.
|
25
|
-
|
26
|
-
|
27
|
-
props.primary = true
|
28
|
-
props.network_security_group = security_group
|
29
|
-
props.ip_configurations = [ip_configuration]
|
19
|
+
ip_configuration.private_ipallocation_method = 'Dynamic'
|
20
|
+
ip_configuration.subnet = subnet
|
21
|
+
ip_configuration.public_ipaddress = public_ip
|
30
22
|
|
31
23
|
network_interface = NetworkInterface.new
|
32
24
|
network_interface.location = options[:region]
|
33
25
|
network_interface.name = name
|
34
|
-
network_interface.
|
26
|
+
network_interface.primary = true
|
27
|
+
network_interface.network_security_group = security_group
|
28
|
+
network_interface.ip_configurations = [ip_configuration]
|
35
29
|
|
36
30
|
connection.network.network_interfaces.create_or_update(resource_group_name, name, network_interface)
|
37
31
|
end
|
@@ -40,13 +34,9 @@ module Sitefull
|
|
40
34
|
dns_settings = PublicIPAddressDnsSettings.new
|
41
35
|
dns_settings.domain_name_label = name
|
42
36
|
|
43
|
-
props = PublicIPAddressPropertiesFormat.new
|
44
|
-
props.public_ipallocation_method = 'Dynamic'
|
45
|
-
props.dns_settings = dns_settings
|
46
|
-
|
47
37
|
public_ip = PublicIPAddress.new
|
38
|
+
public_ip.public_ipallocation_method = 'Dynamic'
|
48
39
|
public_ip.location = options[:region]
|
49
|
-
public_ip.properties = props
|
50
40
|
|
51
41
|
connection.network.public_ipaddresses.create_or_update(resource_group_name, name, public_ip)
|
52
42
|
end
|
@@ -59,14 +49,11 @@ module Sitefull
|
|
59
49
|
storage_account = storage_account(name)
|
60
50
|
return storage_account unless storage_account.nil?
|
61
51
|
|
62
|
-
properties = StorageAccountPropertiesCreateParameters.new
|
63
|
-
|
64
52
|
sku = Sku.new
|
65
53
|
sku.name = 'Standard_LRS'
|
66
54
|
sku.tier = 'Standard'
|
67
55
|
|
68
56
|
params = StorageAccountCreateParameters.new
|
69
|
-
params.properties = properties
|
70
57
|
params.sku = sku
|
71
58
|
params.kind = 'Storage'
|
72
59
|
params.location = options[:region]
|
@@ -80,8 +67,7 @@ module Sitefull
|
|
80
67
|
|
81
68
|
def instance_setup(storage, network_interface, instance_data)
|
82
69
|
# Create a model for new virtual machine
|
83
|
-
|
84
|
-
|
70
|
+
#
|
85
71
|
#windows_config = WindowsConfiguration.new
|
86
72
|
#windows_config.provision_vmagent = true
|
87
73
|
#windows_config.enable_automatic_updates = true
|
@@ -102,21 +88,19 @@ module Sitefull
|
|
102
88
|
os_profile.admin_username = instance_data[:key].ssh_user
|
103
89
|
os_profile.linux_configuration = linux_config
|
104
90
|
|
105
|
-
props.os_profile = os_profile
|
106
91
|
|
107
92
|
hardware_profile = HardwareProfile.new
|
108
93
|
hardware_profile.vm_size = instance_data[:machine_type]
|
109
|
-
props.hardware_profile = hardware_profile
|
110
|
-
|
111
|
-
props.storage_profile = create_storage_profile(instance_data[:image], storage.name)
|
112
94
|
|
113
95
|
network_profile = NetworkProfile.new
|
114
96
|
network_profile.network_interfaces = [network_interface]
|
115
|
-
props.network_profile = network_profile
|
116
97
|
|
117
98
|
params = VirtualMachine.new
|
118
99
|
params.type = 'Microsoft.Compute/virtualMachines'
|
119
|
-
params.
|
100
|
+
params.os_profile = os_profile
|
101
|
+
params.network_profile = network_profile
|
102
|
+
params.hardware_profile = hardware_profile
|
103
|
+
params.storage_profile = create_storage_profile(instance_data[:image], storage.name)
|
120
104
|
params.location = options[:region]
|
121
105
|
|
122
106
|
connection.compute.virtual_machines.create_or_update(resource_group_name, instance_data[:name], params)
|
@@ -8,44 +8,33 @@ module Sitefull
|
|
8
8
|
|
9
9
|
private
|
10
10
|
def security_group_setup
|
11
|
-
props = NetworkSecurityGroupPropertiesFormat.new
|
12
11
|
|
13
12
|
security_group = NetworkSecurityGroup.new
|
14
13
|
security_group.location = options[:region]
|
15
|
-
security_group.properties = props
|
16
14
|
|
17
15
|
connection.network.network_security_groups.create_or_update(resource_group_name, SECURITY_GROUP, security_group)
|
18
16
|
end
|
19
17
|
|
20
18
|
def network_setup(resource_group, security_group)
|
21
|
-
props = VirtualNetworkPropertiesFormat.new
|
22
|
-
|
23
19
|
address_space = AddressSpace.new
|
24
20
|
address_space.address_prefixes = [NETWORK_CIDR_BLOCK]
|
25
|
-
props.address_space = address_space
|
26
|
-
|
27
|
-
subnet_props = SubnetPropertiesFormat.new
|
28
|
-
subnet_props.address_prefix = SUBNET_CIDR_BLOCK
|
29
|
-
subnet_props.network_security_group = security_group
|
30
21
|
|
31
22
|
subnet = Subnet.new
|
32
23
|
subnet.name = SUBNET_NAME
|
33
|
-
subnet.
|
34
|
-
|
24
|
+
subnet.address_prefix = SUBNET_CIDR_BLOCK
|
25
|
+
subnet.network_security_group = security_group
|
35
26
|
|
36
27
|
params = VirtualNetwork.new
|
37
28
|
params.location = options[:region]
|
38
|
-
params.
|
29
|
+
params.address_space = address_space
|
30
|
+
params.subnets = [subnet]
|
39
31
|
|
40
32
|
connection.network.virtual_networks.create_or_update(resource_group.name, NETWORK_NAME, params)
|
41
33
|
end
|
42
34
|
|
43
35
|
def firewall_rule_setup(name, options = {})
|
44
|
-
props = SecurityRulePropertiesFormat.new
|
45
|
-
options.each { |key, value| props.send("#{key}=", value) }
|
46
|
-
|
47
36
|
security_rule = SecurityRule.new
|
48
|
-
security_rule.
|
37
|
+
options.each { |key, value| security_rule.send("#{key}=", value) }
|
49
38
|
|
50
39
|
connection.network.security_rules.create_or_update(resource_group_name, SECURITY_GROUP, name, security_rule)
|
51
40
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sitefull-cloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.3'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stanimir Dimitrov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -273,9 +273,12 @@ files:
|
|
273
273
|
- ".gitignore"
|
274
274
|
- ".rspec"
|
275
275
|
- ".rubocop.yml"
|
276
|
+
- ".ruby-gemset"
|
277
|
+
- ".ruby-version"
|
276
278
|
- ".travis.yml"
|
277
279
|
- CODE_OF_CONDUCT.md
|
278
280
|
- Gemfile
|
281
|
+
- Gemfile.lock
|
279
282
|
- LICENSE.txt
|
280
283
|
- README.md
|
281
284
|
- Rakefile
|
@@ -319,7 +322,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
319
322
|
version: '0'
|
320
323
|
requirements: []
|
321
324
|
rubyforge_project:
|
322
|
-
rubygems_version: 2.
|
325
|
+
rubygems_version: 2.6.10
|
323
326
|
signing_key:
|
324
327
|
specification_version: 4
|
325
328
|
summary: A module for automating cloud deployments using different cloud providers
|