Puppet Class: choria::broker

Defined in:
manifests/broker.pp

Overview

Class: choria::broker

 @param stats_listen_address Address the broker will listen for Prometheus stats

Examples:

Choria Broker in a 3 node cluster


class{"choria::broker":
   network_broker => true,
   network_peers => [
      "nats://choria1:5222",
      "nats://choria2:5222",
      "nats://choria3:5222"
   ]
}

Choria Broker federating the ‘development` network


class{"choria::broker":
  federation_broker => true,
  federation_cluster => "development"
}

Choria Broker with a NATS Stream adapter for registration data


class{"choria::broker":
  adapters => {
    discovery => {
      stream => {
        type => "choria_streams",
        servers => ["choria1:4222", "choria2:4222"],
        topic => "choria.node_metadata.%s",
        workers => 10,
      },
      ingest => {
        topic => "mcollective.broadcast.agent.discovery",
        protocol => "request",
        workers => 10
      }
    }
  }
}

Parameters:

  • network_broker (Boolean)

    Enable or Disable the network broker

  • federation_broker (Boolean)

    Enable or Disable the federation broker

  • federation_cluster (Optional[String])

    The name of the federation cluster to serve

  • manage_service (Boolean)

    Manage the choria-broker service

  • listen_address (Stdlib::Host)

    Address the network broker will listen on for clients and broker peers

  • client_port (Integer)

    Port clients will connect to using the core NATS protocol

  • websocket_port (Integer)

    Port clients will connect to using NATS over Websockets

  • cluster_peer_port (Integer)

    Port other brokers will connect to

  • stats_port (Integer)

    Port where Prometheus stats are hosted

  • leafnode_port (Integer)

    Port leafnode connections will be accepted on

  • client_hosts (Array[String])

    Whitelist of clients that are allowed to connect to broker

  • adapters (Choria::Adapters)

    Data adapters to configure

  • leafnode_upstreams (Choria::Leafnodes)

    Leafnode connections to configure

  • tls_timeout (Optional[Integer]) (defaults to: undef)

    TLS Handshake timeout (in seconds)

  • identity (String)

    The identity this broker will use to determine SSL cert names etc

  • stream_store (Optional[Stdlib::Absolutepath]) (defaults to: undef)

    Enables Streaming and store data in this path

  • advisory_retention (String)

    How long to store server advisories for in the Stream

  • event_retention (String)

    How long to store events for in the Stream

  • machine_retention (String)

    How long to store Choria Autonomous Agent events

  • system_user (String)

    Username to use for access to the System account

  • system_password (String)

    Password to use for access to the System account

  • provisioner_password (String)

    The Password the Choria Provisioner needs to present

  • provisioning_signer_source (String)

    A Puppet source where the public used to sign provisioning.jwt is found

  • $cluster_name

    Configures a unique location specific name, use when establishing leafnodes to a central network

  • cluster_name (Optional[String])
  • stats_listen_address (Stdlib::Host)
  • network_peers (Array[String])
  • federation_middleware_hosts (Array[String])
  • collective_middleware_hosts (Array[String])
  • ssldir (Optional[Stdlib::Absolutepath]) (defaults to: undef)
  • advisory_replicas (Integer)
  • event_replicas (Integer)
  • machine_replicas (Integer)


66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'manifests/broker.pp', line 66

class choria::broker (
  Boolean $network_broker,
  Boolean $federation_broker,
  Optional[String] $federation_cluster,
  Optional[String] $cluster_name,
  Boolean $manage_service,
  Stdlib::Host $listen_address,
  Stdlib::Host $stats_listen_address,
  Integer $client_port,
  Integer $websocket_port,
  Integer $cluster_peer_port,
  Integer $stats_port,
  Integer $leafnode_port,
  Array[String] $network_peers,
  Array[String] $federation_middleware_hosts,
  Array[String] $collective_middleware_hosts,
  Array[String] $client_hosts,
  Choria::Adapters $adapters,
  Choria::Leafnodes $leafnode_upstreams,
  String $identity,
  Optional[Stdlib::Absolutepath] $ssldir = undef,
  Optional[Integer] $tls_timeout = undef,
  Optional[Stdlib::Absolutepath] $stream_store = undef,
  String $advisory_retention,
  Integer $advisory_replicas,
  String $event_retention,
  Integer $event_replicas,
  String $machine_retention,
  Integer $machine_replicas,
  String $system_user,
  String $system_password,
  String $provisioner_password,
  String $provisioning_signer_source,
) {
  require choria

  class{"choria::broker::config": }

  ~> class{"choria::broker::service": }

  -> Class[$name]
}