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:
Below is my example for connecting with different ssh port using ansible-playbook.
--- - hosts: test-server vars: ansible_ssh_user: 'rohit' ansible_password: '123456' ansible_port: '2222' tasks: - name: "print simple command" command: cat /usr/bin/myscript.sh