Ansible-vault not decrypting on 2nd node in parallel environment



I’m attempting to run tests with 2x parallelism using Django. I’m setting up environment variables with ansible-vault in a circle.yml step as such.

    - bash ${HOME}/ginger/ us-east-1 sg-f87ddb87 5439
    - ansible-vault decrypt ${HOME}/ginger/config/settings/.env_vault --vault-password-file ${HOME}/ginger/ansible/.vault_pass --output ${HOME}/ginger/config/settings/.env
    - bash ${HOME}/ginger/
        parallel: true

My testrunner is of the simple manual type and looks like this

0) coverage run --source='.' test --keepdb --settings=config.settings.test --verbosity 2 --tag=search
1) coverage run --source='.' test --keepdb --settings=config.settings.test --verbosity 2 --exclude-tag=search

It seems that in the second container, my .env file does not get decrypted. The step does say Decryption successful, however, the file is not located in the directory. It does work on the first node, however. Also, if I ssh into the 2nd container manually, I am able to run the command successfully.

What do I not understand about Circle parallelism that my ansible-decrypt command works on the first node, but not on the 2nd?


I missed the line in the docs that states that parallel

It defaults to true for commands in the machine, checkout, dependencies and database build phases, and it defaults to false for commands in the test phases.

Changing my test commands to all parallel: true fixed my issue.