## TL;DR

This makes variable substitution unpredictable and requires workarounds. ### Issue Type Bug Report ### Component Name vault ### Ansible Version ```console ansible [core 2.19.0] config file = [HOME]/... configured module search pat The maintainers say they are still looking for a permanent fix.

## Steps

1. https://github.com/ansible/ansible/issues/85722: Issue ansible/ansible#85722 (closed, 15 comments): ### Summary When a variable is defined inline using the `!vault` tag, rendering behavior differs depending on context since 2.19. Direct references resolve to the decrypted value, but the same variable remains encrypted when rendered via `to_nice_yaml`. If the entire file is vaulted with `ansible-vault encrypt`, this problem does **not** occur. This makes variable substitution unpredictable and requires workarounds. ### Issue Type Bug Report ### Component Name vault ### Ansible Version ```console ansible [core 2.19.0] config file = [HOME]/... configured module search pat

## When to use

You are seeing this: https://github.com/ansible/ansible/issues/85722: Issue ansible/ansible#85722 (closed, 15 comments): ### Summary When a variable is defined inline using the !vault tag, rendering behavior differs depending on context since 2.19. Use this skill when you run into "Inconsistent rendering of vaulted inline vs. file vaulted variables".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

Versions mentioned in the source: 2.19, core 2.19.0. If you are on something much newer or older, the details may have shifted.

## Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

## Sources

- https://github.com/ansible/ansible/issues/85722:
