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’s the use of ansible?

1 Answers  


How ansible different from the playbook?

1 Answers  


Why are you attracted to science and science fiction?

0 Answers  


How can you access a list of ansible_variables?

1 Answers  


Compare ansible vs puppet?

1 Answers  


What are the ansible modules? Explain the different types.

1 Answers  


What is ansible and what makes it stand out from the rest of the configuration management tools?

1 Answers  


How can you speed up management inside in ec2?

1 Answers  


How do I access shell environment variables?

1 Answers  


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

1 Answers  


How can one generate encrypted passwords for the user module?

1 Answers  


What is the difference between a variable name and an environment variable?

1 Answers  


Categories