Add config template for qemu.conf

Currently, qemu.conf is not tunable by OSA.  However, the default
config file for qemu.conf is typically all comments and is
not frequently overwritten.

This patch enables deployers to deploy a custom /etc/libvirt/qemu.conf
config file by defining a dictionary qemu_conf_dict.

config_template plugin is not used because the qemu.conf file does
not have sections, thus putting values in [DEFAULT] is untested.

Change-Id: I780951ef466d1a82168f1f787abf58aebfe95889
This commit is contained in:
Michael Gugino 2016-09-02 14:51:10 -04:00
parent 283fb734b6
commit a8b3c81942
4 changed files with 25 additions and 0 deletions

View File

@ -415,6 +415,10 @@ nova_compute_lxd_pip_packages:
nova_qemu_user: libvirt-qemu
nova_qemu_group: kvm
# Define the following variable to drop a replacement
# file for /etc/libvirt/qemu.conf
#qemu_conf_dict: {}
# This variable is used by the repo_build process to determine
# which host group to check for members of before building the
# pip packages required by this role. The value is picked up

View File

@ -0,0 +1,4 @@
---
features:
- The os_nova role can now deploy the a custom
/etc/libvirt/qemu.conf file by defining ``qemu_conf_dict``.

View File

@ -40,6 +40,19 @@
- nova-kvm
- nova-libvirt
- name: Set qemu config
template:
src: "qemu.conf.j2"
dest: "/etc/libvirt/qemu.conf"
owner: "root"
group: "root"
mode: "0600"
when: qemu_conf_dict is defined
notify: Restart libvirt-bin
tags:
- nova-kvm
- nova-libvirt
- name: Set libvirt runtime options
lineinfile:
dest: "/etc/default/libvirt-bin"

4
templates/qemu.conf.j2 Normal file
View File

@ -0,0 +1,4 @@
# {{ ansible_managed }}
{% for key, value in qemu_conf_dict.iteritems() %}
{{ key }} = {{ value }}
{% endfor %}