Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pass configuration hashes for libvirth and quemu #50

Open
igalic opened this issue May 4, 2015 · 2 comments
Open

pass configuration hashes for libvirth and quemu #50

igalic opened this issue May 4, 2015 · 2 comments

Comments

@igalic
Copy link
Contributor

igalic commented May 4, 2015

it would be /way/ more convenient to pass two (four?) hashes to configure libvirtd, quemu, and their defaults (sysconfig) files.

This could be in a backwards compatible, or incompatible way, depending on our choosing / effort ;)

@antaflos
Copy link

Yeah, a much more flexible way to go about configuring Libvirtd, Qemu and others would be to model their configurations as Puppet hashes, i.e. key-value pairs that the respective template then processes.

Example for the libvirt::libvirtd_config parameter (which by default is an empty hash):

# /etc/libvirt/libvirtd.conf - This configuration file is managed by Puppet, do not edit.

<%- @libvirtd_config.sort.map do |param,val|-%>
<%= param %> = <%= val %>
<%- end -%>

The same pattern can be used for Debian's /etc/default/libvirt-bin or RHEL's sysconfig:

# Defaults for libvirt-bin initscript (/etc/init.d/libvirt-bin)
# This is a POSIX shell fragment

<%- @debian_defaults.sort.map do |variable,val|-%>
<%= variable %>="<%= val %>"
<%- end -%>

As for backwards-compatibility: we could check if, e.g., the libvirtd_config hash parameter in question is empty, and only if it is not empty process it and ignore all other class parameters pertaining to the Libvirt configuration (such as listen_tls, auth_tcp and so on).

Thoughts?

@igalic
Copy link
Contributor Author

igalic commented May 21, 2015

working on this right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants