Andrew Bogott has submitted this change and it was merged.

Change subject: nova: lint compute.pp
......................................................................


nova: lint compute.pp

Change-Id: I217c7bbe3a277a2422966bfd3313990511153730
---
M modules/openstack/manifests/nova/compute.pp
1 file changed, 89 insertions(+), 75 deletions(-)

Approvals:
  Andrew Bogott: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/openstack/manifests/nova/compute.pp 
b/modules/openstack/manifests/nova/compute.pp
index 02b2656..f2e687b 100644
--- a/modules/openstack/manifests/nova/compute.pp
+++ b/modules/openstack/manifests/nova/compute.pp
@@ -1,117 +1,131 @@
-class openstack::nova::compute($openstack_version=$::openstack::version, 
$novaconfig) {
+class openstack::nova::compute(
+    $openstack_version=$::openstack::version,
+    $novaconfig
+){
     include openstack::repo
 
-    if ( $::realm == "production" ) {
+    if ( $::realm == 'production' ) {
         $certname = "virt-star.${site}.wmnet"
         install_certificate{ "${certname}": }
 
-        file {
-            "/var/lib/nova/${certname}.key":
-                owner   => 'nova',
-                group   => 'libvirtd',
-                mode    => '0440',
-                source  => "puppet:///private/ssl/${certname}.key",
-                require => Package['nova-common'];
-            "/var/lib/nova/clientkey.pem":
-                ensure  => link,
-                target  => "/var/lib/nova/${certname}.key";
-            "/var/lib/nova/clientcert.pem":
-                ensure  => link,
-                target  => "/etc/ssl/localcerts/${certname}.crt",
-                require => Install_certificate["${certname}"];
-            "/var/lib/nova/cacert.pem":
-                ensure  => link,
-                target  => "/etc/ssl/certs/wmf-ca.pem",
-                require => Install_certificate["${certname}"];
-            "/var/lib/nova/.ssh":
-                ensure  => directory,
-                owner   => 'nova',
-                group   => 'nova',
-                mode    => '0700',
-                require => Package["nova-common"];
-            "/var/lib/nova/.ssh/id_rsa":
-                source  => "puppet:///private/ssh/nova/nova.key",
-                owner   => 'nova',
-                group   => 'nova',
-                mode    => '0600',
-                require => File["/var/lib/nova/.ssh"];
-            "/var/lib/nova/.ssh/id_rsa.pub":
-                source  => "puppet:///private/ssh/nova/nova.pub",
-                owner   => 'nova',
-                group   => 'nova',
-                mode    => '0600',
-                require => File["/var/lib/nova/.ssh"];
-            "/etc/libvirt/libvirtd.conf":
-                notify  => Service["libvirt-bin"],
-                owner   => 'root',
-                group   => 'root',
-                mode    => '0444',
-                content => template("openstack/common/nova/libvirtd.conf.erb"),
-                require => Package["nova-common"];
-            "/etc/default/libvirt-bin":
-                notify  => Service["libvirt-bin"],
-                owner   => 'root',
-                group   => 'root',
-                mode    => '0444',
-                content => 
template("openstack/common/nova/libvirt-bin.default.erb"),
-                require => Package["nova-common"];
-            "/etc/nova/nova-compute.conf":
-                notify  => Service['nova-compute'],
-                owner   => 'root',
-                group   => 'root',
-                mode    => '0444',
-                content => 
template("openstack/common/nova/nova-compute.conf.erb"),
-                require => Package["nova-common"];
+        file { "/var/lib/nova/${certname}.key":
+            owner   => 'nova',
+            group   => 'libvirtd',
+            mode    => '0440',
+            source  => "puppet:///private/ssl/${certname}.key",
+            require => Package['nova-common'],
+        }
+        file { '/var/lib/nova/clientkey.pem':
+            ensure  => link,
+            target  => "/var/lib/nova/${certname}.key",
+        }
+        file { '/var/lib/nova/clientcert.pem':
+            ensure  => link,
+            target  => "/etc/ssl/localcerts/${certname}.crt",
+            require => Install_certificate["${certname}"],
+        }
+        file { '/var/lib/nova/cacert.pem':
+            ensure  => link,
+            target  => '/etc/ssl/certs/wmf-ca.pem',
+            require => Install_certificate["${certname}"],
+        }
+        file { '/var/lib/nova/.ssh':
+            ensure  => directory,
+            owner   => 'nova',
+            group   => 'nova',
+            mode    => '0700',
+            require => Package['nova-common'],
+        }
+        file { '/var/lib/nova/.ssh/id_rsa':
+            source  => 'puppet:///private/ssh/nova/nova.key',
+            owner   => 'nova',
+            group   => 'nova',
+            mode    => '0600',
+            require => File['/var/lib/nova/.ssh'],
+        }
+        file { '/var/lib/nova/.ssh/id_rsa.pub':
+            source  => 'puppet:///private/ssh/nova/nova.pub',
+            owner   => 'nova',
+            group   => 'nova',
+            mode    => '0600',
+            require => File['/var/lib/nova/.ssh'],
+        }
+        file { '/etc/libvirt/libvirtd.conf':
+            notify  => Service['libvirt-bin'],
+            owner   => 'root',
+            group   => 'root',
+            mode    => '0444',
+            content => template('openstack/common/nova/libvirtd.conf.erb'),
+            require => Package['nova-common'],
+        }
+        file { '/etc/default/libvirt-bin':
+            notify  => Service['libvirt-bin'],
+            owner   => 'root',
+            group   => 'root',
+            mode    => '0444',
+            content => 
template('openstack/common/nova/libvirt-bin.default.erb'),
+            require => Package['nova-common'],
+        }
+        file { '/etc/nova/nova-compute.conf':
+            notify  => Service['nova-compute'],
+            owner   => 'root',
+            group   => 'root',
+            mode    => '0444',
+            content => template('openstack/common/nova/nova-compute.conf.erb'),
+            require => Package['nova-common'],
         }
     }
 
     ssh::userkey { 'nova':
-        source  => "puppet:///private/ssh/nova/nova.pub",
+        source => 'puppet:///private/ssh/nova/nova.pub',
     }
 
-    service { "libvirt-bin":
+    service { 'libvirt-bin':
         ensure  => running,
         enable  => true,
-        require => Package["nova-common"];
+        require => Package['nova-common'],
     }
 
     package { [ 'nova-compute', 'nova-compute-kvm' ]:
         ensure  => present,
-        require => [Class["openstack::repo"], Package['qemu-system']];
+        require => [Class['openstack::repo'], Package['qemu-system']],
     }
 
     # Without qemu-system, apt will install qemu-kvm by default,
     # which is somewhat broken.
     package { 'qemu-system':
         ensure  => present,
-        require => Class["openstack::repo"];
+        require => Class['openstack::repo'],
     }
 
-    # qemu-kvm and qemu-system are alternative packages to meet the needs of 
libvirt.
-    #  Lately, Precise has been installing qemu-kvm by default.  That's 
different
+    # qemu-kvm and qemu-system are alternative packages to meet the needs of
+    # libvirt.
+    #  Lately, Precise has been installing qemu-kvm by default.  That's
+    #  different
     #  from our old, existing servers, and it also defaults to use spice for 
vms
     #  even though spice is not installed.  Messy.
     package { [ 'qemu-kvm' ]:
         ensure  => absent,
-        require => Package['qemu-system'];
+        require => Package['qemu-system'],
     }
 
-    # nova-compute adds the user with /bin/false, but resize, live migration, 
etc.
+    # nova-compute adds the user with /bin/false, but resize, live migration,
+    # etc.
     # need the nova use to have a real shell, as it uses ssh.
     user { 'nova':
         ensure  => present,
-        shell   => "/bin/bash",
-        require => Package["nova-common"];
+        shell   => '/bin/bash',
+        require => Package['nova-common'],
     }
 
     service { 'nova-compute':
         ensure    => running,
         subscribe => File['/etc/nova/nova.conf'],
-        require   => Package['nova-compute'];
+        require   => Package['nova-compute'],
     }
 
-    file { "/etc/libvirt/qemu/networks/autostart/default.xml":
-            ensure  => absent;
+    file { '/etc/libvirt/qemu/networks/autostart/default.xml':
+            ensure  => absent,
     }
 
     # Live hack to use qcow2 ephemeral base images. Need to upstream
@@ -123,7 +137,7 @@
             owner   => 'root',
             group   => 'root',
             mode    => '0444',
-            require => Package["nova-common"];
+            require => Package['nova-common'],
         }
     }
     if ($::lsbdistcodename == 'trusty') {
@@ -133,7 +147,7 @@
             owner   => 'root',
             group   => 'root',
             mode    => '0444',
-            require => Package["nova-common"];
+            require => Package['nova-common'],
         }
     }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/195535
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I217c7bbe3a277a2422966bfd3313990511153730
Gerrit-PatchSet: 6
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Matanya <[email protected]>
Gerrit-Reviewer: Alexandros Kosiaris <[email protected]>
Gerrit-Reviewer: Andrew Bogott <[email protected]>
Gerrit-Reviewer: Dzahn <[email protected]>
Gerrit-Reviewer: Giuseppe Lavagetto <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to