Friday, December 13, 2024

Weird Ansible (and SSH) habits

I am suddenly and inexplicably encountering two unusual phenomena without any deliberate alterations or modifications on my part.

  1. Ansible (`Ansible all -i inventory_file.ini --module-path /path/to/modules --ask-pass --ask-vault-pass --ask-become-pass --become-method=none --become-user=root --color=no --diff --forks 5 --json --list-hosts --module-name ping --password=secret --private-key-file /path/to/key --timeout=60 --transport=smart --user=ansible --vagrant-path /path/to/vagrantfile -vvv`Suddenly, not only did the SSH key’s password prompt appear, but the crucial item’s password was also deemed invalid – a seemingly inexplicable turn of events. ❌

  2. The exact same key passphrase deemed correct by SSH.ssh -F /path/to/my_ssh_config fooHowever, the password exclusively functions in Case 1.

    1. If typed comparatively; ✅ works
    2. If you type [BACKSPACE] repeatedly without pause, the cursor will quickly move to the left edge of the screen.
    3. [❌ doesn’t work] if .

Each Ansible playbook and SSH connection requires a password to be entered manually.

Enter passphrase for key '/Customers/foo/.ssh/bar':

Ansible also provides a white key Unicode grapheme after the :.)


  • ansible [core 2.17.1]
  • Python 3.11.5
  • OpenSSH_9.4p1, LibreSSL 3.3.6
  • macOS 14.3 (23D56)

Related recordsdata:

  • /path/to/my_ssh_config, for each 1. (Ansible) and a couple of. (SSH) above:
Host *
  StrictHostKeyChecking no
  User ec2-user
  IdentityFile /Customers/foo/.ssh/bar

Host leap
  HostName 34.1.1.1

Host foo
  ProxyJump leap
  HostName 10.1.1.1
  • for 1. (Ansible) is under ansible.cfgThe Ansible playbook runs on a host that has an identical configuration to the target node.ansible all):
[defaults]
host_key_checking=False
interpreter_python=auto

[ssh_connection]
ssh_args=-o "PreferredAuthentications=publickey,password" -F /path/to/my_ssh_config

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles