Skip to content

Instantly share code, notes, and snippets.

@jovenbico
Last active January 31, 2019 15:58
Show Gist options
  • Save jovenbico/65f5fd1a381663b38009155a21c33b9d to your computer and use it in GitHub Desktop.
Save jovenbico/65f5fd1a381663b38009155a21c33b9d to your computer and use it in GitHub Desktop.

Sample using vault

>> vars.protected_values.yml  ==  vars/protected_values.yml

$ ansible-playbook my-playbook.yml --ask-vault-pass
$ ansible-playbook my-playbook0.yml --ask-vault-pass

Passw0rd
- hosts: localhost
tasks:
# include_vars can only use under tasks
- name: Include protected values
include_vars:
file: protected_values.yml
- name: Use the protected_values
debug:
msg: "user: {{vault_username}} || pass {{vault_password}}"
- hosts: localhost
vars_files:
- vars/protected_values.yml
tasks:
- name: Use the protected_values
debug:
msg: "user: {{vault_username}} || pass {{vault_password}}"
$ANSIBLE_VAULT;1.1;AES256
38343936306465653530383231366438333032653934326433616638366130613962373065613135
6532656335663061353462303931623735303832313136620a353436633764333962396237626164
31323530623366303930343235653266363163653462393730613965353965643033336431393439
3932363733306331360a306161643934376364653266633339646235336334653039303836303438
62653264333965316461336438303739323333363233353433383138323834353464616266303065
35616135656231623537383032393361383162613565636534323765313035323935303662636565
626439396363643432333234323831633330
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment