📜  不同端口上的 ansible ssh - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:50:55.007000             🧑  作者: Mango

代码示例3
#The only thing I can think of that might work would be to create ssh aliases for your hosts. In your .ssh/config:

Host de.1.before
  HostName 192.26.32.32
  Port 22

Host de.1.after
  HostName 192.26.32.32
  Port 8888

#Then use these aliases in your Ansible inventory:

[de-servers-before]
de.1.before

[de-servers-after]
de.1.after