From 30353ebac4fe388740961f00000ffe68cdcfd295 Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Mon, 24 Sep 2012 18:50:46 -0400 Subject: [PATCH] Updates for puppet style guide With the help of puppet-lint our base.pp manifest is now formatted correctly per the puppet style guide. Change-Id: I37de863b489bfd1b1a67b657a0749a5824ffe91d Signed-off-by: Paul Belanger Reviewed-on: https://review.openstack.org/13603 Reviewed-by: Clark Boylan Reviewed-by: James E. Blair Approved: James E. Blair Tested-by: Jenkins --- modules/openstack_project/manifests/base.pp | 79 ++++++++++++--------- 1 file changed, 44 insertions(+), 35 deletions(-) diff --git a/modules/openstack_project/manifests/base.pp b/modules/openstack_project/manifests/base.pp index db27eb3cfe..3b45160d34 100644 --- a/modules/openstack_project/manifests/base.pp +++ b/modules/openstack_project/manifests/base.pp @@ -1,4 +1,7 @@ -class openstack_project::base($install_users=true, $certname=$fqdn) { +class openstack_project::base( + $certname = $::fqdn, + $install_users = true +) { include openstack_project::users include sudoers @@ -6,61 +9,67 @@ class openstack_project::base($install_users=true, $certname=$fqdn) { ensure => 'absent' } - package { "popularity-contest": + package { 'popularity-contest': ensure => purged } - if ( $lsbdistcodename == "oneiric" ) { + if ($::lsbdistcodename == 'oneiric') { include apt apt::ppa { 'ppa:git-core/ppa': } - package { "git": - ensure => latest, + package { 'git': + ensure => latest, require => Apt::Ppa['ppa:git-core/ppa'] } } else { - package { "git": + package { 'git': ensure => present, } } - $packages = ["puppet", - "python-setuptools", - "python-virtualenv"] - package { $packages: ensure => "present" } + $packages = [ + 'puppet', + 'python-setuptools', + 'python-virtualenv' + ] + + package { $packages: + ensure => 'present' + } if ($install_users) { + package { ['byobu', 'emacs23-nox']: + ensure => 'present' + } - package { ["byobu", "emacs23-nox"]: - ensure => "present" - } - - realize ( - User::Virtual::Localuser["mordred"], - User::Virtual::Localuser["corvus"], - User::Virtual::Localuser["soren"], - User::Virtual::Localuser["linuxjedi"], - User::Virtual::Localuser["devananda"], - User::Virtual::Localuser["clarkb"], - ) + realize ( + User::Virtual::Localuser['mordred'], + User::Virtual::Localuser['corvus'], + User::Virtual::Localuser['soren'], + User::Virtual::Localuser['linuxjedi'], + User::Virtual::Localuser['devananda'], + User::Virtual::Localuser['clarkb'], + ) } # Download and set up puppet apt repo - exec { "download:puppetlabs-release-${lsbdistcodename}.deb": - command => "/usr/bin/wget http://apt.puppetlabs.com/puppetlabs-release-${lsbdistcodename}.deb -O /root/puppetlabs-release-${lsbdistcodename}.deb", - creates => "/root/puppetlabs-release-${lsbdistcodename}.deb", + exec { "download:puppetlabs-release-$::{lsbdistcodename}.deb": + command => "/usr/bin/wget http://apt.puppetlabs.com/puppetlabs-release-$::{lsbdistcodename}.deb -O /root/puppetlabs-release-$::{lsbdistcodename}.deb", + creates => "/root/puppetlabs-release-$::{lsbdistcodename}.deb", } - exec { "dpkg:puppetlabs-release-${lsbdistcodename}.deb": - command => "/usr/bin/dpkg -i /root/puppetlabs-release-${lsbdistcodename}.deb", - onlyif => "/usr/bin/test ! -f /etc/apt/sources.list.d/puppetlabs.list", - require => Exec["download:puppetlabs-release-${lsbdistcodename}.deb"], + exec { "dpkg:puppetlabs-release-$::{lsbdistcodename}.deb": + command => "/usr/bin/dpkg -i /root/puppetlabs-release-$::{lsbdistcodename}.deb", + onlyif => '/usr/bin/test ! -f /etc/apt/sources.list.d/puppetlabs.list', + require => Exec["download:puppetlabs-release-$::{lsbdistcodename}.deb"], } file { '/etc/puppet/puppet.conf': - owner => 'root', - group => 'root', - mode => 444, - ensure => 'present', - content => template('openstack_project/puppet.conf.erb'), - replace => 'true', + ensure => 'present', + owner => 'root', + group => 'root', + mode => '0444', + content => template('openstack_project/puppet.conf.erb'), + replace => true, } } + +# vim:sw=2:ts=2:expandtab:textwidth=79