Puppet Class: profile::dragonfly::supernode

Defined in:
modules/profile/manifests/dragonfly/supernode.pp

Overview

Parameters:

  • listen_port (Stdlib::Port::Unprivileged) (defaults to: lookup('profile::dragonfly::supernode::listen_port'))
  • download_port (Stdlib::Port::Unprivileged) (defaults to: lookup('profile::dragonfly::supernode::download_port'))
  • cdn_pattern (Enum['local', 'source']) (defaults to: lookup('profile::dragonfly::supernode::cdn_pattern'))


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'modules/profile/manifests/dragonfly/supernode.pp', line 1

class profile::dragonfly::supernode (
  Stdlib::Port::Unprivileged $listen_port = lookup('profile::dragonfly::supernode::listen_port'),
  Stdlib::Port::Unprivileged $download_port = lookup('profile::dragonfly::supernode::download_port'),
  Enum['local', 'source']    $cdn_pattern = lookup('profile::dragonfly::supernode::cdn_pattern'),
) {
  class {'dragonfly::supernode':
    listen_port   => $listen_port,
    download_port => $download_port,
    cdn_pattern   => $cdn_pattern,
  }

  # This is the port the supernode is listening on for dfget clients to connect
  # Prometheus metrics are served here as well (/metrics)
  ferm::service { 'dragonfly_supernode':
    proto  => 'tcp',
    port   => $listen_port,
    srange => '$DOMAIN_NETWORKS',
  }

  if ($download_port != $listen_port) and ($cdn_pattern == 'local') {
    $ensure_download_port = 'present'
  } else {
    $ensure_download_port = 'absent'
  }
  ferm::service { 'dragonfly_supernode_cdn':
    ensure => $ensure_download_port,
    proto  => 'tcp',
    port   => $download_port,
    srange => '$DOMAIN_NETWORKS',
  }

  # TODO: Add icinga monitoring
}