From e52832394eaf06e3146a106a339f265f27cc3fa9 Mon Sep 17 00:00:00 2001 From: Denis Pauk Date: Tue, 17 Apr 2018 12:58:24 +0300 Subject: [PATCH 1/4] Azure Stack Support --- azure.yaml | 37 ++++++++++++++++++++++++++++++++++++- scripts/manager/tasks.py | 13 +++++++++++-- 2 files changed, 47 insertions(+), 3 deletions(-) diff --git a/azure.yaml b/azure.yaml index 14b2108..5d3c3cc 100644 --- a/azure.yaml +++ b/azure.yaml @@ -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 + - https://raw.githubusercontent.com/cloudify-incubator/cloudify-azure-plugin/private_cloud/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 @@ -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 @@ -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. @@ -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: @@ -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 } @@ -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 } @@ -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 } @@ -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 } @@ -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 } @@ -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 } @@ -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 } @@ -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 } @@ -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 } diff --git a/scripts/manager/tasks.py b/scripts/manager/tasks.py index df9e0f4..2532930 100644 --- a/scripts/manager/tasks.py +++ b/scripts/manager/tasks.py @@ -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): @@ -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: @@ -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'): From b6985df989aaa4e30891134524948047b19a56a6 Mon Sep 17 00:00:00 2001 From: Denis Pauk Date: Wed, 18 Apr 2018 15:40:38 +0300 Subject: [PATCH 2/4] Use updated plugin --- azure.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure.yaml b/azure.yaml index 5d3c3cc..28143fd 100644 --- a/azure.yaml +++ b/azure.yaml @@ -2,7 +2,7 @@ tosca_definitions_version: cloudify_dsl_1_3 imports: - http://www.getcloudify.org/spec/cloudify/4.3/types.yaml - - https://raw.githubusercontent.com/cloudify-incubator/cloudify-azure-plugin/private_cloud/plugin.yaml + - https://raw.githubusercontent.com/cloudify-incubator/cloudify-azure-plugin/1.6.0/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 From ed43637f69a81beb587ddb0438777a2a85e4f800 Mon Sep 17 00:00:00 2001 From: EarthmanT Date: Sun, 22 Apr 2018 15:24:06 +0300 Subject: [PATCH 3/4] Update azure.yaml --- azure.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure.yaml b/azure.yaml index 28143fd..64af61c 100644 --- a/azure.yaml +++ b/azure.yaml @@ -2,7 +2,7 @@ tosca_definitions_version: cloudify_dsl_1_3 imports: - http://www.getcloudify.org/spec/cloudify/4.3/types.yaml - - https://raw.githubusercontent.com/cloudify-incubator/cloudify-azure-plugin/1.6.0/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 From a7510cc131ab868848f2a789f6304025920959cb Mon Sep 17 00:00:00 2001 From: earthmant Date: Sun, 22 Apr 2018 15:43:39 +0300 Subject: [PATCH 4/4] support 1.6.1 --- azure.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure.yaml b/azure.yaml index 64af61c..777ae5c 100644 --- a/azure.yaml +++ b/azure.yaml @@ -424,6 +424,7 @@ node_templates: disablePasswordAuthentication: true agent_config: install_method: none + storage_endpoint: { get_input: endpoint_storage } interfaces: cloudify.interfaces.lifecycle: create: