# XML parsing(?) issue with virt\_net module?

**URL:** <https://forum.ansible.com/t/xml-parsing-issue-with-virt-net-module/33779>\
**Category:** Ansible Project\
**Created:** [September 9, 2020, 7:30pm UTC](https://forum.ansible.com/t/xml-parsing-issue-with-virt-net-module/33779 "2020-09-09T19:30:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ian\_Pilcher](https://avatars.discourse-cdn.com/v4/letter/i/ecccb3/32.png) [@Ian\_Pilcher](https://forum.ansible.com/u/Ian_Pilcher)\
**Post date:** [September 9, 2020, 7:30pm UTC](https://forum.ansible.com/t/xml-parsing-issue-with-virt-net-module/33779/1 "2020-09-09T19:30:58Z")

</div>

This is probably a stupid/n00b question, but I'm at my wit's end trying  
to figure this out.

I'm trying to use the virt\_net module to create a libvirt network. The  
task looks like this (apologies for the long line).

&nbsp;&nbsp;&nbsp;- name: create external network  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;virt\_net:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;command: define  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name: external  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xml: "\<network\>\<name='external'/\>\<bridge name='br-ext' stp='off'/\>\<forward mode='nat'/\>\<ip address='192.168.122.254' prefix='24'/\>\</network\>"

This is giving me this error:

"msg": "(network\_definition):1: error parsing attribute name\n\<network\>\<name='external'/\>\<bridge name='br-ext' stp='off'/\>\<forward mode='nat'/\>\<ip address='192.168.122.254' prefix='24'/\>\</network\>\n--------------^"

Cany anyone point me to a hint as to what's going on?

---

<div class="post-metadata">

**Author:** ![Ian\_Pilcher](https://avatars.discourse-cdn.com/v4/letter/i/ecccb3/32.png) [@Ian\_Pilcher](https://forum.ansible.com/u/Ian_Pilcher)\
**Post date:** [September 9, 2020, 8:50pm UTC](https://forum.ansible.com/t/xml-parsing-issue-with-virt-net-module/33779/2 "2020-09-09T20:50:45Z")

</div>

Aargh! It was an error in my XML.

\<name='external/\> isn't proper XML, it should be:

&nbsp;&nbsp;&nbsp;\<name\>external\</name\>
