在线上的环境中,服务端的ssh会有进行变更的情况

例如:有些服务器的ssh端口号是 34567 等情况,那么该如何配置呢?

编辑 /etc/ansible/hosts

[servers]
192.168.0.11 ansible_ssh_user=root ansible_ssh_port=34567
192.168.0.12 ansible_ssh_user=root ansible_ssh_port=34567

 

配置完毕后,照常执行ansible命令即可,示例如下:

ansible servers -m shell -a "df -h | grep dev"

 

 

相关文章:

  • 2021-05-29
  • 2022-12-23
  • 2022-12-23
  • 2022-01-29
  • 2022-12-23
  • 2021-08-09
  • 2022-01-31
  • 2021-12-09
猜你喜欢
  • 2021-12-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-09
  • 2021-12-05
相关资源
相似解决方案