ansible.builtin.credstash (v2.9.27) — lookup

retrieve secrets from Credstash on AWS

| "added in version" 2.0 of ansible.builtin"

Authors: unknown

Install Ansible via pip

Install with pip install ansible==2.9.27

Description

Credstash is a small utility for managing secrets using AWS's KMS and DynamoDB: https://github.com/fugue/credstash


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: first use credstash to store your secrets
  shell: credstash put my-github-password secure123
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Test credstash lookup plugin -- get my github password"
  debug: msg="Credstash lookup! {{ lookup('credstash', 'my-github-password') }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Test credstash lookup plugin -- get my other password from us-west-1"
  debug: msg="Credstash lookup! {{ lookup('credstash', 'my-other-password', region='us-west-1') }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Test credstash lookup plugin -- get the company's github password"
  debug: msg="Credstash lookup! {{ lookup('credstash', 'company-github-password', table='company-passwords') }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Example play using the 'context' feature
  hosts: localhost
  vars:
    context:
      app: my_app
      environment: production
  tasks:

  - name: "Test credstash lookup plugin -- get the password with a context passed as a variable"
    debug: msg="{{ lookup('credstash', 'some-password', context=context) }}"

  - name: "Test credstash lookup plugin -- get the password with a context defined here"
    debug: msg="{{ lookup('credstash', 'some-password', context=dict(app='my_app', environment='production')) }}"

Inputs

    
table:
    default: credential-store
    description: name of the credstash table to query
    required: true

_terms:
    description: term or list of terms to lookup in the credit store
    required: true
    type: list

region:
    description: AWS region

version:
    description: Credstash version

profile_name:
    description: AWS profile to use for authentication
    env:
    - name: AWS_PROFILE

aws_access_key_id:
    description: AWS access key ID
    env:
    - name: AWS_ACCESS_KEY_ID

aws_session_token:
    description: AWS session token
    env:
    - name: AWS_SESSION_TOKEN

aws_secret_access_key:
    description: AWS access key
    env:
    - name: AWS_SECRET_ACCESS_KEY

Outputs

_raw:
  description:
  - value(s) stored in Credstash