How to create a vault in Ansible

0 votes

Hi Guys,

I have installed Ansible in the Linux system. I have one file which contains a username and password. I want to create a vault in ansible so that I can store a username and password safely. How can I do that?

Aug 11, 2020 by akhtar
• 38,260 points
158 views

1 answer to this question.

0 votes

Hi@akhtar,

Ansible has a command to encrypt any file named ansible-vault. So that nobody can see the data of that file. You can use the below-given command to do so.

$ ansible-vault encrypt var.yml
New Vault password:
Confirm New Vault password:
Encryption successful
[root@localhost mail]# cat var.yml
$ANSIBLE_VAULT;1.1;AES256
35343563633538316263636231663362626433633038653362623231663737393835303563393939
3865383434623030343661396638316231306138303334660a396332353333353635396339633864
63376634616135663835656532663930356466643831616437356232646634343038323865393734
6465653533373830370a613736333130316434323638643862643238666434303361333965333765
39363762643430336635313435346233646338316635356338323466666535313062343964323137
33653132396631376365643762653738393863363234616238313039353231626232333333333064
306638373864663361663434333862353232

answered Aug 11, 2020 by MD
• 95,460 points

Related Questions

+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,206 views
+2 votes
1 answer
0 votes
1 answer

How to create a new encrpted file using Ansible Vault?

If you are creating a new file ...READ MORE

answered Jan 29, 2019 in Ansible by Kyraa
1,170 views
0 votes
1 answer

How to create a group of Managed Nodes in Ansible?

Hi@akhtar, You can use tags in your inventory ...READ MORE

answered Aug 1, 2020 in Ansible by MD
• 95,460 points
1,368 views
0 votes
1 answer

How to create a variable in Ansible Playbook?

Hi@akhtar, Variable in playbooks are very similar to using variables in ...READ MORE

answered Aug 2, 2020 in Ansible by MD
• 95,460 points
1,384 views
0 votes
1 answer

How to decrypt a vault in Ansible?

Hi@akhtar, You can use decrypt keyword in your ...READ MORE

answered Aug 11, 2020 in Ansible by MD
• 95,460 points
709 views
0 votes
1 answer

How to create a security group in AWS using Ansible-Playbook?

Hi@akhtar, You can use the ec2_group module in ...READ MORE

answered Aug 13, 2020 in Ansible by MD
• 95,460 points
3,935 views
0 votes
1 answer

How to create a role in Ansible?

Hi@akhtar, You can create a role in Ansible ...READ MORE

answered Aug 20, 2020 in Ansible by MD
• 95,460 points
879 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP