For various reasons/limitations I cannot make new groups in the inventory file and need to use --limit/-l
to specify the hosts.
I was told to do something like:
ansible-playbook -i /path/to/my/inventory/file.ini -l server.1.com server.2.com my-playbook.yml --check --diff
This was throwing an error:
ERROR! the playbook: server.2.com could not be found
From the Ansible Documentation on this subject I found that you could use a separate file to list all the hosts you want to limit. Something like:
ansible-playbook -i /path/to/my/inventory/file.ini -l @list-to-limit.txt my-playbook.yml
However, I need to do it all inline without creating an additional file.