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

查看:209
本文介绍了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 :

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天全站免登陆