# HG changeset patch # User IBBoard # Date 1426361586 0 # Node ID 6bbc86f6cee584ecb5f2d04f7586520fed9d959c # Parent cc7557a9cc7bc7256b3d19ff858480a98d1dc9ec Tidy up ordering and dependencies (including making sure we have a necessary file for Fail2Ban to start) diff -r cc7557a9cc7b -r 6bbc86f6cee5 manifests/templates.pp --- a/manifests/templates.pp Sat Mar 14 19:32:15 2015 +0000 +++ b/manifests/templates.pp Sat Mar 14 19:33:06 2015 +0000 @@ -1,3 +1,10 @@ +# Make sure packages come after their repos +YumRepo<| |> -> Package<| |> + +# Make sure all files are in place before starting services +File<| |> -> Service<| |> + + class basenode { $os = $operatingsystem $osver = "v${operatingsystemrelease}" @@ -73,7 +80,8 @@ } file { '/etc/pki/rpm-gpg/RPM-GPG-KEY-IBBoard-OBS': ensure => present, - source => 'puppet:///common/RPM-GPG-KEY-IBBoard-OBS' + source => 'puppet:///common/RPM-GPG-KEY-IBBoard-OBS', + before => YumRepo['ibboard'], } yumrepo { 'webtatic': mirrorlist => 'http://mirror.webtatic.com/yum/el6/$basearch/mirrorlist', @@ -85,7 +93,8 @@ } file { '/etc/pki/rpm-gpg/RPM-GPG-KEY-webtatic-andy': ensure => present, - source => 'puppet:///common/RPM-GPG-KEY-webtatic-andy' + source => 'puppet:///common/RPM-GPG-KEY-webtatic-andy', + before => YumRepo['webtatic'], } } @@ -211,6 +220,13 @@ content => '[Definition] logtarget = /var/log/fail2ban.log' } + # Because one of our rules checks fail2ban's log, but the service dies without the file + file { '/var/log/fail2ban.log': + ensure => present, + owner => 'root', + group => 'root', + mode => '0600', + } } #Our web server with our configs, not just a stock one diff -r cc7557a9cc7b -r 6bbc86f6cee5 modules/postfix/manifests/init.pp --- a/modules/postfix/manifests/init.pp Sat Mar 14 19:32:15 2015 +0000 +++ b/modules/postfix/manifests/init.pp Sat Mar 14 19:33:06 2015 +0000 @@ -3,11 +3,9 @@ ){ package { 'sendmail': ensure => 'absent', - notify => Package['postfix'] } service { 'sendmail': ensure => stopped, - notify => Package['sendmail'] } package { 'postfix': ensure => latest; @@ -30,7 +28,6 @@ } file { '/etc/postfix/main.cf': content => template('postfix/main.cf.erb'), - require => [ Package['postfix'], Class['dovecot'] ], } file { '/etc/postfix/master.cf': source => 'puppet:///common/postfix/master.cf' diff -r cc7557a9cc7b -r 6bbc86f6cee5 modules/website/manifests/php.pp --- a/modules/website/manifests/php.pp Sat Mar 14 19:32:15 2015 +0000 +++ b/modules/website/manifests/php.pp Sat Mar 14 19:33:06 2015 +0000 @@ -4,11 +4,13 @@ ) { File { notify => Service['httpd'], + tag => 'website', } Package { notify => Service['httpd'], + tag => 'website', } - Package <| |> -> File <| |> + Package <| tag == 'website' |> -> File <| tag == 'website' |> $packages = [ "php${suffix}", "php${suffix}-mcrypt", "php${suffix}-mbstring", "php${suffix}-xml", "php${suffix}-gd" ] package { $packages: ensure => latest,