Bug #28878
openForeman Ansible Inventory reports fails in JSON if hosts has a non ascii char in its
Description
Copied from original community post: https://community.theforeman.org/t/foreman-ansible-inventory-reports-fails-in-json-if-hosts-has-a-non-ascii-char-in-its-facts/17119
Problem:
When AWX (Ansible Tower) sync its inventory or when manually generating an “Ansible Inventory” Report template, with facts, if any of those facts contains a non ascii character and you try to export the template in Json, you’ll receive an error similar to :
(Encoding::UndefinedConversionError): “\xC3” from ASCII-8BIT to UTF-8
In my case, I had the following in one of my host :
ec2_userdata :
"then rm /bootstrap.donefi# Récupération du répertoire courant et du répertoire "
Which caused the problem.
Exporting in anything else but Json works without problem.
Expected outcome:
No error when generating the report
Foreman and Proxy versions:
1.24.1
Foreman and Proxy plugin versions:
1.24.1
No data to display