August 2017
Intermediate to advanced
332 pages
9h 16m
English
The simplest command we can run is a ping on all servers.
$ ansible all -m pingweb1 | SUCCESS => { "changed": false, "ping": "pong"}web2 | SUCCESS => { "changed": false, "ping": "pong"}
We used the -m <module_name> option, which allows specifying the module that should be executed on the remote hosts. The result is successful, which means that the servers are reachable and the authentication is configured correctly.
Note that we used all, so that all servers would be addressed, but we could also call them by the group name webservers or by the single host alias. As a second example, let's execute a shell command ...
Read now
Unlock full access