Upload encrypted file using ansible vault?

0 votes
Is it possible to upload an encrypted file in my playbook using ansible vault?
Jan 29 in Ansible by Milind
45 views

1 answer to this question.

0 votes

You can do this, make your playbook part of a "Vault" and add a variable that contains your certificate content. Something like this:

---
- name: My playbook
  hosts: all

  vars:
    mycert: |
       blah
       blah

    - copy:
      content: "{{ mycert }}"
      dest: /mydecrypted.pem

    - name: Upload Cert
      copy: src=/home/ubuntu/mydecrypted.pem dest=/home/ubuntu/mydecrypteddest.pem

    - name: Delete decrypted cert
      file: path=/home/ubuntu/mydecrypted.pem state=absent
answered Jan 29 by Faizal

Related Questions In Ansible

0 votes
1 answer
0 votes
1 answer

Encrypt an encrypted file - Ansible Vault

Hey @Fez, This is one of the way ...READ MORE

answered Jan 29 in Ansible by Cerci
67 views
0 votes
1 answer

View the encrypted file without decrypting - Ansible Vault

Hey @Laksha, you can view the file ...READ MORE

answered Mar 6 in Ansible by William
122 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
264 views
0 votes
1 answer
0 votes
1 answer

What files can be encrypted using the Ansible Vault?

Yes @Umang, Ansible Vault is used to ...READ MORE

answered Jan 29 in Ansible by Kavya
79 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
657 views