Hi All,
I have the following template :
# web_cconfig.j2 :
web_servers={% for host in groups[‘web’] %} {{ host }}, {% endfor %}
This file is deployed in a role and using the server list from the inventory web group and working OK, the problem is when there are cases I need to use the same role but without specifying an inventory file , as for example when launching a new ec2 instacne and using using add_host module to configure this will throw an error the web group was not found…
Is it possible to manually set a inventory host var so I can use the same playbook ?