Joaquim d'Souza
Joaquim d'Souza

Reputation: 1516

Ansible: set ssh arguments using group variables

To connect to different groups of hosts, I need to use different ssh config files. I'm currently trying to connect to both groups in the same playbook, but I can't figure out how to change ssh_args within the playbook. I was wondering if I could use group_vars to do this?

The way I currently set ssh_args is in ansible.cfg:

[ssh_connection]
ssh_args = -F ./ssh.cfg

Upvotes: 4

Views: 4563

Answers (1)

Konstantin Suvorov
Konstantin Suvorov

Reputation: 68229

Yes, but you should use ansible_ssh_common_args, see List of Behavioral Inventory Parameters.

Upvotes: 2

Related Questions