I'd like to generate a bunch of /etc/bind9/zone.d/${zone_name}.zone files. These files ought either come from a _stock.zone template, or, if available, a ${zone_name}.zone file.
At present this ansible-playbook with-first.pb
gives ERROR: with_(plugin), and first_available_file are mutually incompatible in a single task
. This result is in accord with ansible/ansible#552 , Make with_items and first_available_file usable together or otherwise warn
, which this script attempts to do.
with_item and first_available_file both collide with the
For backwards compatibility sake, ${item} can continue to be set by first_available_file in all cases where with_{plugin} is not used.
Alas movement appears to be towards further overriding the use of ${item} to make it do more, not separate out the distinct contextual uses of first_available_file (which operates WITHIN an iteration of a module being looped through via with_{plugin}) and with_{plugin}, which triggers this outtermost looping iteration. ansible/ansible#2260