You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While we can specify what hosts to run the command through ansible command-line program, it's does not apply to ansible-playbook program. We always need to specify the hosts: attribute in our YAML playbook.
That is not in fact true. Consider this playbook, which simply runs the ping module:
- hosts: all
tasks:
- ping:
If we have this in playbook.yml we can run it on localhost like this:
In https://github.com/k4ml/importerror/blob/master/posts/ansible-playbook-specify-hosts-on-the-command-line.md, you say:
That is not in fact true. Consider this playbook, which simply runs the
ping
module:If we have this in
playbook.yml
we can run it onlocalhost
like this:Or on
hosta.example.com
like this:That is in fact pretty much the same syntax as the
ansible
ad-hoc command.The text was updated successfully, but these errors were encountered: