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.
you can put the variable in the groups_vars/all file, it just won't be
evaluated for the - hosts: entry, the play needs to know which hosts
it targets before using the inventory variables.