Puppet Class: profile::prometheus::migration

Defined in:
modules/profile/manifests/prometheus/migration.pp

Overview

SPDX-License-Identifier: Apache-2.0 Add support to synchronize prometheus data to other instances for distribution upgrade

Parameters:

  • hosts (Hash) (defaults to: lookup('prometheus_migrations', { 'default_value' => {} }))


4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'modules/profile/manifests/prometheus/migration.pp', line 4

class profile::prometheus::migration (
  Hash $hosts = lookup('prometheus_migrations', { 'default_value' => {} }),
) {

  $hosts.each |String $datacenter, Hash $data_flows| {
    if $::site == $datacenter {
      rsync::quickdatacopy { "prometheus-migration-${datacenter}":
        ensure              => Wmflib::Ensure($data_flows['ensure']),
        source_host         => $data_flows['src_host'],
        dest_host           => $data_flows['dst_host'],
        chown               => 'prometheus:prometheus',
        auto_sync           => false,
        module_path         => '/srv/prometheus',
        server_uses_stunnel => true,
        progress            => true,
      }
    }
  }
}