【问题标题】:ansible: synchronize files with encryption or with passwordansible:使用加密或密码同步文件
【发布时间】:2018-10-13 18:02:10
【问题描述】:

我想使用 Ansible 从远程服务器获取/下载文件。我可以使用fetchsynchronize 模块,但它们不支持密码加密。 Ansible 是否可以下载加密形式的文件?

编辑:
看起来我无法很好地澄清我的问题(这个问题目前处于搁置状态)。
我想从远程计算机下载 conf 文件。我可以通过以下两种方式之一下载它们,fetchsynchronize 模块,如下所示:

- 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

这两种方法都不支持通过网络传输的密码保护。正如下面所说的第一个答案,SSH 已经使用了加密,但我希望通过密码获得额外的安全性。我找不到如何使用 Ansible 做到这一点。

我想知道是否有办法使用 Ansible 添加密码保护,或者是否需要使用其他工具加密远程服务器上的文件,然后使用 Ansible 复制到本地,然后再次手动解密?

【问题讨论】:

    标签: encryption ansible password-protection


    【解决方案1】:

    Ansible 使用 ssh 作为与您的服务器的通信协议。所以你的文件传输已经端到端加密了。

    如果您希望文件本身被加密,您必须在下载之前对其进行加密。

    How to use OpenSSL to encrypt/decrypt files?

    【讨论】:

      猜你喜欢
      • 2014-08-21
      • 2015-10-25
      • 2022-01-14
      • 1970-01-01
      • 2021-09-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多