fix syntax
[mirror/dsa-puppet.git] / modules / roles / manifests / weblog_provider.pp
1 class roles::weblog_provider {
2         if ! $::weblogsync_key {
3                 exec { 'create-weblogsync-key':
4                         command => '/bin/su - weblogsync -c \'mkdir -p -m 02700 .ssh && ssh-keygen -C "`whoami`@`hostname` (`date +%Y-%m-%d`)" -P "" -f .ssh/id_rsa -q\'',
5                         onlyif  => '/usr/bin/getent passwd weblogsync > /dev/null && ! [ -e /home/weblogsync/.ssh/id_rsa ]'
6                 }
7         } else {
8                 file { '/var/log/apache2':
9                         ensure => directory,
10                         mode   => '0755',
11                 }
12                 file { '/etc/cron.d/puppet-weblog-provider':
13                         content => "SHELL=/bin/bash\n\n0 1 * * * weblogsync sleep $((RANDOM \% 1800)); rsync -a --delete-excluded --include 'www.debian.org-access.log-*gz' --exclude '**' /var/log/apache2/. weblogsync@wolkenstein.debian.org:-weblogs-incoming-\n",
14                 }
15         }
16 }