On 01. aug. 2017 19:42, je...@soundhound.com wrote:
Here's the situation I need it for:
I have my ansible machine as my dhcp server as well. When I add a new
network device, the role for the device generate a dhcp line with ansible
for zero touch provisioning. I do this by first going a set_fact
lookup_template to get the line to add to the dhcp file, then I do
lineinfile to make sure that this is the only line in this file with a
given mac address.

I run this in a role for all the devices in a class. I don't want to use
serial: 1 in the calling playbook as there are many other steps that want
to run in parallel including interactions with the device. The
run_once/with_items hack doesn't work because they are all going to the
same system.

Viable workarounds could be to split it in multiple plays in the playbook, then you can use serial: 1 on some.

Or use the assemble module,

create a drop directory where you add all the files and then assemble it to one dhcpd.conf file with the assemble module.

--
Kai Stian Olstad

--
You received this message because you are subscribed to the Google Groups "Ansible 
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/4c64a4b1-51b0-d295-7756-2d7054b10390%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to