# Creating a network with libvirt

**URL:** <https://forum.ansible.com/t/creating-a-network-with-libvirt/14351>\
**Category:** Ansible Project\
**Created:** [January 15, 2014, 6:05pm UTC](https://forum.ansible.com/t/creating-a-network-with-libvirt/14351 "2014-01-15T18:05:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew\_Martin](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@Andrew\_Martin](https://forum.ansible.com/u/Andrew_Martin)\
**Post date:** [January 15, 2014, 6:05pm UTC](https://forum.ansible.com/t/creating-a-network-with-libvirt/14351/1 "2014-01-15T18:05:02Z")

</div>

Hello,

As part of a playbook I’m writing for creating a KVM virtualization server, I’d also like to create a new virtual network for VMs to use. The commands I would normally run to do this are:  
virsh net-define /path/to/mynetwork-config.xml

virsh net-autostart mynetwork  
virsh net-start mynetwork

Is there a way that I can run these commands with the virt Ansible module? It says that it can support other libvirt commands, but I am unsure how to execute them?

Thanks,

Andrew

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [January 15, 2014, 6:44pm UTC](https://forum.ansible.com/t/creating-a-network-with-libvirt/14351/2 "2014-01-15T18:44:11Z")

</div>

No, the virt ansible module originated from code in Func long ago and is pretty basic. It predates libvirt’s configuration of networking, storage, thermostats, and ability to facetweet to instatube.

I’d welcome additions however, though I’d question if maybe it needs to be in a ‘libvirt\_network’ module to keep the arguments from intermixing.

---

<div class="post-metadata">

**Author:** ![Andrew\_Martin](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@Andrew\_Martin](https://forum.ansible.com/u/Andrew_Martin)\
**Post date:** [January 15, 2014, 8:04pm UTC](https://forum.ansible.com/t/creating-a-network-with-libvirt/14351/3 "2014-01-15T20:04:01Z")

</div>

Okay, thanks for the clarification!
