diff --git a/src/main/groovy/com/rundeck/plugins/ansible/ansible/AnsibleRunner.java b/src/main/groovy/com/rundeck/plugins/ansible/ansible/AnsibleRunner.java index d7fc2515..985ed184 100644 --- a/src/main/groovy/com/rundeck/plugins/ansible/ansible/AnsibleRunner.java +++ b/src/main/groovy/com/rundeck/plugins/ansible/ansible/AnsibleRunner.java @@ -449,7 +449,7 @@ public int run() throws Exception { perms.add(PosixFilePermission.OWNER_WRITE); Files.setPosixFilePermissions(tempPkFile.toPath(), perms); - Files.write(tempPkFile.toPath(), sshPrivateKey.getBytes()); + Files.write(tempPkFile.toPath(), sshPrivateKey.replaceAll("\r\n","\n").getBytes()); procArgs.add("--private-key" + "=" + tempPkFile.toPath()); if(sshUseAgent){