Can I specify ansible-password-vault-file in a playbook before running an include_vars ?

Hi,

I’m creating some playbooks that require some vaulted data and this is sourced dynamically. I am looking for a way to include the ansible password vault file before including this data, but without doing this on the command line, does anyone have a solution for this as I cannot seem to find anything in the code in 2.9 but I’m sure someone must have had this requirement before ?

Cheers

Steve Maher

it is not possible, vault secrets need to be provided at the start of
a run, before playbooks are even read. You CAN use lookups to access
data from other secure sources and those can take secrets at the time
the lookup is invoked.