-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Variables inventory_hostname, remote_user don't contain the correct value #641
Comments
@urohit011 I have set/provide these variables for the connection in the action plugin itself. For instance, refer to this example: F5Networks/f5-ansible#2413 I tested setting remote_address, and it resolved correctly on my end. Could you please confirm if this solution works for you as well? |
Hi @rohitthakur2590, I'll check and confirm once #653 is merged. Thanks |
@urohit011 Thanks, meanwhile could you please give detailed debug logs as well? also could you please tell us the specific versions of Netcommon and ansible core for which it was working fine before? |
@urohit011 |
Hi @rohitthakur2590, apologies for late reply, changes in PR #2413 do not help unless the changes made in PR #653 re merged I had checked it when I had opened this issue. |
Here's tha ansible logs
|
SUMMARY
When using the netcommon collection for connection purpose, sometimes values of variables such as, inventory_hostname, remote_user and password are somehow not being used correctly which results in the error:
[Errno -3] Temporary failure in name resolution
And I found the following entry in the ansible.log file
<inventory_hostname> ESTABLISH PARAMIKO SSH CONNECTION FOR USER: None on PORT 22 TO inventory_hostname
I think this could be happening after this PR ansible/ansible#79704, was merged in ansible fix a very similar issue. In short the PR has changes in paramiko_ssh.py where references like
connection._play_context("remote_addr")
were changed toconnection.get_option("remote_addr")
, which is not retrieving the correct value. I think that is happening because in this following snippet, thevariables
variable on on line 75, only containsansible_command_timeout
:ansible.netcommon/plugins/connection/persistent.py
Lines 64 to 82 in d28c8fc
When the I changed
variables
to the following, I didn't get the error and it worked fine for me.ISSUE TYPE
COMPONENT NAME
ansible.netcommon
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
ubuntu
STEPS TO REPRODUCE
Run the below playbook with ansible version 2.15.12 or later, you do not need a bigip box, you can provide a random IP, username and password
You'll get the error,
[Errno -3] Temporary failure in name resolution
and the below entry in ansible.log file
<inventory_hostname> ESTABLISH PARAMIKO SSH CONNECTION FOR USER: None on PORT 22 TO inventory_hostname
EXPECTED RESULTS
It should not fail with the error,
[Errno -3] Temporary failure in name resolution
ACTUAL RESULTS
It's failing with the error
The text was updated successfully, but these errors were encountered: