Use Ansible to setup environment?

We recently started using Ansible + Vagrant for development, and I was wondering if it’s possible to use our project’s Ansible tasks to setup the build environment. In particular we have Ansible tasks setting environment variables, it would be great to be able to re-use those tasks to setup CircleCI.

1 Like

We create a separate sub-shell for each command that is executed during the build, so the env vars your Ansible command sets up will not be preserved in the subsequent commands.

The only exception would be if you add the necessary variable declarations to the end of the ~/.circlerc file—that file is sourced before each command.

1 Like