diff --git a/modules/openstack_project/manifests/mirror_update.pp b/modules/openstack_project/manifests/mirror_update.pp index 2055963e56..503beb7fad 100644 --- a/modules/openstack_project/manifests/mirror_update.pp +++ b/modules/openstack_project/manifests/mirror_update.pp @@ -582,4 +582,49 @@ class openstack_project::mirror_update ( key_type => 'public', key_source => 'puppet:///modules/openstack_project/reprepro/mariadb-mirror-new-gpg-key.asc', } + + # AFS Monitoring + file { '/etc/afsmon.cfg': + ensure => present, + content => template('openstack_project/mirror-update/afsmon.cfg.erb'), + replace => true, + } + + vcsrepo { '/opt/afsmon': + ensure => latest, + provider => git, + revision => 'master', + source => 'https://git.openstack.org/openstack-infra/afsmon', + } + + python::virtualenv { '/usr/afsmon-env': + ensure => present, + owner => 'root', + group => 'root', + timeout => 0, + # puppet-python 1.9.4 wants to guess we want "virtualenv-3", which + # we don't. Fixed in later versions. + virtualenv => 'virtualenv', + version => 3, + } + + exec { 'install_afsmon' : + command => '/usr/afsmon-env/bin/pip install --upgrade /opt/afsmon', + path => '/usr/local/bin:/usr/bin:/bin', + refreshonly => true, + subscribe => Vcsrepo['/opt/afsmon'], + require => Python::Virtualenv['/usr/afsmon-env'], + } + + cron { 'afsmon': + minute => [0, 30], + command => '/usr/afsmon-env/bin/afsmon stats >> /var/log/afsmon.log 2>&1', + environment => 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin', + require => [ + Python::Virtualenv['/usr/afsmon-env'], + Exec['install_afsmon'], + File['/etc/afsmon.cfg'], + ], + } + } diff --git a/modules/openstack_project/templates/mirror-update/afsmon.cfg.erb b/modules/openstack_project/templates/mirror-update/afsmon.cfg.erb new file mode 100644 index 0000000000..6d9021a78f --- /dev/null +++ b/modules/openstack_project/templates/mirror-update/afsmon.cfg.erb @@ -0,0 +1,17 @@ +[main] +# Enable debugging output +debug = True + +# If specified, all fileservers in this cell will be queried +cell = openstack.org + +# You can specify a specific list of fileservers. This is appended to +# the cell fileservers if present, otherwise is the canonical list +#fileservers = afs01.dfw.openstack.org +# fileserver02.afs.company.com +# fileserver03.afs.company.com + +# Options for remote statsd host if required +[statsd] +host = graphite.openstack.org +port = 8125