I do not wish to specify any hosts file to ansible-playbook command.
ansible-playbook site.yml -e "source_host=mymac1 source_file=myfile1"
My site.yml looks like this:
more site.yml
---
- hosts: "{{ source_host | default('my_pc')}}"
user: weblogic
However, I get the following error:
[WARNING]: Could not match supplied host pattern, ignoring: all
[WARNING]: provided hosts list is empty, only localhost is available
PLAYBOOK: site.yml ********************************************************************************************************************************************************************************** 2 plays in site.yml [WARNING]: Could not match supplied host pattern, ignoring: mymac1
Can you please suggest how can i pass any host to my playbook without having to maintain and host respository with all the host information
I am on ansible version 2.3.1.0