Skip to content

ssh passphrase not working in rundeck ansible resource module #384

@kedar9696

Description

@kedar9696

ssh passphrase not working in rundeck ansible resource module it is working in Node Executor using SSH

  • i have created a project using ansible resource model . i have added ssh-key and passphrase for that key in key-storage, when i tried to scan nodes by passing ansible inventory iam getting below error
    Getting Below error
PLAY [all] *********************************************************************

TASK [Gathering Facts] *********************************************************
fatal: [qa-live.corp]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: dev.ops@qa-live.corp: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).", "unreachable": true}

It is working from cli

rundeck@5c4c23700c44:~/projects/gra-ops/inventories/local$ ansible all-m ping -i qa.yaml -u dev.ops --private-key=devops.pem 
Enter passphrase for key '/home/rundeck/projects/gra-ops/inventories/local/devops.pem': 
qa-live.corp | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": false,
    "ping": "pong"
} 

Rundeck version : 5.3.0
Ansible Version : 2.16.8

My Observations :

It seems that the issue may be related to the handling of the SSH key passphrase. Here are the key observations:

  1. Passphrase Prompt in CLI: When running the Ansible command from the CLI, it prompts for the SSH key passphrase. Once the passphrase is entered and stored in the session, the node becomes visible in the Rundeck UI.
  2. Node Disappears After Some Time: After some time, the node disappears from the Rundeck UI.
  3. Passphrase Required Again: When checking again via the CLI, it prompts for the passphrase once more, indicating that the passphrase needs to be re-entered to establish the connection.

Summary
The root cause seems to be the handling and persistence of the SSH key passphrase. When the passphrase is entered and stored in the CLI session, the node becomes accessible. However, once the session expires or is reset, the passphrase needs to be re-entered for the node to be accessible again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions