在 Ansible 2.4.2.0 中,我可以使用ansible_ssh_private_key_file
命令行覆盖清单中设置的 SSH 密钥吗?--private-key
在此问题上报告的选项是不可能的:未考虑命令行标志(可变权重)(错误或功能?)
库存文件:
[group1]
instance1 ansible_host=host1 ansible_user=user1 ansible_ssh_private_key_file=~/.ssh/user1host1-id_rsa
Run Code Online (Sandbox Code Playgroud)
命令行:
ansible-playbook playbook1.yml --private-key=some_other-id_rsa
Run Code Online (Sandbox Code Playgroud)