Closed setpill closed 3 weeks ago
Usecase: in our environment we have ansible roles that have tasks that need to be executed by different users. For legacy and security reasons we cannot assume these users to have fixed names, so we need to provide them in variable form.
Let's say for example that a role executes some tasks as build_user
and some tasks as deploy_user
. We would then have a task (block) in the form of:
- name: Build something
vars:
ansible_user: "{{ build_user }}"
ansible_password: "{{ build_pass }}"
ansible_sudo_pass: "{{ build_pass }}"
block:
- [..]
Ansible-mitogen is not currently a drop-in replacement for this scenario, as it will not template these variables and pass the literal string {{ build_user }}
as the SSH user, which fails.
Ansible-mitogen is not currently a drop-in replacement for this scenario, as it will not template these variables and pass the literal string
{{ build_user }}
as the SSH user, which fails.
I'm investigating 2 Mitogen bugs that are probably affecting your playbook
ansible_*
(connection) variables don't get templated (varies issues already filed)vars:
block is ignored.Thanks for your great work! Mitogen really is a much faster engine for ansible, would be awesome to get it closer to that "drop-in replacement" ideal :)
ansible-mitogen does not handle templated values in
ssh_user
.Original context from !956 :
Originally posted by @setpill in https://github.com/mitogen-hq/mitogen/issues/956#issuecomment-2225208105