Open vdanjean opened 1 year ago
Small addendum, we have a bootstrap playbook like this:
- vars:
ansible_user: "{{ _bootstrap_user }}"
tasks:
- [ ... provision SSH CA trust and Ansible user ]
- ping:
data: "Connection test"
vars:
ansible_user: ansible
This of course has the same behavior as mentioned in the OP, but even when hardcoding the _bootstrap_user
, the last task fails:
TASK [Test SSH certificate connection]
Thursday 01 August 2024 08:39:30 +0000 (0:00:00.155) 0:00:10.334 *******
fatal: [manager1.foo.org]: UNREACHABLE! => changed=false
msg: SSH authentication is incorrect
unreachable: true
This does work with native Ansible, but it seems precedence is evaluated incorrectly here:
command line for Connection(None): ssh -o "LogLevel ERROR" -l debian [...]
Mitogen 0.3.8, Ansible 2.16.9 / 9.8.0.
Which version of Ansible are you running? 7.7.0+dfsg-1 from debian unstable
Is your version of Ansible patched in any way? no
Are you running with any custom modules, or
module_utils
loaded? noHave you tried the latest master version from Git? no
Do you have some idea of what the underlying problem may be? It seems that ansible variables related to ssh (at least) are not evaluated
Mention your host and target OS and versions host is Debian unstable, target is Debian stable (bookworm)
Mention your host and target Python versions host: 3.11.4-5+b1 target: 3.11.2-1+b1
I reproduce the problem with a small inventory and task file: ansible_user and ansible_ssh_host are defined to a non-constant in the inventory file (group
dj
):My test playbook is the following
As it is, running it with default stategy works. But, with
strategy = mitogen_linear
, I got:The log shows that
ansible_user
andansible_ssh_host
are not expended with mitogen. Adding at the start oftest.yml
the too line that callsset_fact
on the variables used by mitogen workaround the problem:Regards, Vincent