Ansible over SSH to Windows issue on Foreman 3 Ubuntu fails. Works with CentOS

So I’ve been working on a way to run Ansible to windows hosts over SSH through Foreman 3.

SSHd on windows is a LOT easier to push out to windows systems than WinRM. Flat use of Ansible works quite well with against Windows running SSH too.

Small status that with CentOS7 running Foreman with Ansible Plugin. Everything works as expected. Roles get installed, playbooks and commands are flawless.
It really excites me that I can use Foreman to admin windows this way

Ubuntu 18/20.04 doesn’t seem to work right though. Flat Ansible is fine, emulated everything I did with CentOS in regards to parameters. I’m thinking it’s something to do with the Dynflow plugin for Debian based OS?

Here’s role attempt backtrace of the errors out.
Playbooks and Ansible Commands (cloned command and switched “shell” to “win_shell”.
BackTrace.log (16.0 KB)

Curious why CentOS works, but Ubuntu Doesn’t. Would love find out why.

Little more digging into it this is also happening on linux systems under my ubuntu20/forman3 instance… seems to be a python3 issue maybe?

Let me try to spin a repro of this on a fresh Ubuntu 18 install.

CentOS was on Python2.7 with no problems.

enabled -vvv for a linux system. Basic shell “hostname” produced:
BackTrace-vvv.log (1.5 KB)

So you have a Foreman running on CentOS7 and one on Ubuntu, and Ansible works from CentOS but doesn’t from Ubuntu 20.04?

Can you post the contents of your /usr/share/foreman-proxy/.ansible.cfg from both machines, and the outputs from rpm -qa |grep ansible from CentOS and dpkg -l | grep ansible from Ubuntu?

1 Like

yeah. VM testbed where I’ve got Cent/Alma/Unbuntu instances of foreman going.

Cent and Alma ran ansible right out of the box after installs. Zero issues. Windows and Linux just “work” when installing roles, running playbooks, etc.

Ubuntu just doesn’t.

Here’s the info for Ubuntu20.04

ansible.cfg.log (573 Bytes)

$ dpkg -l | grep ansible
ii ansible 2.9.6+dfsg-1 all Configuration management, deployment, and task execution system
ii python3-ansible-runner 1.4.7-1~tfm+1 all library that interfaces with Ansible (Python 3.x)
ii ruby-foreman-ansible 6.4.1-1 all Foreman Ansible plugin
ii ruby-smart-proxy-ansible 3.2.1-1 all Ansible support for Foreman smart proxy

For CentOS

CentOS-ansible.cfg.log (616 Bytes)

$ sudo rpm -qa | grep ansible
tfm-rubygem-foreman_ansible-6.4.1-1.fm2_6.el7.noarch
tfm-rubygem-smart_proxy_ansible-3.2.1-2.fm2_6.el7.noarch
ansible-runner-1.4.7-1.el7.noarch
ansible-collection-theforeman-foreman-2.1.2-1.el7.noarch
python2-ansible-runner-1.4.7-1.el7.noarch
ansible-2.9.25-1.el7.noarch

Does anything change if you apt install ansible-collection-theforeman-foreman on that Ubuntu box?

1 Like

Ansible is seeming to be passing now on Ubuntu! Thanks a ton.
Why is that missing component part of Cent/Alma but not for Ubuntu?

I don’t recall exactly why we don’t install it by default on Debian-based installs.

But I also was pretty sure it’s not needed (it terms of: if it’s missing, things won’t fail, but just ignore that one thing). Will investigate.

Well… either way. I appreciate you bringing forth the know how. it’s working and I’m super happy on that.