FDI 5.1 and ansible encoding error

Problem: FDI 5.1 and ansible failed with LookupError: unknown encoding: cp437

MODULE_STDERR:

Traceback (most recent call last):
File “”, line 107, in 
File “”, line 99, in _ansiballz_main
File “”, line 35, in invoke_module
File “/usr/lib64/python3.9/zipfile.py”, line 1304, in init
self._RealGetContents()
File “/usr/lib64/python3.9/zipfile.py”, line 1386, in _RealGetContents
filename = filename.decode(‘cp437’)
LookupError: unknown encoding: cp437

ansible version : ansible [core 2.14.12]

foreman discovery image : fdi-5.1.3-8371934.iso

I tried with adding adding env variables in task with no succes :

environment:
ANSIBLE_FORCE_UNICODE: “1”

Expected outcome:

Foreman and Proxy versions:

Foreman and Proxy plugin versions:

Distribution and version:

Other relevant data:

Could you elaborate? It is not immediately obvious to me what you’re doing. Could you describe it as a sequence of steps?

1 Like

Sure,

1 - I boot a host with fdi-5.1.3-8371934.iso and it retrieve an ip from a dhcpd

2 - l launch a playbook (targetting the booted host) with a simple ping module task

This will sound counterintuitive, but I have a hunch you may need ansible 2.16 to be able to run it against a machine with python3.9 (such as fdi).

Same behaviour with => ansible [core 2.16.14]

Perhaps let’s come back to why are you doing this? As it is not the normal workflow, if we know the reasoning we can suggest how this is normally done so no workaround is needed.

Sure, my use case is to do an automatic boot to fdi and gather facts with ansible in my process to build baremetal (it help me dicovering device, networks names).

It was all good in version 4.1

Any reason to not use the normal host discovery? Any facts you are missing there?

Main reasons are simplicity and leasyness