From a3d9ac859fa47f2aa2849160e08c7a3c1048589e Mon Sep 17 00:00:00 2001 From: Serge Simard Date: Fri, 17 May 2019 06:39:58 -0400 Subject: Remote AWX ansible playbook executor Issue-ID: CCSDK-1357 Change-Id: I794ce5450b341606829a1a37d9efed48abab32cc Signed-off-by: Serge Simard --- .../remote_ansible/Definitions/artifact_types.json | 34 ++++++ .../remote_ansible/Definitions/data_types.json | 3 + .../remote_ansible/Definitions/node_types.json | 86 ++++++++++++++ .../remote_ansible/Definitions/policy_types.json | 3 + .../Definitions/relationship_types.json | 3 + .../remote_ansible/Definitions/remote_ansible.json | 124 +++++++++++++++++++++ .../Definitions/resources_definition_types.json | 3 + .../remote_ansible/TOSCA-Metadata/TOSCA.meta | 5 + 8 files changed, 261 insertions(+) create mode 100644 components/model-catalog/blueprint-model/test-blueprint/remote_ansible/Definitions/artifact_types.json create mode 100644 components/model-catalog/blueprint-model/test-blueprint/remote_ansible/Definitions/data_types.json create mode 100644 components/model-catalog/blueprint-model/test-blueprint/remote_ansible/Definitions/node_types.json create mode 100644 components/model-catalog/blueprint-model/test-blueprint/remote_ansible/Definitions/policy_types.json create mode 100644 components/model-catalog/blueprint-model/test-blueprint/remote_ansible/Definitions/relationship_types.json create mode 100644 components/model-catalog/blueprint-model/test-blueprint/remote_ansible/Definitions/remote_ansible.json create mode 100644 components/model-catalog/blueprint-model/test-blueprint/remote_ansible/Definitions/resources_definition_types.json create mode 100644 components/model-catalog/blueprint-model/test-blueprint/remote_ansible/TOSCA-Metadata/TOSCA.meta (limited to 'components/model-catalog/blueprint-model') diff --git a/components/model-catalog/blueprint-model/test-blueprint/remote_ansible/Definitions/artifact_types.json b/components/model-catalog/blueprint-model/test-blueprint/remote_ansible/Definitions/artifact_types.json new file mode 100644 index 000000000..6e5cfc3a1 --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/remote_ansible/Definitions/artifact_types.json @@ -0,0 +1,34 @@ +{ + "artifact_types" : { + "artifact-directed-graph" : { + "description" : "Directed Graph File", + "version" : "1.0.0", + "derived_from" : "tosca.artifacts.Implementation", + "file_ext" : [ "json", "xml" ] + }, + "artifact-mapping-resource" : { + "description" : "Resource Mapping File used along with Configuration template", + "version" : "1.0.0", + "derived_from" : "tosca.artifacts.Implementation", + "file_ext" : [ "json" ] + }, + "artifact-script-ansible" : { + "description" : "Ansible Script file", + "version" : "1.0.0", + "derived_from" : "tosca.artifacts.Implementation", + "file_ext" : [ "yaml" ] + }, + "artifact-script-python" : { + "description" : "Python Script file", + "version" : "1.0.0", + "derived_from" : "tosca.artifacts.Implementation", + "file_ext" : [ "py" ] + }, + "artifact-template-velocity" : { + "description" : " Velocity Template used for Configuration", + "version" : "1.0.0", + "derived_from" : "tosca.artifacts.Implementation", + "file_ext" : [ "vtl" ] + } + } +} \ No newline at end of file diff --git a/components/model-catalog/blueprint-model/test-blueprint/remote_ansible/Definitions/data_types.json b/components/model-catalog/blueprint-model/test-blueprint/remote_ansible/Definitions/data_types.json new file mode 100644 index 000000000..8c304c40b --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/remote_ansible/Definitions/data_types.json @@ -0,0 +1,3 @@ +{ + "data_types" : { } +} \ No newline at end of file diff --git a/components/model-catalog/blueprint-model/test-blueprint/remote_ansible/Definitions/node_types.json b/components/model-catalog/blueprint-model/test-blueprint/remote_ansible/Definitions/node_types.json new file mode 100644 index 000000000..5f0deeb98 --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/remote_ansible/Definitions/node_types.json @@ -0,0 +1,86 @@ +{ + "node_types" : { + "component-remote-ansible-executor" : { + "description" : "Remote Ansible (AWX) Execution Component.", + "version" : "1.0.0", + "attributes" : { + "ansible-command-status" : { + "required" : false, + "type" : "string" + }, + "ansible-command-logs" : { + "required" : false, + "type" : "string" + } + }, + "capabilities" : { + "component-node" : { + "type" : "tosca.capabilities.Node" + } + }, + "interfaces" : { + "ComponentRemoteAnsibleExecutor" : { + "operations" : { + "process" : { + "inputs" : { + "job-template-name" : { + "description" : "Job template to execute in AWX", + "required" : true, + "type" : "string" + }, + "limit" : { + "description" : "Limit to this comma-separated list of hosts.", + "required" : false, + "type" : "string" + }, + "inventory" : { + "description" : "Use this hosts inventory ID for this run.", + "required" : false, + "type" : "string" + }, + "tags" : { + "description" : "Limit this run to comma-separated list of tags.", + "required" : false, + "type" : "string" + }, + "skip-tags" : { + "description" : "Skip this comma-separated list of tags for this run.", + "required" : false, + "type" : "string" + }, + "extra-vars" : { + "description" : "Specify extra args for this run.", + "required" : false, + "type" : "json" + }, + "endpoint-selector" : { + "description" : "Remote AWX Server selector name.", + "required" : false, + "type" : "string", + "default" : "awx-remote-server" + } + } + } + } + } + }, + "derived_from" : "tosca.nodes.Component" + }, + + "tosca.nodes.Component" : { + "description" : "This is default Component Node", + "version" : "1.0.0", + "derived_from" : "tosca.nodes.Root" + }, + "tosca.nodes.ResourceSource" : { + "description" : "TOSCA base type for Resource Sources", + "version" : "1.0.0", + "derived_from" : "tosca.nodes.Root" + }, + "tosca.nodes.Workflow" : { + "description" : "This is Directed Graph Node Type", + "version" : "1.0.0", + "derived_from" : "tosca.nodes.Root" + } + } +} \ No newline at end of file diff --git a/components/model-catalog/blueprint-model/test-blueprint/remote_ansible/Definitions/policy_types.json b/components/model-catalog/blueprint-model/test-blueprint/remote_ansible/Definitions/policy_types.json new file mode 100644 index 000000000..1e44cc70a --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/remote_ansible/Definitions/policy_types.json @@ -0,0 +1,3 @@ +{ + "policy_types" : { } +} \ No newline at end of file diff --git a/components/model-catalog/blueprint-model/test-blueprint/remote_ansible/Definitions/relationship_types.json b/components/model-catalog/blueprint-model/test-blueprint/remote_ansible/Definitions/relationship_types.json new file mode 100644 index 000000000..4ddd7a57c --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/remote_ansible/Definitions/relationship_types.json @@ -0,0 +1,3 @@ +{ + "relationship_types" : { } +} \ No newline at end of file diff --git a/components/model-catalog/blueprint-model/test-blueprint/remote_ansible/Definitions/remote_ansible.json b/components/model-catalog/blueprint-model/test-blueprint/remote_ansible/Definitions/remote_ansible.json new file mode 100644 index 000000000..53ca04a5d --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/remote_ansible/Definitions/remote_ansible.json @@ -0,0 +1,124 @@ +{ + "tosca_definitions_version": "controller_blueprint_1_0_0", + "metadata": { + "template_author": "Serge Simard", + "author-email": "serge@agilitae.com", + "user-groups": "ADMIN, OPERATION", + "template_name": "remote_ansible", + "template_version": "1.0.0", + "template_tags": "tosca" + }, + "imports": [ + { + "file": "Definitions/data_types.json" + }, + { + "file": "Definitions/relationship_types.json" + }, + { + "file": "Definitions/artifact_types.json" + }, + { + "file": "Definitions/node_types.json" + }, + { + "file": "Definitions/policy_types.json" + } + ], + "dsl_definitions": { + "ansible-remote-endpoint": { + "type": "token-auth", + "url": "http://142.44.184.236", + "token": "Bearer J9gEtMDqf7P4YsJ74fioY9VAhLDIs1" + } + }, + "topology_template": { + "workflows": { + "execute-remote-ansible": { + "steps": { + "process": { + "description": "Execute Remote Ansible Script", + "target": "execute-remote-ansible", + "activities": [ + { + "call_operation": "" + } + ] + } + }, + "inputs": { + "endpoint-selector": { + "required": true, + "type": "string" + }, + "job-template-name": { + "required": true, + "type": "string" + }, + "limit": { + "required": false, + "type": "string" + }, + "inventory": { + "required": false, + "type": "string" + }, + "tags": { + "required": false, + "type": "string" + }, + "skip-tags": { + "required": false, + "type": "string" + }, + "extra-vars" : { + "required" : false, + "type" : "json" + } + }, + "outputs": { + "ansible-command-status": { + "type": "string", + "value": { + "get_attribute": [ + "execute-remote-ansible", + "ansible-command-status" + ] + } + }, + "ansible-command-logs": { + "type": "string", + "value": { + "get_attribute": [ + "execute-remote-ansible", + "ansible-command-logs" + ] + } + } + } + } + }, + "node_templates": { + "execute-remote-ansible": { + "type": "component-remote-ansible-executor", + "interfaces": { + "ComponentRemoteAnsibleExecutor": { + "operations": { + "process": { + "inputs": { + "endpoint-selector": { "get_input": "endpoint-selector" }, + "job-template-name": { "get_input": "job-template-name" }, + "limit": { "get_input": "limit" }, + "inventory": { "get_input": "inventory" }, + "extra-vars": { "get_input": "extra-vars" }, + "tags": { "get_input": "tags" }, + "skip-tags": { "get_input": "skip-tags" } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/components/model-catalog/blueprint-model/test-blueprint/remote_ansible/Definitions/resources_definition_types.json b/components/model-catalog/blueprint-model/test-blueprint/remote_ansible/Definitions/resources_definition_types.json new file mode 100644 index 000000000..0e0dcd235 --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/remote_ansible/Definitions/resources_definition_types.json @@ -0,0 +1,3 @@ +{ + +} \ No newline at end of file diff --git a/components/model-catalog/blueprint-model/test-blueprint/remote_ansible/TOSCA-Metadata/TOSCA.meta b/components/model-catalog/blueprint-model/test-blueprint/remote_ansible/TOSCA-Metadata/TOSCA.meta new file mode 100644 index 000000000..17448a835 --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/remote_ansible/TOSCA-Metadata/TOSCA.meta @@ -0,0 +1,5 @@ +TOSCA-Meta-File-Version: 1.0.0 +CSAR-Version: 1.0 +Created-By: Serge Simard +Entry-Definitions: Definitions/remote_ansible.json +Template-Tags: Serge Simard, remote_ansible \ No newline at end of file -- cgit 1.2.3-korg