running an Ansible playbook against a single host

Question:

I’m using a hosts file for static inventory:

And I’ve got a playbook example.yml like this:

I’d like to an ansible-playbook test run using example.yml, but only against the host server1. Is there a way of doing this?

Answer:

Well I finished writing this question, then my SO search-fu improved. Here are some answers:

Using -l SUBSET:

Using -i "hostname,":

Leave a Reply