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?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I set the path or any other environment variable for a task or entire playbook?

2


Explain the callback plugin in ansible?

2


What features does the ansible tower provide?

2


How do I configure a jump host to access servers that I have no direct access to?

2


What are the variables in ansible?

2


How to keep secret data in a playbook?

2


How do I disable cowsay?

2


Is ansible an open source tool?

3


How is ansible used in a continuous delivery pipeline? Explain.

2


Compare ansible with chef.

3


How can one interpolate variables or dynamic variable names?

2


How do I access a variable name programmatically?

2


How to keep secret data in playbook?

2


What is ansible?

2


Can you copy files recursively onto a target host? If yes, how?

3