-2

I want to fetch/download files from a remote server with Ansible. I can use fetch or synchronize modules, but they don't support encryption with password. Is it possible with Ansible to download files in encrypted form?

Edit:
Looks like I couldn't clarify my question well (this question is on hold currently).
I want to download conf files from a remote computer. I can download them in one of two ways, fetch or synchronize modules like this:

- fetch:
    src: /remote/path/to/single/file
    dest: /local/path/to/save/file
    flat: yes
- name: Synchronization of src on the control machine to dest on the remote hosts
  synchronize:
    src: some/relative/path
    dest: /some/absolute/path

Neither approach supports password protection to transfer over the network. As the first answer stated below, SSH uses encryption already, but I'm wanting extra security with a password. I couldn't find how to do that with Ansible.

I wanted to know if there is a way to add password protection using Ansible, or if encrypting files on the remote server using other tools and then copying with Ansible to local, and then decrypting it again manually is necessary?

jaco0646
  • 15,303
  • 7
  • 59
  • 83
Ikrom
  • 4,785
  • 5
  • 52
  • 76

1 Answers1

1

Ansible uses ssh as communication protocol with your servers. So your file transfer is already end2end encrypted.

If you want the files to be encrypted themselves you would have to encrypt it before you download it.

See How to use OpenSSL to encrypt/decrypt files?

Patrick Pötz
  • 369
  • 5
  • 15