Ansible change ssh port in playbook

后端 未结 8 576
不思量自难忘°
不思量自难忘° 2020-12-25 11:16

Here is the inventory file

---
[de-servers]
192.26.32.32

[uk-servers]
172.21.1.23
172.32.2.11

and my playbook is look like this:



        
8条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-25 11:48

    I would suggest to put the port number on the inventory file. Like the following example.

    [linux-servers]
    xcpng5.homelab.com ansible_port=3511
    xcpng2.homelab.com ansible_port=3522
    xcpng1.homelab.com ansible_port=3523
    

    I was trying to achieve the same and that helped me to set up different ssh port.

提交回复
热议问题