Commits

Peter Eisentraut committed 3aad432

Numerous tweaks to make deployment from scratch work more reliably

  • Participants
  • Parent commits 8717a6b

Comments (0)

Files changed (1)

manifests/pgci.pp

 Package { ensure => installed }
 
+file { '/etc/timezone':
+  content => 'Etc/UTC',
+}
+
 file { "/etc/localtime":
-  source => "file:///usr/share/zoneinfo/UTC",
+  source => "file:///usr/share/zoneinfo/Etc/UTC",
 }
 
 package { 'locales-all': }
   release => "$lsbdistcodename/updates",
 }
 
+Exec['apt_update'] -> Package <| |>
+
 file { '/etc/apt/apt.conf.d/02periodic':
   content => "\
 APT::Periodic::Enable \"1\";
 
 file { '/etc/apache2/conf.d/pgci':
   content => "\
+<IfModule mod_proxy.c>
 ProxyPass         /jenkins  http://localhost:8080/jenkins
 ProxyPassReverse  /jenkins  http://localhost:8080/jenkins
 ProxyRequests     Off
   Order deny,allow
   Allow from all
 </Location>
+</IfModule>
 
 DocumentRoot /var/www",
 
 file { '/etc/apache2/conf.d/pgci-ssl':
   content => "\
 <VirtualHost _default_:443>
+<IfModule mod_ssl.c>
   SSLEngine on
   SSLCertificateFile    /etc/ssl/certs/ssl-cert-snakeoil.pem
   SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
+</IfModule>
 
   Include conf.d/pgci
 </VirtualHost>",
 
 service { 'icinga':
   ensure => running,
+  require => Service['httpd'],
 }
 
 # http://projects.puppetlabs.com/issues/3299
 exec { 'fix_nagios_perms':
   command => '/bin/chmod 0644 /etc/icinga/objects/puppet.cfg',
+  before => Package['icinga'],
   notify => Service['icinga'],
   refreshonly => true,
 }
 
+file { ['/etc/icinga', '/etc/icinga/objects']:
+  ensure => directory,
+}
+
 Nagios_command {
   notify => Exec['fix_nagios_perms'],
   target => '/etc/icinga/objects/puppet.cfg',
-  require => Package['icinga'],
+  require => File['/etc/icinga/objects'],
 }
 
 Nagios_service {
   notify => Exec['fix_nagios_perms'],
   target => '/etc/icinga/objects/puppet.cfg',
-  require => Package['icinga'],
+  require => File['/etc/icinga/objects'],
 }
 
 nagios_command { 'check_http_jenkins':
   host_name => 'localhost',
   service_description => 'HTTPS',
   check_command => 'check_https',
+  require => Service['httpd'],
 }
 
 nagios_service { 'check_http_jenkins_svc':
   host_name => 'localhost',
   service_description => 'HTTP Jenkins',
   check_command => 'check_http_jenkins',
-  require => Nagios_Command['check_http_jenkins'],
+  require => [Nagios_command['check_http_jenkins'],
+              Service['httpd']],
 }
 
 nagios_service { 'check_apt':
   host_name => 'localhost',
   service_description => 'APT',
   check_command => 'check_apt_distupgrade',
+  require => Exec['apt_update'],
 }
 
 nagios_service { 'check_mailq_svc':
   host_name => 'localhost',
   service_description => 'Mail queue',
   check_command => 'check_mailq',
-  require => Nagios_Command['check_mailq'],
+  require => [Nagios_command['check_mailq'],
+              Service['postfix']],
 }
 
 nagios_service { 'check_ntp_time_svc':
   host_name => 'localhost',
   service_description => 'NTP',
   check_command => 'check_ntp_time',
-  require => Nagios_Command['check_ntp_time'],
+  require => [Nagios_command['check_ntp_time'],
+              Service['ntp']],
 }
 
 nagios_service { 'check_swap_svc':
   host_name => 'localhost',
   service_description => 'Swap',
   check_command => 'check_swap',
-  require => Nagios_Command['check_swap'],
+  require => Nagios_command['check_swap'],
 }
 
 package { ['munin', 'munin-node']: }
 }
 
 package { 'ntp': }
+service { 'ntp':
+  ensure => running,
+  restart => '/etc/init.d/ntp reload',
+  require => Package['ntp'],
+}
 
 
 # Build dependencies
                 'libkrb5-dev',
                 'libldap2-dev',
                 'libossp-uuid-dev',
-                'libpam-dev',
+                'libpam0g-dev',
                 'libperl-dev',
                 'libreadline-dev',
                 'libssl-dev',
                 'libxml2-dev',
                 'libxslt1-dev',
-                'libz-dev',
+                'zlib1g-dev',
                 'make',
                 'perl',
                 'python-dev',