Please help resolving below errors: -
work flow 1: -
edart.execute_transaction_workflow:
description: st2 edart.execute_transaction_workflow
type: direct
input:
- transaction_name
- transaction_parameters
- TAS
- ObjectServer
- TargetName
- Serial
- AOTS
- RTI
- Attempts
- Interval
- timeLimit
- ObjectServerName
- ServerName
- Zone
- Vtier
- deployment_execution_id
- base_path
output:
stdout: <% $.status_message %>
tasks:
task_switch:
on-success:
- execute_opsportal: <% $.transaction_name = 'opsportal' %>
- execute_universal_workflow_common: <% $.transaction_name = 'UniversalWorkflow_Common' %>
execute_universal_workflow_common:
action: edart.universal_workflow_common
input:
TargetName: <% $.TargetName %>
transaction_name: <% $.transaction_name %>
transaction_parameters: <% $.transaction_parameters %>
AOTS: <% $.AOTS %>
Serial: <% $.Serial %>
timeLimit: <% $.timeLimit %>
deployment_execution_id: <% $.deployment_execution_id %>
base_path: <% $.base_path %>
publish:
stdout: <% task(execute_universal_workflow_common).result.stdout %>
stderr: <% task(execute_universal_workflow_common).result.stderr %>
status_message: "Workflow execution started execute_universal_workflow_common----------"
on-success:
- notify
on-error:
- fail # Set workflow to "FAILED" explicitly.
execute_opsportal:
action: edart.opsportal
input:
TargetName: <% $.TargetName %>
transaction_name: <% $.transaction_name %>
transaction_parameters: <% $.transaction_parameters %>
AOTS: <% $.AOTS %>
Serial: <% $.Serial %>
timeLimit: <% $.timeLimit %>
deployment_execution_id: <% $.deployment_execution_id %>
base_path: <% $.base_path %>
#base_path: "/opt/stackstorm/packs/edart/actions"
#cmd: wget -O <% $.base_path %>/data/<% $.deployment_execution_id %>_opsportal.log
http://ebizweb.att.com/opsportal/eDart/opEnrichTicket.cfm?node=<% $.TargetName %>&ticket=<% $.AOTS %>
publish:
#opsportal_stdout: <% task(execute_opsportal).result.stdout %>
#stderr: <% task(execute_opsportal).result.stderr %>
#status_message: "opsportal data saved successfull"
status_message: "Connectivity with target host is successfull."
on-success:
- notify
on-error:
- fail
notify:
action: core.local
input:
cmd: echo "<% $.status_message %>"
workflow2: -
```version: '2.0'
edart.universal_workflow_common:
description: st2 edart.universal_workflow_common
type: direct
input:
- TargetName
- transaction_name
- transaction_parameters
- AOTS
- Serial
- timeLimit
- deployment_execution_id
- base_path
output:
stdout: <% $.completion_code_stdout %>
tasks:
get_transaction_param_list:
publish:
params_list: <% $.transaction_parameters.split('<eDART&>').select(str($).trim()) %>
status_message: "Getting list of transaction_parameters"
on-success:
- task_switch
task_switch:
publish:
script_name: <% $.params_list[0] %>
target_name: <% $.params_list[1] %>
os_type: <% $.params_list[2] %>
script_parameters: <% $.params_list[3] %>
on-success:
- task_unix: <% $.os_type = 'UNIX' %>
- task_windows: <% $.os_type = 'WINDOWS' %>
task_unix:
action: core.local
input:
cmd: "ssh
m40...@hldi017.hydc.sbc.com 'uname -a'"
hosts: <% $.target_name %>
publish:
stdout: <% task(task_unix).result.get($.target_name).stdout %>
stderr: <% task(task_unix).result.get($.target_name).stderr %>
status_message: "Connectivity with target host is successfull."
script_name: <% $.script_name %>
target_name: <% $.target_name %>
script_parameters: <% $.script_parameters %>
on-success:
- get_destination_path
on-error:
- fail # Set workflow to "FAILED" explicitly.
get_destination_path:
action: core.local
input:
cmd: "ssh
m40...@hldi017.hydc.sbc.com grep m40725 /etc/passwd | cut -d':' -f6'"
hosts: <% $.target_name %>
publish:
destination_path: <% task(get_destination_path).result.get($.target_name).stdout %>
stderr: <% task(get_destination_path).result.get($.target_name).stderr %>
status_message: "Determine Destinaton directory action success"
script_name: <% $.script_name %>
target_name: <% $.target_name %>
script_parameters: <% $.script_parameters %>
on-success:
- copy_script
on-error:
- fail
copy_script:
action: core.local
input:
cmd: "scp -q <% $.base_path %>/scripts/<% $.script_name %> m40725@<% $.target_name %>:<% $.destination_path %>"
publish:
stdout: <% task(copy_script).result.stdout %>
stderr: <% task(copy_script).result.stderr %>
status_message: "Script copy to destination success"
destination_path: <% $.destination_path %>
script_name: <% $.script_name %>
target_name: <% $.target_name %>
script_parameters: <% $.script_parameters %>
on-success:
- give_file_permission
on-error:
- fail
give_file_permission:
action: core.remote
input:
cmd: "chmod 755 <% $.destination_path %>/<% $.script_name %>"
hosts: <% $.target_name %>
publish:
stdout: <% task(give_file_permission).result.get($.target_name).stdout %>
stderr: <% task(give_file_permission).result.get($.target_name).stderr %>
status_message: "script file chmod 755 success"
destination_path: <% $.destination_path %>
script_name: <% $.script_name %>
target_name: <% $.target_name %>
script_parameters: <% $.script_parameters %>
on-success:
- execute_script
on-error:
- fail
execute_script:
action: core.remote
input:
cmd: "<% $.destination_path %>/<% $.script_name %> <% $.script_parameters %>"
hosts: <% $.target_name %>
publish:
script_stdout: <% task(execute_script).result.get($.target_name).stdout %>
stderr: <% task(execute_script).result.get($.target_name).stderr %>
status_message: "script execution success"
target_name: <% $.target_name %>
on-success:
- save_script_output
on-error:
- fail
save_script_output:
action: core.local_sudo
input:
cmd: printf "<% $.script_stdout %>" > <% $.base_path %>/data/<% $.deployment_execution_id %>_UW.log
publish:
stdout: <% task(save_script_output).result.stdout %>
stderr: <% task(save_script_output).result.stderr %>
status_message: "Script output has been saved."
target_name: <% $.target_name %>
on-success:
- get_output_tag_count
on-error:
- fail
get_output_tag_count:
action: core.local
input:
cmd: grep '<EDARTOutput>' <% $.base_path %>/data/<% $.deployment_execution_id %>_UW.log | wc -l
publish:
output_tag_count: <% task(get_output_tag_count).result.stdout %>
stderr: <% task(get_output_tag_count).result.stderr %>
status_message: "grep for output tage is successfull."
target_name: <% $.target_name %>
on-success:
- task5
on-error:
- fail
task5:
action: core.local
input:
cmd: sed -e 's/<EDARTOutput>//' <% $.base_path %>/data/<% $.deployment_execution_id %>_UW.log
publish:
resultList_stdout: <% task(task5).result.stdout.split('</EDARTOutput>').select(str($).trim()) %>
stderr: <% task(task5).result.stderr %>
status_message: "sed cmd and split is successfull."
output_tag_count: <% $.output_tag_count %>
target_name: <% $.target_name %>
on-success:
- task6
on-error:
- fail
task6:
with-items:
- listItem in <% $.resultList_stdout.limit($.output_tag_count) %>
- count in <% list(range($.output_tag_count)) %>
action: core.local_sudo
input:
cmd: printf "<% $.listItem %>" > <% $.base_path %>/data/<% $.deployment_execution_id %>_notes.log;
#cmd: printf "<% $.listItem %>" > <% $.base_path %>/data/<% $.deployment_execution_id %>_notes.log; <% $.base_path %>/scripts/AOTS_Update.sh <% $.AOTS %> <% $.Serial %> <% $.deployment_execution_id %> Notes <% $.count %>
publish:
stdout: <% task(task6).result.stdout %>
stderr: <% task(task6).result.stderr %>
status_message: "Final output for AOTS saved in file."
target_name: <% $.target_name %>
on-success:
- task7
on-error:
- fail
task7:
action: core.local
input:
cmd: cat <% $.base_path %>/data/<% $.deployment_execution_id %>_UW.log | grep '<CompletionCode>' | cut -d '>' -f2 | cut -d '<' -f1
publish:
completion_code_stdout: <% task(task7).result.stdout %>
stderr: <% task(task7).result.stderr %>
status_message: "Parsing completion code is successful."
target_name: <% $.target_name %>
on-success:
- AOTS_MTTR_Update
on-error:
- fail
AOTS_MTTR_Update:
action: core.local_sudo
input:
cmd: <% $.base_path %>/scripts/AOTS_Update.sh <% $.transaction_name %> <% $.TargetName %> <% $.AOTS %> <% $.completion_code_stdout %> <% $.Serial %> MTTR <% $.deployment_execution_id %>
#cmd: <% $.base_path %>/scripts/AOTS_Update.sh <% $.AOTS %> <% $.Serial %> <% $.deployment_execution_id %> MTTR <% $.completion_code_stdout %>
publish:
stdout: <% task(AOTS_MTTR_Update).result.stdout %>
stderr: <% task(AOTS_MTTR_Update).result.stderr %>
status_message: "AOTS MTTR update success"
on-success:
- notify
on-error:
- fail
notify:
action: core.local
input:
cmd: "printf '<% $.status_message %> and completion_code_stdout:<% $.completion_code_stdout %>'"
task_windows:
action: edart.windows_cmd_execution
input:
username: "m45802"
password: "Being34701y$$"
cmd: "dir c:"
host: <% $.TargetName %>
timeout: 120
publish:
stdout: <% task(task_windows).result.get($.TargetName).stdout %>
stderr: <% task(task_windows).result.get($.TargetName).stderr %>
status_message: "Connectivity with windows target host is successfull."
on-success:
- notify
on-error:
- fail # Set workflow to "FAILED" explicitly.