【发布时间】:2018-10-13 18:02:10
【问题描述】:
我想使用 Ansible 从远程服务器获取/下载文件。我可以使用fetch 或synchronize 模块,但它们不支持密码加密。 Ansible 是否可以下载加密形式的文件?
编辑:
看起来我无法很好地澄清我的问题(这个问题目前处于搁置状态)。
我想从远程计算机下载 conf 文件。我可以通过以下两种方式之一下载它们,fetch 或 synchronize 模块,如下所示:
- 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