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 in Ansible by Kajol
388 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 by Anupam

Related Questions In Ansible

0 votes
1 answer
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 in Ansible by Yesha
554 views
0 votes
1 answer

How to encrypt and existing file using Ansible Vault?

Hey @Kyraa, to encrypt an existing file ...READ MORE

answered Jan 29 in Ansible by Kavya
590 views
+13 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 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
216 views
0 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 in Ansible by Nicolas
2,730 views
0 votes
1 answer