-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
SSH bug?? Connection refused Failed to connect to new control master . #309
Comments
Please, can you format your code with Markdown (https://guides.github.com/features/mastering-markdown/)? It hard to read. |
I'm seeing this problem as well. Is anyone else having this problem? |
i get the same error! ansible version is ansible 2.2.1.0 how resolve it? openssh-client was installed |
I was able to resolve this problem by upgrading all packages, specifically the kernel, and rebooting. Hope that helps. |
For those still affected, can you paste your ansible.cfg settings for the following sections:
|
@Echobob Just as an FYI, I don't have anything set in those sections. |
Just ran into this today, basically it seems if you run ansible inside a docker container you're going to have a bad time. I was using packer 1.3.1 and ansible 2.7.0 on Ubuntu 18.04 container on a mac osx host and it didn't work. My working ansible config now has:
Could not have been more difficult to debug. |
@slikk66 Thank you so much :) . Saves me from tons more debugging time! Would give 100 thumbs up if I could. :P |
clearing ssh_args value did the trick for me. |
@slikk66 Thank you so much :) |
Thanks, this worked for me, I'm running Ansible Playbook from WSL with Ubuntu 18.04, and this error was giving me problems. |
@alfchee I've also just encountered this issue. An alternative way you can fix this whilst running in a container is by editing config/base.yml in your Ansible installation path and changing the default path for the control path dir, i.e.
Change to
Standard disclaimers apply, some might prefer the config driven approach and YMMV. For me, I'm using Ansible in a container for experimentation/dev/learning purposes only, so, I prefer the change once, and have it the standard without ansible.cfg overrides. |
Thanks a lot. Same problem with ansible 2.9 docker image on an ubunut 16.04 host. And it fixed. |
I faced the above issue in jenkins docker container. So i did this as mentioned by @alfchee and its solved. |
Whilst this will fix it, it will involve manipulating the Ansible configuration file related to your setup each time (if you’re using specific Ansible configuration files for different playbooks/areas). In my course, Dive Into Ansible, I provide container based images for Ansible and the approach I take instead is to update Ansible in the container image so it’s using the correct path internally. Therefore allowing Ansible to run as you’d expect. I’ve got 2 commands that you can run which will fix this, without then needing to patch files. See the following, lines 25 - 30. If you paste those it will resolve the issue in the container image - https://github.com/spurin/diveintoansible-images/blob/ansible/Dockerfile |
I'm working in WSL1 on AlmaLinux on a Insider Beta Build of Win 11 (22H2, 22623.746) and I suddenly started getting these errors. @slikk66 's posted solution did the trick and saved me from madness |
Thank you @slikk66 |
Path to base.yml; @spurin - I came here following your Ansible Course on Udemy. Please update there as well. |
Thanks @spurin ! I executed those two lines inside the container, and this problem now resolved. So, updating ansible in container to latest version isn't a good idea ? |
Hi @tabish-javed, I have this change as part of the Dockerfile for the Ansible lab image so essentially, I install and patch. As you've seen, sadly if you update the version of ansible whilst in the running container, you'll lose this patch. This thread has some ways of overriding this at an ansible.cfg level but personally i'm not a fan, this patch allows Ansible to run as expected whilst in a container and is a more real-life outcome 👍 |
And also @tabish-javed - the location of that change has changed as Ansible has refactored and moved libraries around, hence the two variations, one for older versions and the other for current versions. |
I was trying to run this from within a Docker container in Centos. I suspected that might be an issue and when I switched to using a VM it worked fine.
In short,
What could be happening? Thank you in advance.
Centos info
ANSIBLE VERSION
ansible 2.2.1.0
SSH Config
Inventory
Ping with ansible:
-Verbose
The text was updated successfully, but these errors were encountered: