diff options
author | Thomas Backlund <tmb@mageia.org> | 2015-10-20 00:57:37 +0300 |
---|---|---|
committer | Thomas Backlund <tmb@mageia.org> | 2015-10-20 00:57:37 +0300 |
commit | 91d4084fb231126f0604ea049f3d79d22332fd5b (patch) | |
tree | 6b9eae02c0fea64cfd44c89e58eb3214e4138fa3 /modules | |
parent | 8baadde40d126419e08b4ece63aba11cbac90182 (diff) | |
download | puppet-91d4084fb231126f0604ea049f3d79d22332fd5b.tar puppet-91d4084fb231126f0604ea049f3d79d22332fd5b.tar.gz puppet-91d4084fb231126f0604ea049f3d79d22332fd5b.tar.bz2 puppet-91d4084fb231126f0604ea049f3d79d22332fd5b.tar.xz puppet-91d4084fb231126f0604ea049f3d79d22332fd5b.zip |
lint fixes for libvirtd
Diffstat (limited to 'modules')
-rw-r--r-- | modules/libvirtd/files/network_add.py | 3 | ||||
-rw-r--r-- | modules/libvirtd/files/storage_add.py | 1 | ||||
-rw-r--r-- | modules/libvirtd/manifests/init.pp | 41 |
3 files changed, 21 insertions, 24 deletions
diff --git a/modules/libvirtd/files/network_add.py b/modules/libvirtd/files/network_add.py index ab40bf0e..a7382351 100644 --- a/modules/libvirtd/files/network_add.py +++ b/modules/libvirtd/files/network_add.py @@ -3,7 +3,7 @@ import libvirt import os import IPy -# bridge_name +# bridge_name # forward -> nat/ route # forward-dev @@ -59,4 +59,3 @@ network_xml = """ c=libvirt.open("qemu:///system") c.networkDefineXML(network_xml) - diff --git a/modules/libvirtd/files/storage_add.py b/modules/libvirtd/files/storage_add.py index 5d95922d..c53b16bd 100644 --- a/modules/libvirtd/files/storage_add.py +++ b/modules/libvirtd/files/storage_add.py @@ -25,4 +25,3 @@ storage_xml = """ c=libvirt.open("qemu:///system") c.storagePoolDefineXML(storage_xml,0) - 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'], |