-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jinja expressions are not evaluated in (not only) credential variables #1083
Comments
Tested on latest release: 0.3.9. |
I have the same issue 👍 |
With PR #1114 merged into master the Ansible connection password (e.g. |
Now released in 0.3.12 |
That`s great news! I have tested on 0.3.12 and templated According to this issue: #1116, after new version release, also templated I have added PR: #1148, which will allow to template After those 2 PR`s released, feel free to close this issue! |
This problem also affects the |
I updated my post and extended example to some extent. It`s great idea to use this issue to cover also |
This reads the become username from the `become_user` attribute of the play context, to the `"become_user"` option of the loaded become plugin. This has been supported by vanilla Ansible since Ansible 2.10 (ansible-base 2.10). To support this I've also switched from using the `play_context.become` (a bool), to `connection.become` (an instance of the appropriate) become plugin. New tests have been added, modelled on those for templated connection parameters (see mitogen-hq#1147, mitogen-hq#1153, mitogen-hq#1159). See - ansible/ansible@480b106 refs mitogen-hq#1083 Co-authored-by: mordek <[email protected]>
ansible_mitogen: Support templated `become_user`
Mitogen 0.3.14 is out. It includes support for templated |
Mitogen 0.3.15 is out. It supports templated SSH arguments and become password. |
Uses the same fallback for (mitogen_sudo et al) as become_exe (see mitogen-hq#1173). The new `Spec.become_flags()` is not yet explicitly tested. Note that it returns a string (matching the Ansible option of the same name), whereas Spec.sudo_args() returns a list. refs mitogen-hq#1083
Uses the same fallback for (mitogen_sudo et al) as become_exe (see mitogen-hq#1173). The new `Spec.become_flags()` is not yet explicitly tested. Note that it returns a string (matching the Ansible option of the same name), whereas `Spec.sudo_args()` returns a list. refs mitogen-hq#1083
Mitogen 0.3.16 is out with support for templating the Ansible SSH command (e.g. ansible_ssh_executable), the become command (e.g. ansible_become_exe), and the become command arguments (e.g. ansible_become_flags) |
I think that leaves Become plugins (e.g. ssh)
Connection plugins (e.g. ssh)
|
OS / Environment
Debian 12
Ansible version
Environment variables for strategy plugin
Mitogen version
Problem
Jinja expressions are not evaluated by mitogen plugin
How to reproduce
Description
Ansible host: srv1 has credentials configured using Jinja expressions from vault/hostvars variables.
Ansible host: srv2 has credentials configured directly as host variables.
Vault file
Path: vault.test.yml
Inventory file
Path: inventory/local/local.yml
Commands
regular user
superuser - become
Output
regular user
superuser - become
Commands with verbose
regular user
superuser - become
Output
Expected result
Source of the problem
Ansible: ansible/ansible@6d2d476
Similar issues
Ansible
Paramiko plugin: ansible/ansible#78509
Ansible: ansible/ansible#76590
Mitogen
#905
#978
#1022
#1040
#1079
#1116
The text was updated successfully, but these errors were encountered: