FS#70659 - Ansile not respecting OpenSSH client configuration file

Attached to Project: Community Packages
Opened by Júlio Dutra (dutrajulio) - Friday, 30 April 2021, 13:23 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Saturday, 15 May 2021, 17:28 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sven-Hendrik Haase (Svenstaro)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description: After the change from "ansible-base" to "ansible-core" theirs binaries don't respect the configurations in "~/.ssh/config".


Additional info:
* ansible-core-2.11.0-2

Steps to reproduce:
Creates an example entry in "~/.ssh/config"

Host 192.168.0.1
Port 2222

Run the following ad-hoc command
$ ansible all -i 192.168.0.1, -m setup
192.168.0.1 | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: ssh: connect to host 192.168.0.14 port 22: Connection refused",
"unreachable": true
}

The output shows "port 22" and not "port 2222".

As workaround i downgraded to the ansible-base package as well the packages that depends on it.
This task depends upon

Closed by  Sven-Hendrik Haase (Svenstaro)
Saturday, 15 May 2021, 17:28 GMT
Reason for closing:  Fixed
Comment by Amin Vakil (aminvakil) - Friday, 30 April 2021, 17:54 GMT
It does respect, by any chance have you changed something in /etc/ansible/ansible.cfg and you forgot to check .pacnew?
Comment by Júlio Dutra (dutrajulio) - Friday, 30 April 2021, 18:27 GMT
First of all, thanks to check this.

I checked my system and there is no pacnew files or any kind of special configuration for Ansible.

I ran in verbose mode and attached the output files.

But, if your system is working as intent, then i have no glue what is happening on my.

I will keep searching here.
Comment by Sven-Hendrik Haase (Svenstaro) - Friday, 30 April 2021, 20:09 GMT
I don't think it's a packaging problem. As you can see here (https://github.com/archlinux/svntogit-community/blob/packages/ansible-core/trunk/PKGBUILD), it's a fairly straight forward package straight from upstream.
Comment by Júlio Dutra (dutrajulio) - Friday, 30 April 2021, 20:24 GMT
Indeed.

I tested too in a docker environment and could reproduce the problem.

I looked in the upstream bug system and find anything yet. I will report there too.

Thanks.
Comment by Sven-Hendrik Haase (Svenstaro) - Friday, 30 April 2021, 20:45 GMT
We will track this here for a bit but please post the upstream bug report here soon-ish.
Comment by Amin Vakil (aminvakil) - Friday, 30 April 2021, 20:48 GMT
Well, one of my playbooks has got this problem too, the other which I've tested few hours ago didn't.

I will also report here:
https://github.com/ansible/ansible/issues/74524

Edit: https://github.com/ansible/ansible/issues/74524#issuecomment-830383951
Comment by Amin Vakil (aminvakil) - Friday, 30 April 2021, 22:10 GMT
This can be fixed by removing `default: 22` in `port` section from `/usr/lib/python3.9/site-packages/ansible/plugins/connection/ssh.py`, not sure if it's Arch way to create a patch doing this in packaging.

More info: https://github.com/ansible/ansible/issues/74524#issuecomment-830420414
Comment by Sven-Hendrik Haase (Svenstaro) - Sunday, 02 May 2021, 23:43 GMT
Upstream is usually fast to release patches if they deem it necessary so I'll defer this one to upstream's decision.
Comment by Chih-Hsuan Yen (yan12125) - Friday, 07 May 2021, 11:18 GMT
A upstream fix is merged to the devel branch [1] and there is a backport to 2.11 branch [2]. Could you consider adding that backport to Arch's ansible package?

[1] https://github.com/ansible/ansible/commit/30912b6a47813940592bfcf7cb7d1d6e8d608da4
[2] https://github.com/ansible/ansible/pull/74562
Comment by Sven-Hendrik Haase (Svenstaro) - Saturday, 15 May 2021, 15:23 GMT
I pushed a package containing the backported fix as rel -3. Can you check whether this fixes the issue for you?
Comment by Chih-Hsuan Yen (yan12125) - Saturday, 15 May 2021, 16:51 GMT
-3 works as usual. Thanks for the fix!

Loading...