Skip to content
This repository was archived by the owner on Feb 2, 2021. It is now read-only.

Commit 5e3be1e

Browse files
authored
Merge pull request #20 from cloudify-examples/azure-stack
Azure stack
2 parents 5309598 + a7510cc commit 5e3be1e

File tree

2 files changed

+48
-3
lines changed

2 files changed

+48
-3
lines changed

azure.yaml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ tosca_definitions_version: cloudify_dsl_1_3
22

33
imports:
44
- http://www.getcloudify.org/spec/cloudify/4.3/types.yaml
5-
- http://www.getcloudify.org/spec/azure-plugin/1.5.1.1/plugin.yaml
5+
- http://www.getcloudify.org/spec/azure-plugin/1.6.1/plugin.yaml
66
- http://www.getcloudify.org/spec/utilities-plugin/1.5.2/plugin.yaml
77
- http://www.getcloudify.org/spec/fabric-plugin/1.5.1/plugin.yaml
88
- imports/manager-configuration.yaml
@@ -21,6 +21,23 @@ inputs:
2121
client_secret:
2222
type: string
2323

24+
endpoint_resource:
25+
default: https://management.core.windows.net/
26+
27+
endpoints_resource_manager:
28+
default: https://management.azure.com
29+
30+
endpoint_verify:
31+
default: True
32+
33+
endpoint_storage:
34+
type: string
35+
default: core.windows.net
36+
37+
endpoints_active_directory:
38+
type: string
39+
default: https://login.microsoftonline.com
40+
2441
location:
2542
default: eastus
2643

@@ -88,6 +105,11 @@ inputs:
88105
Resolving the IP for manager setup.
89106
default: { get_attribute: [ cloudify_host, public_ip ] }
90107

108+
network_api_version:
109+
description: >
110+
API Version for Network
111+
default: "2015-06-15"
112+
91113
secrets:
92114
description: >
93115
key, value pairs of secrets used in AWS blueprint examples.
@@ -150,6 +172,10 @@ dsl_definitions:
150172
tenant_id: { get_input: tenant_id }
151173
client_id: { get_input: client_id }
152174
client_secret: { get_input: client_secret }
175+
endpoint_resource: { get_input: endpoint_resource }
176+
endpoints_resource_manager: { get_input: endpoints_resource_manager }
177+
endpoint_verify: { get_input: endpoint_verify }
178+
endpoints_active_directory: { get_input: endpoints_active_directory }
153179

154180
node_templates:
155181

@@ -218,6 +244,7 @@ node_templates:
218244
type: cloudify.azure.nodes.network.PublicIPAddress
219245
properties:
220246
azure_config: *client_config
247+
api_version: { get_input: network_api_version }
221248
name: { concat: [ { get_input: resource_prefix }, 's0ip', { get_input: resource_suffix } ] }
222249
location: { get_input: location }
223250
retry_after: { get_input: retry_after }
@@ -231,6 +258,7 @@ node_templates:
231258
type: cloudify.azure.nodes.network.VirtualNetwork
232259
properties:
233260
azure_config: *client_config
261+
api_version: { get_input: network_api_version }
234262
name: { concat: [ { get_input: resource_prefix }, 'vn', { get_input: resource_suffix } ] }
235263
location: { get_input: location }
236264
retry_after: { get_input: retry_after }
@@ -242,6 +270,7 @@ node_templates:
242270
type: cloudify.azure.nodes.network.NetworkSecurityGroup
243271
properties:
244272
azure_config: *client_config
273+
api_version: { get_input: network_api_version }
245274
name: { concat: [ { get_input: resource_prefix }, 'sg', { get_input: resource_suffix } ] }
246275
location: { get_input: location }
247276
retry_after: { get_input: retry_after }
@@ -266,6 +295,7 @@ node_templates:
266295
type: cloudify.azure.nodes.network.Subnet
267296
properties:
268297
azure_config: *client_config
298+
api_version: { get_input: network_api_version }
269299
name: { concat: [ { get_input: resource_prefix }, 's0', { get_input: resource_suffix } ] }
270300
location: { get_input: location }
271301
retry_after: { get_input: retry_after }
@@ -279,6 +309,7 @@ node_templates:
279309
type: cloudify.azure.nodes.network.Subnet
280310
properties:
281311
azure_config: *client_config
312+
api_version: { get_input: network_api_version }
282313
name: { concat: [ { get_input: resource_prefix }, 's1', { get_input: resource_suffix } ] }
283314
location: { get_input: location }
284315
retry_after: { get_input: retry_after }
@@ -294,6 +325,7 @@ node_templates:
294325
type: cloudify.azure.nodes.network.IPConfiguration
295326
properties:
296327
azure_config: *client_config
328+
api_version: { get_input: network_api_version }
297329
name: { concat: [ { get_input: resource_prefix }, 's0ipc', { get_input: resource_suffix } ] }
298330
location: { get_input: location }
299331
retry_after: { get_input: retry_after }
@@ -311,6 +343,7 @@ node_templates:
311343
type: cloudify.azure.nodes.network.IPConfiguration
312344
properties:
313345
azure_config: *client_config
346+
api_version: { get_input: network_api_version }
314347
name: { concat: [ { get_input: resource_prefix }, 's1ipc', { get_input: resource_suffix } ] }
315348
location: { get_input: location }
316349
retry_after: { get_input: retry_after }
@@ -326,6 +359,7 @@ node_templates:
326359
type: cloudify.azure.nodes.network.NetworkInterfaceCard
327360
properties:
328361
azure_config: *client_config
362+
api_version: { get_input: network_api_version }
329363
name: { concat: [ { get_input: resource_prefix }, 's0nic', { get_input: resource_suffix } ] }
330364
location: { get_input: location }
331365
retry_after: { get_input: retry_after }
@@ -342,6 +376,7 @@ node_templates:
342376
type: cloudify.azure.nodes.network.NetworkInterfaceCard
343377
properties:
344378
azure_config: *client_config
379+
api_version: { get_input: network_api_version }
345380
name: { concat: [ { get_input: resource_prefix }, 's1nic', { get_input: resource_suffix } ] }
346381
location: { get_input: location }
347382
retry_after: { get_input: retry_after }
@@ -389,6 +424,7 @@ node_templates:
389424
disablePasswordAuthentication: true
390425
agent_config:
391426
install_method: none
427+
storage_endpoint: { get_input: endpoint_storage }
392428
interfaces:
393429
cloudify.interfaces.lifecycle:
394430
create:

scripts/manager/tasks.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ def install_rpm(_rpm):
1313
raise NonRecoverableError(str(e))
1414
return True
1515

16+
def install_requirements():
17+
try:
18+
sudo("sudo yum install -y python-backports-ssl_match_hostname "
19+
"python-setuptools python-backports")
20+
except Exception as e:
21+
raise NonRecoverableError(str(e))
22+
return True
23+
1624

1725
def update_config(private, public, _config_path):
1826

@@ -57,7 +65,7 @@ def cfy_install(password, old=False):
5765
password)
5866
if old:
5967
install_string = install_string + ' --clean-db'
60-
elif not old:
68+
elif not old:
6169
try:
6270
sudo("sudo yum install -y openssl-1.0.2k")
6371
except Exception as e:
@@ -120,8 +128,9 @@ def create(private_ip,
120128
run("echo Hello")
121129
except Exception as e:
122130
raise RecoverableError(str(e))
123-
131+
124132
if not ctx.instance.runtime_properties.get('installed_rpm'):
133+
install_requirements()
125134
ctx.instance.runtime_properties['installed_rpm'] = install_rpm(rpm)
126135

127136
if not ctx.instance.runtime_properties.get('updated_config'):

0 commit comments

Comments
 (0)