I am trying to create xml file with yaml playbook. XML should looks like this:
<accessControl>
<ipRanges>
<ipRange>
<ip>
<int>00</int>
<int>00</int>
<int>00</int>
<int>000</int>
</ip>
<mask>
<int>255</int>
<int>255</int>
<int>255</int>
<int>0</int>
</mask>
</ipRange>
<null/>
</ipRanges>
</accessControl>
I have no idea how to create ansible task providing multiple identical tags (< int >). I am looking for something loop like or there is another way?
Edit: I.E I have XML like this:
<accessControl>
<ipRanges>
<ipRange>
</ipRange>
<null/>
</ipRanges>
</accessControl>
And I need to add IP and MASK into tag to achieve:
<accessControl>
<ipRanges>
<ipRange>
<ip>
<int>127</int>
<int>0</int>
<int>0</int>
<int>1</int>
</ip>
<mask>
<int>255</int>
<int>255</int>
<int>255</int>
<int>0</int>
</mask>
</ipRange>
<null/>
</ipRanges>
</accessControl>
I can provide IP and Mask in list, dict, tuple - it does not matter. For a sake of this question lets say it will be like this: ['127.0.0.1', '255.255.255.0']