192106e954732b4758414bd7ce99b1e4fcc6052f
[ccsdk/cds.git] / components / model-catalog / blueprint-model / test-blueprint / remote_scripts / Definitions / remote_scripts.json
1 {
2   "tosca_definitions_version": "controller_blueprint_1_0_0",
3   "metadata": {
4     "template_author": "Brinda Santh Muthuramalingam",
5     "author-email": "brindasanth@in.ibm.com",
6     "user-groups": "ADMIN, OPERATION",
7     "template_name": "remote_scripts",
8     "template_version": "1.0.0",
9     "template_tags": "brinda, tosca"
10   },
11   "imports": [
12     {
13       "file": "Definitions/data_types.json"
14     },
15     {
16       "file": "Definitions/relationship_types.json"
17     },
18     {
19       "file": "Definitions/artifact_types.json"
20     },
21     {
22       "file": "Definitions/node_types.json"
23     },
24     {
25       "file": "Definitions/policy_types.json"
26     }
27   ],
28   "dsl_definitions": {
29     "remote-argument-properties": {
30       "data": {
31         "get_input": "input"
32       }
33     },
34     "ansible-argument-properties": {
35       "arg0": "-i",
36       "arg1": "Scripts/ansible/inventory.yaml",
37       "arg2": "--extra-vars",
38       "arg3": {
39         "get_attribute": [
40           "resolve-ansible-vars",
41           "",
42           "assignment-params",
43           "ansible-vars"
44         ]
45       }
46     }
47   },
48   "topology_template": {
49     "workflows": {
50       "execute-remote-python": {
51         "steps": {
52           "execute-script": {
53             "description": "Execute Remote Python Script",
54             "target": "execute-remote-python",
55             "activities": [
56               {
57                 "call_operation": ""
58               }
59             ]
60           }
61         },
62         "inputs": {
63           "input": {
64             "required": false,
65             "type": "string"
66           }
67         },
68         "outputs": {
69           "prepare-environment-logs": {
70             "type": "string",
71             "value": {
72               "get_attribute": [
73                 "execute-remote-python",
74                 "prepare-environment-logs"
75               ]
76             }
77           },
78           "execute-command-logs": {
79             "type": "string",
80             "value": {
81               "get_attribute": [
82                 "execute-remote-python",
83                 "execute-command-logs"
84               ]
85             }
86           }
87         }
88       },
89       "execute-remote-ansible": {
90         "steps": {
91           "execute-script": {
92             "description": "Execute Remote Ansible Script",
93             "target": "execute-remote-ansible-process",
94             "activities": [
95               {
96                 "call_operation": ""
97               }
98             ]
99           }
100         },
101         "inputs": {
102           "ip": {
103             "required": false,
104             "type": "string"
105           },
106           "username": {
107             "required": false,
108             "type": "string"
109           },
110           "password": {
111             "required": false,
112             "type": "string"
113           },
114           "execute-remote-ansible-properties": {
115             "description": "Dynamic PropertyDefinition for workflow(execute-remote-ansible).",
116             "required": true,
117             "type": "dt-execute-remote-ansible-properties"
118           }
119         },
120         "outputs": {
121           "ansible-variable-resolution": {
122             "type": "json",
123             "value": {
124               "get_attribute": [
125                 "resolve-ansible-vars",
126                 "assignment-params"
127               ]
128             }
129           },
130           "prepare-environment-logs": {
131             "type": "string",
132             "value": {
133               "get_attribute": [
134                 "execute-remote-ansible",
135                 "prepare-environment-logs"
136               ]
137             }
138           },
139           "execute-command-logs": {
140             "type": "string",
141             "value": {
142               "get_attribute": [
143                 "execute-remote-ansible",
144                 "execute-command-logs"
145               ]
146             }
147           }
148         }
149       }
150     },
151     "node_templates": {
152       "execute-remote-python": {
153         "type": "component-remote-python-executor",
154         "interfaces": {
155           "ComponentRemotePythonExecutor": {
156             "operations": {
157               "process": {
158                 "implementation": {
159                   "primary": "component-script"
160                 },
161                 "inputs": {
162                   "command": "python SamplePython.py",
163                   "packages": [
164                     {
165                       "type": "pip",
166                       "package": [
167                         "pyaml"
168                       ]
169                     }
170                   ],
171                   "argument-properties": "*remote-argument-properties"
172                 }
173               }
174             }
175           }
176         },
177         "artifacts": {
178           "component-script": {
179             "type": "artifact-script-python",
180             "file": "Scripts/python/SamplePython.py"
181           }
182         }
183       },
184       "execute-remote-ansible-process": {
185         "type": "dg-generic",
186         "properties": {
187           "content": {
188             "get_artifact": [
189               "SELF",
190               "dg-execute-remote-ansible-process"
191             ]
192           },
193           "dependency-node-templates": [
194             "resolve-ansible-vars",
195             "execute-remote-ansible"
196           ]
197         },
198         "artifacts": {
199           "dg-execute-remote-ansible-process": {
200             "type": "artifact-directed-graph",
201             "file": "Plans/CONFIG_ExecAnsiblePlaybook.xml"
202           }
203         }
204       },
205       "resolve-ansible-vars": {
206         "type": "component-resource-resolution",
207         "interfaces": {
208           "ResourceResolutionComponent": {
209             "operations": {
210               "process": {
211                 "inputs": {
212                   "artifact-prefix-names": [
213                     "ansible-vars"
214                   ]
215                 }
216               }
217             }
218           }
219         },
220         "artifacts": {
221           "ansible-vars-template": {
222             "type": "artifact-template-velocity",
223             "file": "Templates/ansible-vars-template.vtl"
224           },
225           "ansible-vars-mapping": {
226             "type": "artifact-mapping-resource",
227             "file": "Templates/ansible-vars-mapping.json"
228           }
229         }
230       },
231       "execute-remote-ansible": {
232         "type": "component-remote-python-executor",
233         "interfaces": {
234           "ComponentRemotePythonExecutor": {
235             "operations": {
236               "process": {
237                 "implementation": {
238                   "primary": "component-script"
239                 },
240                 "inputs": {
241                   "command": "ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook first.yaml",
242                   "argument-properties": "*ansible-argument-properties",
243                   "packages": [
244                     {
245                       "type": "pip",
246                       "package": [
247                         "requirements.txt"
248                       ]
249                     },
250                     {
251                       "type": "ansible_galaxy",
252                       "package": [
253                         "juniper.junos"
254                       ]
255                     }
256                   ]
257                 }
258               }
259             }
260           }
261         },
262         "artifacts": {
263           "component-script": {
264             "type": "artifact-script-ansible",
265             "file": "Scripts/ansible/first.yaml"
266           }
267         }
268       }
269     }
270   }
271 }