4d30798f54051e93003ba2e25a151bac483d670e
This commit adds a new `--group` argument to the `newvm` script, which adds the host to an Ansible group by listing it in the _libvirt_ domain metadata. Multiple groups can be specified by repeating the argument. Additionally, the VM title is now always set to machine's FQDN, which is what the dynamic inventory plugin uses to determine the inventory hostname. The dynamic inventory plugin parses the _libvirt_ domain metadata and extracts group membership from the `<dch:groups>` XML element. Each `<dch:group>` sub-element specifies a group to which the host belongs. Unfortunately, `virt-install` does not support modifying the `<metadata>` element in the _libvirt_ domain XML document, so we have to resort to using `virsh`. To ensure the metadata are set before the guest OS boots and tries to access them, we fork and run `virsh` in a separate process.
Description
Ansible configuration policy for the private network/home lab of Dustin C. Hatch
http://dustin.hatch.name/
Languages
Jinja
86.2%
Python
6.6%
Shell
4.6%
Groovy
2.6%