diff --git a/adobe/manifests/init.pp b/adobe/manifests/init.pp index 4c1934e..6f8be12 100644 --- a/adobe/manifests/init.pp +++ b/adobe/manifests/init.pp @@ -36,11 +36,11 @@ class adobe::flash { include adobe::common package { "adobe-flash-plugin": + ensure => installed, name => $::operatingsystem ? { "ubuntu" => "adobe-flashplugin", default => "flash-plugin", }, - ensure => installed, require => Class["adobe::common"], } @@ -53,11 +53,11 @@ class adobe::reader { include adobe::common package { "acroread": + ensure => installed, name => $::operatingsystem ? { "ubuntu" => "acroread", default => "AdobeReader_enu", }, - ensure => installed, require => Class["adobe::common"], } diff --git a/bacula/manifests/init.pp b/bacula/manifests/init.pp index efc83fe..040cd8b 100644 --- a/bacula/manifests/init.pp +++ b/bacula/manifests/init.pp @@ -161,12 +161,12 @@ class bacula::director($password=undef, } package { "bacula-director": + ensure => installed, name => $dbadapter ? { "mysql" => "bacula-director-mysql", "postgresql" => "bacula-director-postgresql", "sqlite" => "bacula-director-sqlite", }, - ensure => installed, before => Class["bacula::certificates"], } @@ -266,9 +266,9 @@ class bacula::director($password=undef, } service { "bacula-director": - name => "bacula-dir", ensure => running, enable => true, + name => "bacula-dir", require => [ File["/srv/bacula"], Class["bacula::certificates"], ], } @@ -353,8 +353,8 @@ class bacula::storage($password = undef) { include bacula::certificates package { "bacula-storage": - name => "bacula-storage-sqlite", ensure => installed, + name => "bacula-storage-sqlite", before => Class["bacula::certificates"], } diff --git a/cairo/manifests/init.pp b/cairo/manifests/init.pp index a8f96a2..2806e1e 100644 --- a/cairo/manifests/init.pp +++ b/cairo/manifests/init.pp @@ -3,12 +3,12 @@ class cairo { package { "cairo": + ensure => installed, name => $::operatingsystem ? { debian => "libcairo2", ubuntu => "libcairo2", default => "cairo", }, - ensure => installed, } } @@ -19,12 +19,12 @@ class cairo { class cairo::python inherits cairo { package { "pycairo": + ensure => installed, name => $::operatingsystem ? { debian => "python-cairo", ubuntu => "python-cairo", default => "pycairo", }, - ensure => installed, } } diff --git a/git/manifests/init.pp b/git/manifests/init.pp index e1cc000..91d5b20 100644 --- a/git/manifests/init.pp +++ b/git/manifests/init.pp @@ -3,11 +3,11 @@ class git { package { "git": + ensure => installed, name => $::operatingsystem ? { "ubuntu" => "git-core", default => "git", }, - ensure => installed, } } diff --git a/graphviz/manifests/init.pp b/graphviz/manifests/init.pp index 462f916..6789a43 100644 --- a/graphviz/manifests/init.pp +++ b/graphviz/manifests/init.pp @@ -13,12 +13,12 @@ class graphviz { class graphviz::python inherits graphviz { package { "graphviz-python": + ensure => installed, name => $::operatingsystem ? { debian => "libgv-python", ubuntu => "libgv-python", default => "graphviz-python", }, - ensure => installed, } } diff --git a/ldap/manifests/init.pp b/ldap/manifests/init.pp index 4d9d2e2..b56fe95 100644 --- a/ldap/manifests/init.pp +++ b/ldap/manifests/init.pp @@ -290,11 +290,11 @@ class ldap::client { class ldap::client::python { package { "python-ldap": + ensure => installed, name => $::operatingsystem ? { openbsd => "py-ldap", default => "python-ldap", }, - ensure => installed, } file { "${::pythonsitedir}/dynldap.py": diff --git a/lynx/manifests/init.pp b/lynx/manifests/init.pp index a4505b7..426489c 100644 --- a/lynx/manifests/init.pp +++ b/lynx/manifests/init.pp @@ -14,11 +14,11 @@ class lynx { if $::operatingsystem != "OpenBSD" { package { "lynx": + ensure => installed, name => $::operatingsystem ? { "ubuntu" => "lynx-cur", default => "lynx", }, - ensure => installed, before => File["/usr/local/bin/html2text"], } } @@ -33,11 +33,11 @@ class lynx { } file { "lynx-site.cfg": + ensure => present, name => $::operatingsystem ? { "ubuntu" => "/etc/lynx-cur/local.cfg", default => "/etc/lynx-site.cfg", }, - ensure => present, content => template("lynx/lynx-site.cfg.erb"), mode => 0644, owner => "root", diff --git a/munin/manifests/init.pp b/munin/manifests/init.pp index 4ce55dc..d0c4bcb 100644 --- a/munin/manifests/init.pp +++ b/munin/manifests/init.pp @@ -43,12 +43,12 @@ class munin::node { } service { "munin-node": + ensure => running, + enable => true, name => $::operatingsystem ? { "openbsd" => "munin_node", default => "munin-node", }, - ensure => running, - enable => true, require => Package["munin-node"], } diff --git a/mysql/manifests/init.pp b/mysql/manifests/init.pp index a6f5d00..76ac2cd 100644 --- a/mysql/manifests/init.pp +++ b/mysql/manifests/init.pp @@ -70,13 +70,13 @@ class mysql::server { } service { "mysqld": + ensure => running, + enable => true, name => $::operatingsystem ? { "ubuntu" => "mysql", "debian" => "mysql", default => "mysqld", }, - ensure => running, - enable => true, require => File["/srv/mysql"], } diff --git a/nagios/manifests/init.pp b/nagios/manifests/init.pp index 147fbe3..818cebd 100644 --- a/nagios/manifests/init.pp +++ b/nagios/manifests/init.pp @@ -50,8 +50,8 @@ class nagios::common { class nagios::server::manual inherits nagios::common { package { "nagios": - name => $package, ensure => installed, + name => $package, } case $::operatingsystem { @@ -84,9 +84,9 @@ class nagios::server::manual inherits nagios::common { } service { "nagios": - name => $service, ensure => running, enable => true, + name => $service, hasstatus => true, } @@ -113,8 +113,8 @@ class nagios::server::manual inherits nagios::common { } file { "/etc/nagios/nagios.cfg": - name => "${etcdir}/nagios.cfg", ensure => present, + name => "${etcdir}/nagios.cfg", mode => "0644", owner => "root", group => "root", @@ -124,8 +124,8 @@ class nagios::server::manual inherits nagios::common { } file { "/etc/nagios/cgi.cfg": - name => "${etcdir}/cgi.cfg", ensure => present, + name => "${etcdir}/cgi.cfg", mode => "0644", owner => "root", group => "root", @@ -135,8 +135,8 @@ class nagios::server::manual inherits nagios::common { } file { "/etc/nagios/commands.cfg": - name => "${etcdir}/commands.cfg", ensure => present, + name => "${etcdir}/commands.cfg", mode => "0644", owner => "root", group => "root", @@ -146,8 +146,8 @@ class nagios::server::manual inherits nagios::common { } file { "/etc/nagios/passwd": - name => $htpasswd, ensure => present, + name => $htpasswd, mode => "0640", owner => "root", group => $apache::sslserver::group, @@ -155,8 +155,8 @@ class nagios::server::manual inherits nagios::common { } file { "/etc/nagios/conf.d": - name => $confdir, ensure => directory, + name => $confdir, mode => "0640", owner => "root", group => "nagios", @@ -169,8 +169,8 @@ class nagios::server::manual inherits nagios::common { } file { "/etc/nagios/private.d": - name => $private, ensure => directory, + name => $private, mode => "0640", owner => "root", group => "nagios", diff --git a/nagios/manifests/target.pp b/nagios/manifests/target.pp index 9db0de0..19a56c9 100644 --- a/nagios/manifests/target.pp +++ b/nagios/manifests/target.pp @@ -433,13 +433,13 @@ class nagios::target::nrpe inherits nagios::target { } package { "nrpe": - name => $package, ensure => installed, + name => $package, } file { "/etc/nrpe.cfg": - name => $nrpecfg, ensure => present, + name => $nrpecfg, mode => "0644", owner => "root", group => $::operatingsystem ? { @@ -452,8 +452,8 @@ class nagios::target::nrpe inherits nagios::target { } file { "/etc/nrpe.d": - name => $nrpedir, ensure => directory, + name => $nrpedir, mode => "0644", owner => "root", group => $::operatingsystem ? { @@ -468,9 +468,9 @@ class nagios::target::nrpe inherits nagios::target { } service { "nrpe": - name => $service, ensure => running, enable => true, + name => $service, } nagios::target::nrpe::service { "check_disk -w 10% -c 5% -p /": diff --git a/netcat/manifests/init.pp b/netcat/manifests/init.pp index 39591b7..29543e5 100644 --- a/netcat/manifests/init.pp +++ b/netcat/manifests/init.pp @@ -5,6 +5,7 @@ class netcat { if $::operatingsystem != "OpenBSD" { package { "netcat": + ensure => present, name => $::operatingsystem ? { "debian" => "netcat", "ubuntu" => "netcat", @@ -18,7 +19,6 @@ class netcat { }, default => "nc", }, - ensure => present, } } diff --git a/nfs/manifests/init.pp b/nfs/manifests/init.pp index 9aa7224..18cad3b 100644 --- a/nfs/manifests/init.pp +++ b/nfs/manifests/init.pp @@ -22,6 +22,8 @@ class nfs::client { } service { "nfslock": + ensure => running, + enable => true, name => $::operatingsystem ? { "centos" => $::operatingsystemrelease ? { /^[1-6]/ => "nfslock", @@ -34,8 +36,6 @@ class nfs::client { "ubuntu" => "statd", default => "nfslock", }, - ensure => running, - enable => true, hasstatus => true, require => Package["nfs-utils"], } diff --git a/samba/manifests/init.pp b/samba/manifests/init.pp index aed3228..c940f6b 100644 --- a/samba/manifests/init.pp +++ b/samba/manifests/init.pp @@ -219,13 +219,13 @@ class samba::server( } service { "smb": + ensure => running, + enable => true, name => $::operatingsystem ? { "openbsd" => "smbd", "ubuntu" => "smbd", default => "smb", }, - ensure => running, - enable => true, } service { "nmb": name => $::operatingsystem ? { diff --git a/sasl/manifests/init.pp b/sasl/manifests/init.pp index c916023..676c447 100644 --- a/sasl/manifests/init.pp +++ b/sasl/manifests/init.pp @@ -4,6 +4,7 @@ class sasl::client { package { "cyrus-sasl": + ensure => installed, name => $::operatingsystem ? { "debian" => "sasl2-bin", "ubuntu" => "sasl2-bin", @@ -13,17 +14,16 @@ class sasl::client { "openbsd" => "ldap", default => undef, }, - ensure => installed, } if $kerberos_realm and $::operatingsystem != "OpenBSD" { package { "cyrus-sasl-gssapi": + ensure => installed, name => $::operatingsystem ? { "debian" => "libsasl2-modules-gssapi-mit", "ubuntu" => "libsasl2-modules-gssapi-mit", default => "cyrus-sasl-gssapi", }, - ensure => installed, } } diff --git a/sendmail/manifests/init.pp b/sendmail/manifests/init.pp index 13869b1..ddd836d 100644 --- a/sendmail/manifests/init.pp +++ b/sendmail/manifests/init.pp @@ -80,11 +80,11 @@ class sendmail::client inherits sendmail::common { } file { "/etc/mail/submit.mc": + ensure => present, path => $::operatingsystem ? { "openbsd" => "/usr/share/sendmail/cf/submit.mc", default => "/etc/mail/submit.mc", }, - ensure => present, content => template("sendmail/submit.mc.erb", "sendmail/submit.mc.msp.erb"), owner => "root", group => $::operatingsystem ? { diff --git a/snmp/manifests/init.pp b/snmp/manifests/init.pp index 2fd6d79..8c7cfdc 100644 --- a/snmp/manifests/init.pp +++ b/snmp/manifests/init.pp @@ -1,18 +1,23 @@ - # Install net-snmp utilities # class snmp::utils { - package { "net-snmp": - name => $::operatingsystem ? { - "openbsd" => "net-snmp", - default => [ "net-snmp-utils", "net-snmp", ], - }, - ensure => installed, + case $::operatingsystem { + "openbsd": { + package { "net-snmp": + ensure => installed, + } + } + default: { + package { [ "net-snmp", "net-snmp-utils" ]: + ensure => installed, + } + } } } + # Install snmp trap daemon # # === Parameters diff --git a/spamassassin/manifests/init.pp b/spamassassin/manifests/init.pp index 8d88eb7..469409b 100644 --- a/spamassassin/manifests/init.pp +++ b/spamassassin/manifests/init.pp @@ -4,11 +4,11 @@ class spamassassin::common { package { "spamassassin": + ensure => present, name => $::operatingsystem ? { "openbsd" => "p5-Mail-SpamAssassin", default => "spamassassin", }, - ensure => present, } file { "/etc/mail/spamassassin/local.cf": diff --git a/ssh/manifests/init.pp b/ssh/manifests/init.pp index f41d09a..24c5aba 100644 --- a/ssh/manifests/init.pp +++ b/ssh/manifests/init.pp @@ -133,14 +133,14 @@ class ssh::server { } service { "sshd": + ensure => running, + enable => true, name => $::operatingsystem ? { "debian" => "ssh", "openwrt" => "dropbear", "ubuntu" => "ssh", default => "sshd", }, - ensure => running, - enable => true, } } diff --git a/tftp/manifests/init.pp b/tftp/manifests/init.pp index 338bf3f..8176051 100644 --- a/tftp/manifests/init.pp +++ b/tftp/manifests/init.pp @@ -79,12 +79,12 @@ class tftp::server { if $::operatingsystem != "OpenBSD" { package { "tftp-server": + ensure => installed, name => $::operatingsystem ? { ubuntu => "tftpd-hpa", debian => "tftpd-hpa", default => "tftp-server", }, - ensure => installed, } } diff --git a/vim/manifests/init.pp b/vim/manifests/init.pp index 54c9e64..c6d51ab 100644 --- a/vim/manifests/init.pp +++ b/vim/manifests/init.pp @@ -4,13 +4,13 @@ class vim { package { "vim": + ensure => installed, name => $::operatingsystem ? { "centos" => "vim-enhanced", "redhat" => "vim-enhanced", "fedora" => "vim-enhanced", default => "vim", }, - ensure => installed, } if $::puppetversion =~ /^2\./ {