Skip to content

Instantly share code, notes, and snippets.

@neilus
Last active December 28, 2016 12:22
Show Gist options
  • Save neilus/fe2a4c5e3b2b28274dab6c41f0b674da to your computer and use it in GitHub Desktop.
Save neilus/fe2a4c5e3b2b28274dab6c41f0b674da to your computer and use it in GitHub Desktop.
ansible vault rumbling

run with command:

ansible-playbook -i "localhost," -c local --extra-vars "clivar=what" --ask-vault-pass

vault pass is: almafa

create a new vault file like:

ansible-vault create vault_vars.yml

edit existing vault file:

ansible-vault edit vault_vars.yml
localhost ansible_host=localhost ansible_connection=local
---
- hosts: all
name: rumblings with vault
vars:
playbookvar: this
tasks:
- debug:
var: clivar
- debug:
var: playbookvar
- include_vars: vars.yml
- debug:
var: varfile
- include_vars: vault_vars.yml
- debug:
var: vaultvar
varfile: sparta
$ANSIBLE_VAULT;1.1;AES256
64643232666439306566663632393363633235366337376563316462623030613032366436623565
3262356534623935303336623230376534313766383262320a646636363736643537623137383463
66623535363964643633363533656439653633393363666136616639306633613433373939316336
3131396632393137390a353362396336353636623366343166323937636265343364396263363565
37646566653435363965366164393430613963363361653931333738616338306234
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment