webui icon indicating copy to clipboard operation
webui copied to clipboard

Problem: Cannot override ANSIBLE_HOST_KEY_CHECKING?

Open mathieumd opened this issue 1 year ago • 3 comments

Versions

Version 0.0.24.post3

Scope

Ansible (Job Execution)

Issue

Since #60, I'm trying to override the default ANSIBLE_HOST_KEY_CHECKING, as it's set to True by default, but neither EnvironmentFile or Environment in Systemd unit seems to works:

[Service]
#...
EnvironmentFile=/etc/ansibleguy-webui/env.txt
# or
#Environment=ANSIBLE_HOST_KEY_CHECKING=False
#...
grep HOST_KEY /etc/ansibleguy-webui/env.txt
ANSIBLE_HOST_KEY_CHECKING=False

The job is blocking for 1h, then fails:

TASK [Gathering Facts] *********************************************************

The authenticity of host '10.10.10.10 (10.10.10.10)' can't be established.
ED25519 key fingerprint is SHA256:zdG3im0nO9n5+eitxa6sQ7ONMKd5rixs5hPP8Hi0NyA.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? 

What's the correct way to change ANSIBLE_HOST_KEY_CHECKING?

mathieumd avatar Oct 07 '24 14:10 mathieumd

Please try to supply the env-variable at https://<host>/ui/system/config image

The ansible-runner is actually not inheriting the env-vars from the WebUI service. (as this would also be a security issue)

Maybe the documentation could be improved? Do you have an idea on what to add?

ansibleguy avatar Oct 07 '24 16:10 ansibleguy

Note: just tested it and it worked

ansibleguy avatar Oct 07 '24 17:10 ansibleguy

I confirm that too.

So maybe the doc should state that Systemd unit EnvironmentFile is not where to put some (which?) environment variables?

mathieumd avatar Oct 08 '24 14:10 mathieumd