Is there any way to encrypt --private-key with ansible-vault and use it encrypted with Ansible Playbook

0 votes

Is there any way to encrypt --private-key with ansible-vault, encrypt it and use it with Ansible Playbook.

Jan 29, 2019 in Ansible by Kajol
3,296 views

1 answer to this question.

0 votes

Hey @Kajol,

Create a passphrase for the key

openssl rsa -in ssh_key.pem -out encrypted_ssh_key.pem

Give it a passphrase and provide that passphrase every time you run it, like thos:

ansible-playbook ansible_playbook -i inventory/ec2.py \
    -e ansible_ssh_user=ubuntu \
    -e ansible_user=ubuntu \
    --private-key=encrypted_ssh_key.pem
answered Jan 29, 2019 by Anupam

Related Questions In Ansible

0 votes
1 answer

Is there a way to recover lost Ansible Vault password?

Hey @Sridhar, There is no way to ...READ MORE

answered Jan 29, 2019 in Ansible by Akthia
2,927 views
0 votes
1 answer

Is it possible to start ec2 Windows machine and run windows command using ansible playbook?

Hi@Lakshminarayanan, Yes, you can do that. But after ...READ MORE

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

How to write ansible playbook to setup ubuntu workstation and install any updates on it

Hi@Shashi, Ansible has one module named ec2. This is ...READ MORE

answered Nov 19, 2020 in Ansible by MD
• 95,460 points
1,257 views
0 votes
1 answer

Is it possible to run a playbook with a crontab?

Ofcourse you can run ansible playbook with ...READ MORE

answered Jan 17, 2019 in Ansible by Yesha
4,897 views
+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,036 views
+2 votes
1 answer
0 votes
1 answer

Is it possible to run an Ansible Playbook in python script?

Hey @Cerci, Of course its possible. You ...READ MORE

answered Jan 17, 2019 in Ansible by Nicolas
15,668 views
0 votes
1 answer
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