Ansible 使用自定义 ssh 配置文件 [英] Ansible Using Custom ssh config File

查看:45
本文介绍了Ansible 使用自定义 ssh 配置文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个自定义的 SSH 配置文件,我通常使用如下

I have a custom SSH config file that I typically use as follows

ssh -F ~/.ssh/client_1_config amazon-server-01

是否可以指定 Ansible 为某些组使用此配置?它已经设置了所有的密钥、端口和用户.我有多个客户端的这种配置,如果可能的话,我希望将配置分开.

Is it possible to assign Ansible to use this config for certain groups? It already has the keys and ports and users all set up. I have this sort of config for multiple clients, and would like to keep the config separate if possible.

推荐答案

并非完全可能.您可以在 ansible.cfg 中设置 ssh 参数:

Not fully possible. You can set ssh arguments in the ansible.cfg:

[ssh_connection]
ssh_args = -F ~/.ssh/client_1_config amazon-server-01

遗憾的是,无法按组、库存或其他任何特定内容定义此内容.

Unfortunately it is not possible to define this per group, inventory or anything else specific.

这篇关于Ansible 使用自定义 ssh 配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆