diff --git a/data/common/common.yaml b/data/common/common.yaml --- a/data/common/common.yaml +++ b/data/common/common.yaml @@ -2714,20 +2714,6 @@ seirl: apietri zack: zacchiro - -# Real exported files from munin -stats_export::export_path: "/var/www/stats.export.softwareheritage.org" -stats_export::export_file: "%{hiera('stats_export::export_path')}/history_counters.json" - -# Exposed through the following host's apache venv -stats_export::vhost::name: stats.export.softwareheritage.org -stats_export::vhost::docroot: "/var/www/%{hiera('stats_export::vhost::name')}" -stats_export::vhost::ssl_protocol: "%{hiera('apache::ssl_protocol')}" -stats_export::vhost::ssl_honorcipherorder: "%{hiera('apache::ssl_honorcipherorder')}" -stats_export::vhost::ssl_cipher: "%{hiera('apache::ssl_cipher')}" -stats_export::vhost::hsts_header: "%{hiera('apache::hsts_header')}" - - icinga2::role: agent icinga2::master::zonename: master diff --git a/manifests/site.pp b/manifests/site.pp --- a/manifests/site.pp +++ b/manifests/site.pp @@ -5,7 +5,6 @@ node 'pergamon.softwareheritage.org' { include role::swh_sysadmin - include profile::export_archive_counters } node 'tate.softwareheritage.org' { diff --git a/site-modules/profile/manifests/export_archive_counters.pp b/site-modules/profile/manifests/export_archive_counters.pp deleted file mode 100644 --- a/site-modules/profile/manifests/export_archive_counters.pp +++ /dev/null @@ -1,62 +0,0 @@ -# stats_export master class -class profile::export_archive_counters { - $export_path = lookup('stats_export::export_path') - $export_file = lookup('stats_export::export_file') - - $packages = ['python3-click', 'python3-requests'] - - ensure_packages($packages) - - $script_name = 'export_archive_counters.py' - $script_path = "/usr/local/bin/${script_name}" - - file {$script_path: - ensure => present, - owner => 'root', - group => 'root', - mode => '0755', - source => "puppet:///modules/profile/stats_exporter/${script_name}", - require => Package[$packages], - } - - $history_data_name = 'history-counters.munin.json' - $history_data_dir = "/usr/local/share/swh-data" - $history_data_path = "${history_data_dir}/${history_data_name}" - file {$history_data_dir: - ensure => 'directory', - owner => 'root', - group => 'root', - mode => '0755' - } -> - file {$history_data_path: - ensure => present, - owner => 'root', - group => 'root', - mode => '0644', - source => "puppet:///modules/profile/stats_exporter/${history_data_name}", - } - - $server = "pergamon.internal.softwareheritage.org" - $port = 9090 - - $command_get_data = "${script_path} --server ${server} --port ${port} --history-data-file ${history_data_path}" - - cron {'stats_export': - ensure => absent, - user => 'www-data', - } - - profile::cron::d {'export_archive_counters': - user => 'www-data', - command => "${command_get_data} > ${export_file}.tmp && /bin/mv ${export_file}.tmp ${export_file}", - hour => 'fqdn_rand', - minute => 'fqdn_rand', - month => '*', - monthday => '*', - weekday => '*', - require => [ - File[$script_path], - File[$history_data_path], - ], - } -} diff --git a/site-modules/profile/manifests/stats_web.pp b/site-modules/profile/manifests/stats_web.pp deleted file mode 100644 --- a/site-modules/profile/manifests/stats_web.pp +++ /dev/null @@ -1,49 +0,0 @@ -# Deployment of web-facing stats export (from munin) -class profile::stats_web { - $vhost_name = lookup('stats_export::vhost::name') - $vhost_docroot = lookup('stats_export::vhost::docroot') - $vhost_ssl_protocol = lookup('stats_export::vhost::ssl_protocol') - $vhost_ssl_honorcipherorder = lookup('stats_export::vhost::ssl_honorcipherorder') - $vhost_ssl_cipher = lookup('stats_export::vhost::ssl_cipher') - $vhost_hsts_header = lookup('stats_export::vhost::hsts_header') - - file {$vhost_docroot: - ensure => directory, - owner => 'www-data', - group => 'www-data', - mode => '0755', - } - - include ::profile::apache::common - - ::apache::vhost {"${vhost_name}_non-ssl": - servername => $vhost_name, - port => '80', - docroot => $vhost_docroot, - redirect_status => 'permanent', - redirect_dest => "https://${vhost_name}/", - } - - $ssl_cert_name = 'stats_export' - ::profile::letsencrypt::certificate {$ssl_cert_name:} - $cert_paths = ::profile::letsencrypt::certificate_paths($ssl_cert_name) - - ::apache::vhost {"${vhost_name}_ssl": - servername => $vhost_name, - port => '443', - ssl => true, - ssl_protocol => $vhost_ssl_protocol, - ssl_honorcipherorder => $vhost_ssl_honorcipherorder, - ssl_cipher => $vhost_ssl_cipher, - ssl_cert => $cert_paths['cert'], - ssl_chain => $cert_paths['chain'], - ssl_key => $cert_paths['privkey'], - headers => [$vhost_hsts_header], - docroot => $vhost_docroot, - require => [ - Profile::Letsencrypt::Certificate[$ssl_cert_name], - ], - } - - File[$cert_paths['cert'], $cert_paths['chain'], $cert_paths['privkey']] ~> Class['Apache::Service'] -} diff --git a/site-modules/role/manifests/swh_sysadmin.pp b/site-modules/role/manifests/swh_sysadmin.pp --- a/site-modules/role/manifests/swh_sysadmin.pp +++ b/site-modules/role/manifests/swh_sysadmin.pp @@ -18,9 +18,7 @@ include profile::apache::simple_server include ::apache::mod::rewrite - include profile::annex_web - include profile::stats_web include profile::docs_web include profile::debian_repository include profile::bitbucket_archive_web