diff options
author | Michael Scherer <misc@mageia.org> | 2012-03-20 17:42:17 +0000 |
---|---|---|
committer | Michael Scherer <misc@mageia.org> | 2012-03-20 17:42:17 +0000 |
commit | 336d58d819d1c69835ac8c5f796c9812337e1f57 (patch) | |
tree | b9d3b3d3dd509cb08dab436a828a1dcb706ea2f5 /modules | |
parent | d906357d729d7e74ae9aad796db8b1d11ee86ffe (diff) | |
download | puppet-336d58d819d1c69835ac8c5f796c9812337e1f57.tar puppet-336d58d819d1c69835ac8c5f796c9812337e1f57.tar.gz puppet-336d58d819d1c69835ac8c5f796c9812337e1f57.tar.bz2 puppet-336d58d819d1c69835ac8c5f796c9812337e1f57.tar.xz puppet-336d58d819d1c69835ac8c5f796c9812337e1f57.zip |
module style cleaning
Diffstat (limited to 'modules')
-rw-r--r-- | modules/libvirtd/manifests/init.pp | 55 |
1 files changed, 31 insertions, 24 deletions
diff --git a/modules/libvirtd/manifests/init.pp b/modules/libvirtd/manifests/init.pp index d73fed1c..7dcf5fc4 100644 --- a/modules/libvirtd/manifests/init.pp +++ b/modules/libvirtd/manifests/init.pp @@ -5,35 +5,42 @@ class libvirtd { # netcat-openbsd -> for ssh remote access # iptables -> for dhcp, message error was quite puzzling # python-* => needed for helper script - package { ["libvirt-utils","dnsmasq-base","netcat-openbsd","iptables","python-libvirt","python-IPy"]: + package {['libvirt-utils', + 'dnsmasq-base', + 'netcat-openbsd', + 'iptables', + 'python-libvirt', + 'python-IPy']: + } - service { libvirtd: + service { 'libvirtd': require => Package['libvirt-utils'], } #TODO remove once libvirt package is fixed to manage the directory - file { ["/etc/libvirt/storage","/etc/libvirt/storage/autostart"]: - ensure => directory, + file { ['/etc/libvirt/storage', + '/etc/libvirt/storage/autostart']: + ensure => directory, require => Package['libvirt-utils'], } - file { "/usr/local/bin/storage_add.py": - mode => 755, - source => "puppet:///modules/libvirtd/storage_add.py", + file { '/usr/local/bin/storage_add.py': + mode => '0755', + source => 'puppet:///modules/libvirtd/storage_add.py', } - - file { "/usr/local/bin/network_add.py": - mode => 755, - source => "puppet:///modules/libvirtd/network_add.py", + + file { '/usr/local/bin/network_add.py': + mode => '0755', + source => 'puppet:///modules/libvirtd/network_add.py', } } class kvm inherits base { # pull cyrus-sasl, should be checked - package { "qemu": } - + package { 'qemu': } + } # see http://wiki.libvirt.org/page/SSHPolicyKitSetup @@ -41,7 +48,7 @@ class libvirtd { # to pull polkit and create the directory include libvirtd::base file { "/etc/polkit-1/localauthority/50-local.d/50-$name-libvirt-remote-access.pkla": - content => template("libvirtd/50-template-libvirt-remote-access.pkla"), + content => template('libvirtd/50-template-libvirt-remote-access.pkla'), require => Package['libvirt-utils'], } } @@ -52,14 +59,14 @@ class libvirtd { 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"] ] + Package['python-libvirt'] ] } #TODO use API of libvirt file { "/etc/libvirt/storage/autostart/$name.xml": ensure => $autostart ? { - true => "/etc/libvirt/storage/$name.xml", - false => "absent" + true => "/etc/libvirt/storage/$name.xml", + false => absent }, require => Package['libvirt-utils'], } @@ -70,18 +77,18 @@ class libvirtd { $forward_dev = 'eth0', $network = '192.168.122.0/24', $tftp_root = '', - $disable_pxe = '', - $autostart = true, + $disable_pxe = '', + $autostart = true, $vm_type = 'qemu') { - exec { "/usr/local/bin/network_add.py": + 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\""], - + "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"] ] @@ -90,8 +97,8 @@ class libvirtd { #TODO use API of libvirt file { "/etc/libvirt/$vm_type/networks/autostart/$name.xml": ensure => $autostart ? { - true => "/etc/libvirt/$vm_type/networks/$name.xml", - false => "absent" + true => "/etc/libvirt/$vm_type/networks/$name.xml", + false => absent }, require => Package['libvirt-utils'], } |