Using vaulted variables with extra variables UI playbook

Hello everyone,

I am trying to vault out the remote user and remote password in my playbooks for machine builds. It seems that these variables need to be in the extra variables section for Windows builds. Is there a way I can pass these not in clear text? I tried to include my vaulted file in the extra variables as well as turning ansible_user and password into variables from that vaulted file. But I receive this error.

fatal: [xxx.xxx.xxx.xxx]: FAILED! => {“msg”: “The field ‘remote_user’ has an invalid value, which includes an undefined variable. The error was: ‘build_user’ is undefined”}

Here is my extra vars section:

— include_vars: vault_file.yml ansible_user: “{{ build_user }}” ansible_password: “{{ build_password }}” ansible_connection: winrm ansible_winrm_transport: basic ansible_port: 5986 ansible_winrm_server_cert_validation: ignore ansible_winrm_read_timeout_sec: 700 ansible_winrm_operation_timeout_sec: 300

build_user and build password are stored in vault_file.yml

Any help will be appreciated.

Thanks!

Josh

https://docs.ansible.com/ansible-tower/latest/html/release-notes/relnotes.html#ansible-tower-version-3-3-0

Use the paramter ALLOW_JINJA_IN_EXTRA_VARS Further information in the release notes above. Basically, it’s a security problem to allow jinja2 in the extra vars.

Thanks @Christopher. I will try this and revert.