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

Commit

Permalink
Merge pull request #20 from cloudify-examples/azure-stack
Browse files Browse the repository at this point in the history
Azure stack
  • Loading branch information
EarthmanT authored Apr 22, 2018
2 parents 5309598 + a7510cc commit 5e3be1e
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 3 deletions.
38 changes: 37 additions & 1 deletion azure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ tosca_definitions_version: cloudify_dsl_1_3

imports:
- http://www.getcloudify.org/spec/cloudify/4.3/types.yaml
- http://www.getcloudify.org/spec/azure-plugin/1.5.1.1/plugin.yaml
- http://www.getcloudify.org/spec/azure-plugin/1.6.1/plugin.yaml
- http://www.getcloudify.org/spec/utilities-plugin/1.5.2/plugin.yaml
- http://www.getcloudify.org/spec/fabric-plugin/1.5.1/plugin.yaml
- imports/manager-configuration.yaml
Expand All @@ -21,6 +21,23 @@ inputs:
client_secret:
type: string

endpoint_resource:
default: https://management.core.windows.net/

endpoints_resource_manager:
default: https://management.azure.com

endpoint_verify:
default: True

endpoint_storage:
type: string
default: core.windows.net

endpoints_active_directory:
type: string
default: https://login.microsoftonline.com

location:
default: eastus

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

network_api_version:
description: >
API Version for Network
default: "2015-06-15"

secrets:
description: >
key, value pairs of secrets used in AWS blueprint examples.
Expand Down Expand Up @@ -150,6 +172,10 @@ dsl_definitions:
tenant_id: { get_input: tenant_id }
client_id: { get_input: client_id }
client_secret: { get_input: client_secret }
endpoint_resource: { get_input: endpoint_resource }
endpoints_resource_manager: { get_input: endpoints_resource_manager }
endpoint_verify: { get_input: endpoint_verify }
endpoints_active_directory: { get_input: endpoints_active_directory }

node_templates:

Expand Down Expand Up @@ -218,6 +244,7 @@ node_templates:
type: cloudify.azure.nodes.network.PublicIPAddress
properties:
azure_config: *client_config
api_version: { get_input: network_api_version }
name: { concat: [ { get_input: resource_prefix }, 's0ip', { get_input: resource_suffix } ] }
location: { get_input: location }
retry_after: { get_input: retry_after }
Expand All @@ -231,6 +258,7 @@ node_templates:
type: cloudify.azure.nodes.network.VirtualNetwork
properties:
azure_config: *client_config
api_version: { get_input: network_api_version }
name: { concat: [ { get_input: resource_prefix }, 'vn', { get_input: resource_suffix } ] }
location: { get_input: location }
retry_after: { get_input: retry_after }
Expand All @@ -242,6 +270,7 @@ node_templates:
type: cloudify.azure.nodes.network.NetworkSecurityGroup
properties:
azure_config: *client_config
api_version: { get_input: network_api_version }
name: { concat: [ { get_input: resource_prefix }, 'sg', { get_input: resource_suffix } ] }
location: { get_input: location }
retry_after: { get_input: retry_after }
Expand All @@ -266,6 +295,7 @@ node_templates:
type: cloudify.azure.nodes.network.Subnet
properties:
azure_config: *client_config
api_version: { get_input: network_api_version }
name: { concat: [ { get_input: resource_prefix }, 's0', { get_input: resource_suffix } ] }
location: { get_input: location }
retry_after: { get_input: retry_after }
Expand All @@ -279,6 +309,7 @@ node_templates:
type: cloudify.azure.nodes.network.Subnet
properties:
azure_config: *client_config
api_version: { get_input: network_api_version }
name: { concat: [ { get_input: resource_prefix }, 's1', { get_input: resource_suffix } ] }
location: { get_input: location }
retry_after: { get_input: retry_after }
Expand All @@ -294,6 +325,7 @@ node_templates:
type: cloudify.azure.nodes.network.IPConfiguration
properties:
azure_config: *client_config
api_version: { get_input: network_api_version }
name: { concat: [ { get_input: resource_prefix }, 's0ipc', { get_input: resource_suffix } ] }
location: { get_input: location }
retry_after: { get_input: retry_after }
Expand All @@ -311,6 +343,7 @@ node_templates:
type: cloudify.azure.nodes.network.IPConfiguration
properties:
azure_config: *client_config
api_version: { get_input: network_api_version }
name: { concat: [ { get_input: resource_prefix }, 's1ipc', { get_input: resource_suffix } ] }
location: { get_input: location }
retry_after: { get_input: retry_after }
Expand All @@ -326,6 +359,7 @@ node_templates:
type: cloudify.azure.nodes.network.NetworkInterfaceCard
properties:
azure_config: *client_config
api_version: { get_input: network_api_version }
name: { concat: [ { get_input: resource_prefix }, 's0nic', { get_input: resource_suffix } ] }
location: { get_input: location }
retry_after: { get_input: retry_after }
Expand All @@ -342,6 +376,7 @@ node_templates:
type: cloudify.azure.nodes.network.NetworkInterfaceCard
properties:
azure_config: *client_config
api_version: { get_input: network_api_version }
name: { concat: [ { get_input: resource_prefix }, 's1nic', { get_input: resource_suffix } ] }
location: { get_input: location }
retry_after: { get_input: retry_after }
Expand Down Expand Up @@ -389,6 +424,7 @@ node_templates:
disablePasswordAuthentication: true
agent_config:
install_method: none
storage_endpoint: { get_input: endpoint_storage }
interfaces:
cloudify.interfaces.lifecycle:
create:
Expand Down
13 changes: 11 additions & 2 deletions scripts/manager/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ def install_rpm(_rpm):
raise NonRecoverableError(str(e))
return True

def install_requirements():
try:
sudo("sudo yum install -y python-backports-ssl_match_hostname "
"python-setuptools python-backports")
except Exception as e:
raise NonRecoverableError(str(e))
return True


def update_config(private, public, _config_path):

Expand Down Expand Up @@ -57,7 +65,7 @@ def cfy_install(password, old=False):
password)
if old:
install_string = install_string + ' --clean-db'
elif not old:
elif not old:
try:
sudo("sudo yum install -y openssl-1.0.2k")
except Exception as e:
Expand Down Expand Up @@ -120,8 +128,9 @@ def create(private_ip,
run("echo Hello")
except Exception as e:
raise RecoverableError(str(e))

if not ctx.instance.runtime_properties.get('installed_rpm'):
install_requirements()
ctx.instance.runtime_properties['installed_rpm'] = install_rpm(rpm)

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

0 comments on commit 5e3be1e

Please sign in to comment.