Why Do I Get the User as "None" in the Debug Message "ESTABLISH SSH CONNECTION FOR USER: None" When Running a Playbook with the Ansible Engine ansible-playbook Command?

Solution In Progress - Updated -

Environment

  • Ansible Engine 2.9

Issue

  • Why do I get the user as None in the debug message ESTABLISH SSH CONNECTION FOR USER: None when running a playbook with the Ansible Engine ansible-playbook command?

Resolution

  • You need to specify a remote user in the command line as ansible-playbook -vvvv -u user46 …. The option is similar to --user.

  • You can also use other options to specify the user.

    • define a shell variable in the command line or in the shell like ANSIBLE_REMOTE_USER=user46 ansible-playbook -vvvv …
    • define ansible_user variable in your inventory

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments