Actions
Bug #35658
closedAnsible fact parser fails to parse Windows facts if they do not contain os_name
Description
Log:
2022-10-20T13:23:51 [I|app|d3408894] Started POST "/api/v2/hosts/facts" for 192.168.1.90 at 2022-10-20 13:23:51 +0200 2022-10-20T13:23:51 [I|app|d3408894] Processing by Api::V2::HostsController#facts as JSON 2022-10-20T13:23:51 [I|app|d3408894] Parameters: {"name"=>"win10test002.testdom.local", "facts"=>"[FILTERED]", "apiv"=>"v2", "host"=>{"name"=>"win10test002.testdom.local"}} 2022-10-20T13:23:52 [I|app|d3408894] Import facts for 'win10test002.testdom.local' completed. Added: 100, Updated: 0, Deleted 0 facts 2022-10-20T13:23:52 [W|app|d3408894] Action failed 2022-10-20T13:23:52 [I|app|d3408894] Backtrace for 'Action failed' error (NoMethodError): undefined method `tr' for nil:NilClass d3408894 | Did you mean? try d3408894 | /usr/share/foreman/app/services/foreman_ansible/operating_system_parser.rb:82:in `os_name' d3408894 | /usr/share/foreman/app/services/foreman_ansible/operating_system_parser.rb:7:in `operatingsystem'
The problem is that Ansible does not report the `ansible_os_name` and `ansible_distribution` facts when executed without Admin privileges (see https://github.com/ansible-collections/ansible.windows/pull/78 and https://github.com/ansible-collections/ansible.windows/issues/389 for details, but the issue existed before the PR too, just less obviously).
Updated by The Foreman Bot about 2 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/9476 added
Updated by Evgeni Golov about 2 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset foreman|02ea67ce72522b7fc8c0de950ba85f7cd7d8ab91.
Updated by Ewoud Kohl van Wijngaarden about 2 years ago
- Triaged changed from No to Yes
Actions