XML parsing(?) issue with virt_net module?

17 views
Skip to first unread message

Ian Pilcher

unread,
Sep 9, 2020, 4:25:24 PM9/9/20
to ansible...@googlegroups.com
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).

- name: create external network
virt_net:
command: define
name: external
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?

--
========================================================================
In Soviet Russia, Google searches you!
========================================================================

Ian Pilcher

unread,
Sep 9, 2020, 4:51:11 PM9/9/20
to ansible...@googlegroups.com
On 9/9/20 2:30 PM, Ian Pilcher wrote:
>   - name: create external network
>     virt_net:
>       command: define
>       name: external
>       xml: "<network><name='external'/><bridge name='br-ext'
> stp='off'/><forward mode='nat'/><ip address='192.168.122.254'
> prefix='24'/></network>"

Aargh! It was an error in my XML.

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

<name>external</name>
Reply all
Reply to author
Forward
0 new messages