Several non-standard ssh ports

16 views
Skip to first unread message

igor haase

unread,
Feb 17, 2022, 3:29:23 AM2/17/22
to Ansible Development
Hello everyone,
I am new in ansible. Therefore I have a question about editing the ansible.cfg.
I am running a couple of server on different non-standard ssh ports e.g.
55500 55008 55012 etc.

How can I configure that in the ansible.cfg? I already tried with seperated ,

Thanks in advance

Igor

Irwan Shofwan

unread,
Feb 17, 2022, 5:26:17 AM2/17/22
to Ansible Development
It's better to specify host port for each host in your inventory or you can grouping host by port number

Andreas Härpfer

unread,
Feb 17, 2022, 5:32:06 AM2/17/22
to igor haase, Ansible Development
Hi Igor, non-standard SSH ports typically go into the inventory,
not into ansible.cfg.

You can do either

[somegroup]
somehost:2222

or

[somegroup]
somehost ansible_port=2222

See

https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html#assigning-a-variable-to-one-machine-host-variables

for more details.

Cheers
-Andi

Ted Kent

unread,
Feb 22, 2022, 10:30:45 AM2/22/22
to igor haase, Ansible Development
I would recommend looking into the inventory file. 

--
You received this message because you are subscribed to the Google Groups "Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-deve...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-devel/0059a03a-d422-421b-91ae-8ba8e7c08c81n%40googlegroups.com.


--
Ted Kent
Reply all
Reply to author
Forward
0 new messages