From: Peter Palfrader Date: Thu, 1 Dec 2016 10:19:44 +0000 (+0000) Subject: install popcon X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fdsa-puppet.git;a=commitdiff_plain;h=76a45767a4a3388504d2aeea300a8365291f3cce install popcon --- diff --git a/manifests/site.pp b/manifests/site.pp index 9b3aa43b5..c06a64117 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -40,6 +40,7 @@ node default { include dsa_lvm include grub include multipath + include popcon if $::lsbdistcodename == squeeze { include roles::udldap::client } else { diff --git a/modules/popcon/manifests/init.pp b/modules/popcon/manifests/init.pp new file mode 100644 index 000000000..ab289efa1 --- /dev/null +++ b/modules/popcon/manifests/init.pp @@ -0,0 +1,11 @@ +class popcon { + $popcon_host_id = hkdf('/etc/puppet/secret', "popcon_host_id-${::fqdn}") + + package { 'popularity-contest': + ensure => installed, + } + + file { '/etc/popularity-contest.conf': + content => template('popcon/popularity-contest.conf.erb') + } +} diff --git a/modules/popcon/templates/popularity-contest.conf.erb b/modules/popcon/templates/popularity-contest.conf.erb new file mode 100644 index 000000000..14b2fb79b --- /dev/null +++ b/modules/popcon/templates/popularity-contest.conf.erb @@ -0,0 +1,21 @@ +## +### THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE. +### USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git +### + +PARTICIPATE="yes" +USEHTTP="yes" +<%= +# hostids are 32 hexchars long +id_short = popcon_host_id[0,32] + +# slightly biased, but meh +day = (popcon_host_id[0].ord + 256*popcon_host_id[1].ord) % 7 + +conf = [] +conf << "MY_HOSTID=\"#{id_short}\"" +conf << "DAY=\"#{day}\"" + +conf.join("\n") +-%> +