>Are all of the files you're referencing vault-encrypted, or does the slowness come from the initialization of the VaultLib?
Only one file is vault encrypted, but (almost) every role references it as a vars file. I don't know which part in particular is slow; I noticed the delay after an open() on the vault file when stracing ansible and then just confirmed it decrypted the file each time without digging any further.
> It might be better to cache that object based on the encryption method
and/or hashed password rather than the unencrypted contents of the YAML
files themselves.
The choice to cache the parsed YAML rather than something lower down the chain was made because that avoided the most work for ansible and, since I know YAML files don't changes during execution, seemed safe. An initial attempt only cached the decryption result, which already improved speeds considerably but was still about three times as slow as caching the lot.
I just tried caching only the VaultAES256 object instead of the above approach, but that made no difference to the start up time.
--J