Ansible shell/command modules with Doppler

Hi @Lily and welcome to the Doppler community!

From taking a quick look at the Ansible docs, you should be able to use Ansible’s built-in support for environment variables with the Doppler CLI by running:

# `DOPPLER_TOKEN` environment variable must be set 
doppler run -- ansible-playbook playbook.yml

If triggering the playbook using a GitHub Action, the step could look like:

- name: Ansible Playbook
    run: doppler run -- ansible-playbook playbook.yml
    env:
        DOPPLER_TOKEN: ${{ secrets.DOPPLER_TOKEN }}

Then I believe inside your playbook, you can reference a Doppler injected environment variable using:

{{ lookup('env', 'SECRET_FROM_DOPPLER') }}

Let me know if that works as I’m not an Ansible user and need to get across it more.

We don’t yet have an Ansible integration, but I’ve added it to our engineering backlog and will let you know once it’s available (although I can’t offer an ETA at this stage).