Skip to content

Instantly share code, notes, and snippets.

@azrdev
Created October 31, 2022 12:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azrdev/554afd875de759c4f57b4a4352bbf239 to your computer and use it in GitHub Desktop.
Save azrdev/554afd875de759c4f57b4a4352bbf239 to your computer and use it in GitHub Desktop.
ansible-vault used in dynamic inventory
all:
children:
ungrouped:
hosts:
test1:
# could use !vault here, but not when the hosts/groups/vars don't come from this file, but from a dynamic inventory plugin/script, e.g. `compose:` in `vmware_vm_inventory`
asp: |
$ANSIBLE_VAULT;1.1;AES256
36353062646365316465383532633931333862393931313662653362306166623065616161306138
3133323130306533663965626261636633353534343862300a363165323836613031633066626465
63333931653262613937376164623461663866653337346137306566653563633130653465353964
3838393635653132650a316534393565373333623761613837323330396234346365666231363131
3062
plugin: constructed
strict: true
compose:
ansible_ssh_password_1: asp
ansible_ssh_password_2: |
"!vault
{{ asp }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment