Is the error because Rundeck is trying to use SSH key against localhost:
[workflow] Begin step: 1,NodeDispatch
1: Workflow step executing: CommandItem{command=[3 words]}
preparing for sequential execution on 1 nodes
Executing command on node: localhost, NodeEntryImpl{tags=[], attributes={nodename=localhost, hostname=localhost, osVersion=10.0, osFamily=windows, osArch=amd64, description=Rundeck server node, osName=Windows Server 2019}, project='null'}
[workflow] beginExecuteNodeStep(localhost): NodeDispatch: CommandItem{command=[3 words]}
using charset: null
Current OS is Windows Server 2019
Execute:Java13CommandLauncher: Executing 'cmd.exe' with arguments:
'/c'
'D:\Rahul\automation\myenv\Scripts\python.exe'
'D:\Rahul\automation\restartnginx.py'
'NA'
The ' characters around the executable and arguments are
not part of the command.
not a valid OPENSSH private key file