Skip to content

Instantly share code, notes, and snippets.

@anmolj7
Last active January 19, 2020 18:09
Show Gist options
  • Save anmolj7/b5d6eb459aa966cd5746acd728d071b6 to your computer and use it in GitHub Desktop.
Save anmolj7/b5d6eb459aa966cd5746acd728d071b6 to your computer and use it in GitHub Desktop.
Ansible-Vault

ANSIBLE-VAULT!

Steps taken to install..

  1. None Really. Didn't need to! It came with the installation of ansible! And if somebody needs to see how to install ansible, then, that person really oughta think about changing their line of work :P

Uses of Ansible-Vault

Suppose it is the modern wizarding world, and instead of a war with wands, Harry and Voldermot are fighting through the modern weapon, Internet. Harry has N numbers of computers ready to try the distributed denial of service attack on Voldermot's servers Harry for some scenario, He has to include some API's secret keys. He obviously doesn't wanna share the key with others for obvious reasons, so, in order to keep them un-exposed, Harry could use Ansible Vault! The perfect solution to his problems! Although, for sending messages, a corporeal patronus would still be prefered :P

Steps to use ansible-vault

  1. Which would ask the user to enter a password. ansible-vault encrypt create_user.yml
  2. In order to run the encrypted playbook.. ansible-playbook create_user.yml --ask-vault-pass

Running the given playbook

In order to run the given playbook, just type

ansible-playbook create_user.yml --ask-vault-pass

and Enter the password as: Cringy@Password and VOILAAA

$ANSIBLE_VAULT;1.1;AES256
31373836656530356365316363333337653836393331626535383461356331383830623939653561
6264323564636433643861643062343565386330343962340a306566393034653632633062356337
37656135656566613932366466333562323537646539653536373736393330373466643862313336
3266636231363933330a333533393432373464323439643764613861313039376633616466366466
66623634323332396234383964333037663063613566363134633763643662326239613138333262
39333961356238663538376464363962343166306532623032666432613566636261313763333437
36623466623837303130353639373836646164633264613836346634363437336336363966363336
31306536636263383462613362313638366432376666376464336139316233613563313337386335
33643038393435663837316535373037663438363937656462393236383639333463323266396530
39343064373763313837303534623366343235323933646163636239393262303334386366396339
37616665613632613635383234383233326132616166336561663031376466643664636131396337
37626165346235613133643563353138303366616136616462386262343463336635386439623838
30613864653561646433323530336666393231356462363732636234306339346562323838333235
3366656435666662636437633966386435336131653230343732
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment