I have this sample inventory file:
[web1] // Web Server 1 contains the following sites:
example1.com
example2.com
[web2] // Web Server 2 contains the following sites:
example3.com
example4.com
But whenever I run a playbook for example with apt-get update
command it tries to iterate through all the sites in the given web servers above.
How do I run the playbook in the host itself and not the example*.com sites because it's redundant.
EDIT
As requested here's the yaml file: (nothing fancy here.)
# Using all but --limit the execution to webservers
# I know I can use `webservers` but this was deliberate
- hosts: all
tasks:
- // sudo apt-get update