`ansible-navigator run site.yml` fails with `Permission denied (publickey)`, while `ansible-playbook site.yml` works
AdvancedTroubleshootingCloud, AWX, Windows and Molecule
Answer
Likely causes → Navigator runs the playbook inside an EE container. Your ~/.ssh keys are not visible there, and the SSH agent socket is only passed through if SSH_AUTH_SOCK is set and the agent holds the key. Custom key paths in inventory point at host paths that do not exist in the container.
Diagnose →
ssh-add -l
ansible-navigator run site.yml -m stdout -vvv 2>&1 | grep -i identity
Fix → Start the agent and add the key (eval "$(ssh-agent)"; ssh-add ~/.ssh/id_ed25519), or mount the key through the navigator settings:
ansible-navigator:
execution-environment:
volume-mounts:
- src: ~/.ssh
dest: /home/runner/.ssh
options: ro
Use --ee false to confirm the problem is container-specific.
Prevent → Commit a project ansible-navigator.yml so every developer gets the same mounts and EE image.
More on Cloud, AWX, Windows and Molecule
`Failed to import the required Python library (botocore and boto3) on web01's Python /usr/bin/python3.`Beginner`[WARNING]: * Failed to parse inventory/aws.yml with auto plugin: inventory source 'inventory/aws.yml' could not be verified by inventory plugin 'amazon.aws.aws_ec2'`IntermediateThe `aws_ec2` inventory parses without errors but returns zero hostsIntermediate`Failed to describe instances: An error occurred (UnauthorizedOperation) when calling the DescribeInstances operation` or `(ExpiredToken)`IntermediateDynamic inventory finds the instances, but every host is `UNREACHABLE`IntermediateUsing the SSM connection plugin fails with `SessionManagerPlugin is not found` or hangs on file transferAdvanced