【发布时间】:2018-11-04 16:32:20
【问题描述】:
在 Ansible 2.4.2.0 中,我可以在命令行中使用 ansible_ssh_private_key_file 覆盖清单中设置的 SSH 密钥吗?在此问题上报告的--private-key 选项是不可能的:Command-line flags (variable weight) not respected (bug or a feature?)
库存文件:
[group1]
instance1 ansible_host=host1 ansible_user=user1 ansible_ssh_private_key_file=~/.ssh/user1host1-id_rsa
命令行:
ansible-playbook playbook1.yml --private-key=some_other-id_rsa
【问题讨论】:
-
您链接的主题中有答案。
标签: ssh ansible ssh-keys ansible-inventory