Hi ! I would like to use a variable value for the playbook "hosts" clause, eg.:
- name: PLAY_NAME
hosts: "{{myvariable}}"
sudo: yes
tasks:
.........
where the variable is defined elsewhere as eg.:
myvariable: "*1.domain*.com"
or:
myvariable: "group1:group2:group3"
However, when I attempt something like this, I always get the "skipping: no hosts matched" message when running the playbook (even if I put myvariable: "
exact.host.name").
Is it at all possible to use a variable here? Putting the pattern itself to every playbook is extremely unDRY, and driving me nuts.