Problem:
Attempting to onboard existing windows systems into foreman via Ansible setup. facts are processed but fail to be sent to the Foreman /api/v2/hosts/facts site.
Linux hosts work perfectly, like always.
Ansible runs to the system (win_ping module, playbooks, etc) to the windows host via ansible are also fine. Callback produces the error post run:
Distribution and version:
CentOS7 for Foreman server.
Windows Server2019 with OpenSSH Server installed:
(Add-WindowsCapability āOnline āName OpenSSH.Server~~~~0.0.1.0)
proxy public key used for authentication
Other relevant data:
Callback addition to ansible.cfg:
Weād need to see the contents of /var/log/foreman/production.log around the time the callback has submitted the data and got the 500 error when uploading facts.
The problem is not the name of the interface, but the fact (lol) that on Linux, Ansible reports the interfaces as ['lo', 'eth0'] (= a list of strings), while on Windows itās [{'connection_name':'Ethernet', ā¦}] (= a list of hashes), and our code doesnāt cope with the later
I do not have time for full implementation of NIC parsing for Windows, however, I see you are blocked by this therefore I propose that Ansible parser returns no interfaces:
That should unblock you, please test and report back.
Thanks @lzap Iāll attempt the pull a little later (busy with at my workplace)
Expect a report back in a few days.
I have about 600+ windows systems (and about 2000 linux) that need imported in my production environment. so this would be a huge lifesaver.
FYI, OpenSSH server on Windows + Ansible is exceptionally streamlined and useful. Way easier to setup than WinRM instances.
Happy to provide windows side erb of ssh setup script I have when completed.
My virt enviroment for test cases took a bad poweroutage and Iām reconstructing it all. (better than production though! hah!)
Hey, Iām not really the best PRās from Git, what it the best method in pulling said changes for verification? Or should I be standing a new foreman-devl instance up for changes?
cd /usr/share/foreman
wget https://github.com/theforeman/foreman/pull/8848.patch
patch -p1 < 8848.patch
Or you can just locate the app/services/ansible_fact_parser.rb and add the line which you can see in the patch diff view. It was a one line change, all the rest are just tests. Restart foreman afterwards.