From 91d4084fb231126f0604ea049f3d79d22332fd5b Mon Sep 17 00:00:00 2001 From: Thomas Backlund Date: Tue, 20 Oct 2015 00:57:37 +0300 Subject: lint fixes for libvirtd --- modules/libvirtd/manifests/init.pp | 41 +++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 21 deletions(-) (limited to 'modules/libvirtd/manifests') diff --git a/modules/libvirtd/manifests/init.pp b/modules/libvirtd/manifests/init.pp index 8163010d..46b60d3a 100644 --- a/modules/libvirtd/manifests/init.pp +++ b/modules/libvirtd/manifests/init.pp @@ -40,14 +40,13 @@ class libvirtd { class kvm inherits base { # pull cyrus-sasl, should be checked package { 'qemu': } - } # see http://wiki.libvirt.org/page/SSHPolicyKitSetup define group_access() { # to pull polkit and create the directory include libvirtd::base - file { "/etc/polkit-1/localauthority/50-local.d/50-$name-libvirt-remote-access.pkla": + file { "/etc/polkit-1/localauthority/50-local.d/50-${name}-libvirt-remote-access.pkla": content => template('libvirtd/50-template-libvirt-remote-access.pkla'), require => Package['libvirt-utils'], } @@ -55,23 +54,23 @@ class libvirtd { file { '/dev/kvm': group => $name, owner => 'root', - mode => 660, + mode => '0660', } } define storage($path, $autostart = true) { include libvirtd::base - exec { "/usr/local/bin/storage_add.py $name $path": - creates => "/etc/libvirt/storage/$name.xml", + exec { "/usr/local/bin/storage_add.py ${name} ${path}": + creates => "/etc/libvirt/storage/${name}.xml", require => [File['/usr/local/bin/storage_add.py'], Package['python-libvirt'] ] } #TODO use API of libvirt - file { "/etc/libvirt/storage/autostart/$name.xml": - ensure => $autostart ? { - true => "/etc/libvirt/storage/$name.xml", + file { "/etc/libvirt/storage/autostart/${name}.xml": + ensure => $autostart ? { + true => "/etc/libvirt/storage/${name}.xml", false => absent }, require => Package['libvirt-utils'], @@ -88,22 +87,22 @@ class libvirtd { $vm_type = 'qemu') { exec { '/usr/local/bin/network_add.py': - environment => ["BRIDGE_NAME=$bridge_name", - "FORWARD=$forward", - "FORWARD_DEV=$forward_dev", - "NETWORK=$network", - "TFTP_ROOT=$tftp_root", - "DISABLE_PXE=\"$disable_pxe\""], - - creates => "/etc/libvirt/$vm_type/networks/$name.xml", - require => [File['/usr/local/bin/network_add.py'], - Package['python-IPy'], Package["python-libvirt"] ] + environment => ["BRIDGE_NAME=${bridge_name}", + "FORWARD=${forward}", + "FORWARD_DEV=${forward_dev}", + "NETWORK=${network}", + "TFTP_ROOT=${tftp_root}", + "DISABLE_PXE=\"${disable_pxe}\""], + + creates => "/etc/libvirt/${vm_type}/networks/${name}.xml", + require => [File['/usr/local/bin/network_add.py'], + Package['python-IPy'], Package['python-libvirt'] ] } #TODO use API of libvirt - file { "/etc/libvirt/$vm_type/networks/autostart/$name.xml": - ensure => $autostart ? { - true => "/etc/libvirt/$vm_type/networks/$name.xml", + file { "/etc/libvirt/${vm_type}/networks/autostart/${name}.xml": + ensure => $autostart ? { + true => "/etc/libvirt/${vm_type}/networks/${name}.xml", false => absent }, require => Package['libvirt-utils'], -- cgit v1.2.1