Skip to content

Instantly share code, notes, and snippets.

@yv84
Last active February 26, 2019 05:23
Show Gist options
  • Save yv84/4172baa0e80a72011389137e0645a84b to your computer and use it in GitHub Desktop.
Save yv84/4172baa0e80a72011389137e0645a84b to your computer and use it in GitHub Desktop.
yv84@yv84_u1:~/ansible$ cat ansible.cfg
[defaults]
host_key_checking = False
inventory=inventory.ini
yv84@yv84_u1:~/ansible$ cat hosts
[servers]
192.168.100.151 yv84=192.168.100.151
yv84@yv84_u1:~/ansible$ cat inventory.ini
[s151]
ansible-target ansible_ssh_host=192.168.100.151 ansible_user=yv84 ansible_ssh_pass=password
yv84@yv84_u1:~/ansible/book_up_and_running$ ansible servers -m ping -vvv -i ./hosts --ask-pass --ask-become-pass -e 'ansible_python_interpreter=/usr/bin/python3'
192.168.100.151 | SUCCESS => {
"changed": false,
"invocation": {
"module_args": {
"data": "pong"
}
},
"ping": "pong"
}
yv84@yv84_u1:~/ansible/book_up_and_running$ ansible --list-host all
hosts (1):
192.168.100.151
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment