Prerequisites:
- jq
- docker
- docker-compose
- Ansible Tower v3.5 or greater
Steps:
- Run the start-conjur script. This automates the Conjur OSS Quickstart steps.
- Run setup-ansible-demo.sh. This loads a Conjur policy to create an identity with access to two secrets.
- Use values in the output from setup script to create a Conjur credential retriever
- Use the test button to verify the credential retriever can retrieve the aws-access-key and aws-secret-key values
- Create an Amazon Web Services credential
- Replace the Access Key value with the Conjur Credential Retriever configured to retrieve the aws-access-key value
- Replace the Secret Key value with the Conjur Credential Retriever configured to retrieve the aws-secret-key value
- Create a job template that uses the AWS credential and runs the following playbook:
---
- hosts: all
gather_facts: False
tasks:
- debug:
msg:
- Access Key is {{ lookup('env', "AWS_ACCESS_KEY_ID") }}
- Secret Key is {{ lookup('env', "AWS_SECRET_ACCESS_KEY") }}
- Run the job and examine the output
- Change the value of one or both variables using the conjur-variable script. e.g.:
>> ./conjur-variable set aws-access-key a-new-value
- Re-run the job and verify the output contains the new value.
- Your Ansible job now uses dynamically retrieved credentials!