You can also set ANSIBLE_VAULT_PASSWORD_FILE environment variable, e.g. ANSIBLE_VAULT_PASSWORD_FILE=~/.vault_pass.txt and Ansible will automatically search for the password in that file.
Using the ANSIBLE_VAULT_PASSWORD_FILE
environment variable is in my mind the most convenient way to configure the secret for ansible-vault
.