Skip to content

Instantly share code, notes, and snippets.

@include
Created October 27, 2014 09:36
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save include/25319e7e2b0f59b4c411 to your computer and use it in GitHub Desktop.
Save include/25319e7e2b0f59b4c411 to your computer and use it in GitHub Desktop.
Ansible Vault
---
# file: playbooks/plbk_test_vault.yml
- hosts: localhost
user: include
vars_files:
- ../files/vault/ec2/prd/svc_master_key.yml
tasks:
- name: GENERATE mktemp file
command: mktemp /Users/include/playbook.XXXXX
register: tmpfile
- name: LOAD VAULT into mktemp file
shell: echo "{{ svc_master_key }}" > "{{ tmpfile.stdout }}"
- name: UPLOAD KEY
copy: >
src="{{ tmpfile.stdout }}"
dest=/Users/include/foobar2.pem
- name: REMOVE mktemp file
file: >
path={{ tmpfile.stdout }}
state=absent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment