Ansible change ssh port in playbook

后端 未结 8 563
不思量自难忘°
不思量自难忘° 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:53

    Easy way, edit /etc/ansible/hosts:

    [my_server]
    ssdnodes:54321
    

    and you can test it by issuing a ping:

    ansible ssdnodes -m ping
    

    and the response would be:

    ssdnodes | SUCCESS => {
        "changed": false,
        "ping": "pong"
    }
    

提交回复
热议问题