【发布时间】:2020-01-07 09:00:08
【问题描述】:
我正在观察 ansible git 模块在使用以下模块时正在存储凭据(uname/pwd) 如何解决这个问题?请指教
- name: pull v016 repo from git
git: repo=https://{{ githubuser }}:{{ githubpassword|urlencode }}@git.abc.com/abc/abc.git
dest=/tmp/test/abc
accept_hostkey=yes
update=yes
clone=no
force=yes
remote=origin
version=20190524v016
我尝试使用 git-credential-cache 来避免以纯文本形式存储密码,但它没有按预期工作
作为权宜之计,我使用 git set-url 命令来避免其他人在运行 playbook 时遇到问题
【问题讨论】:
-
为什么不使用 SSH 密钥对和 SSH URL?
-
您好,感谢您的建议,根据我收集的阅读文档,要使用 ssh 密钥对和 URL,有先决条件,例如,要在远程系统上启用 ssh 代理转发,这可能并不容易检查和配置如果我错了请纠正我!