Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How do I keep secret data in my playbook?



How do I keep secret data in my playbook?..

Answer / Shahzad Alam

To store sensitive data such as passwords and API keys securely in your Ansible playbooks, you can use encrypted variables:n1. Create a vault password: Run the command `ansible-vault create <playbook_name>` to generate an encrypted file.n2. Add secret data to the vault file: Edit the created file and add sensitive information within vault-wrapped blocks, which look like this: ```n---!nvault | ansible-vaultnmysecret:n username: myusernamen password: mypasswordn```n3. Encrypt the file: Save and exit the vault file, then run `ansible-vault encrypt <playbook_name>` to encrypt it.n4. Use the encrypted playbook: When you run your Ansible commands, provide the vault password when prompted.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Ansible Interview Questions

What is ansible?

1 Answers  


Explain callback_plugin in ansible?

1 Answers  


What are ansible vaults?

1 Answers  


How would you access a variable of the first host in a group?

1 Answers  


Write a playbook to create a backup of a file in the remote servers before copy.

1 Answers  


What is the way to access shell environment variables in ansible?

1 Answers  


How do I generate crypted passwords for the user module?

1 Answers  


What is ansible role?

1 Answers  


Does ansible support aws?

1 Answers  


What are playbooks in ansible?

1 Answers  


Why is ‘{{ }}’ notation used?

1 Answers  


When should I use {{ }}?

1 Answers  


Categories