Defined Type: dstserver::entity::cluster

Defined in:
manifests/entity/cluster.pp

Summary

Configure a DST server cluster that can run several DST server shards

Overview

Parameters:

  • autosave (Boolean) (defaults to: true)

    Enable or disable automatic saving after each night

  • caves (Boolean) (defaults to: false)

    Configure and run a cave shard in addition to the overworld shard

  • clusterkey (String) (defaults to: 'dst')

    Key to authenticate the cluser nodes to each other

  • console (Boolean) (defaults to: true)

    Enable or disable the remote server console

  • description (String) (defaults to: '')

    Server Description in the public server list

  • intention (Enum['social', 'cooperative', 'competetive', 'madness']) (defaults to: 'social')

    Your play style intention for this instance

  • masterport (Integer) (defaults to: 11031)

    Port of the master listening for shard connections

  • mode (Enum['survival', 'wilderness', 'endless']) (defaults to: 'survival')

    Server map mode

  • password (String) (defaults to: '')

    Join password for the server

  • path (String)

    Absolute path this instance profile will be configured at

  • pause (Boolean) (defaults to: true)

    Autmatically pause the game when no players are connected to the server

  • players (Integer) (defaults to: 5)

    Maximum player slots for this instance

  • pvp (Boolean) (defaults to: false)

    Enable PvP on this instance

  • servername (String)

    Servername in the public server list, defaults to the key in the instances config hash

  • token (String)

    Klei dedicated server token for this instance, obtained in your account management on Klei's website

  • vote_kick (Boolean) (defaults to: true)

    Allow players to vote for kicks

  • ensure (Enum[present, absent]) (defaults to: present)


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'manifests/entity/cluster.pp', line 38

define dstserver::entity::cluster (
  String $path,
  String $servername,
  String $token,

  Boolean $autosave = true,
  Boolean $caves = false,
  String $clusterkey = 'dst',
  Boolean $console = true,
  String $description = '',
  Enum[present, absent] $ensure = present,
  Enum['social', 'cooperative', 'competetive', 'madness'] $intention = 'social',
  Integer $masterport = 11031,
  Enum['survival', 'wilderness', 'endless'] $mode = 'survival',
  String $password = '',
  Boolean $pause = true,
  Integer $players = 5,
  Boolean $pvp = false,
  Boolean $vote_kick = true,
) {
  file{"${path}/cluster_token.txt":
    ensure  => $ensure,
    content => $token,
    mode    => '0400',
    require => File[$path],
  }
  file{"${path}/cluster.ini":
    ensure  => $ensure,
    content => epp('dstserver/cluster.ini', {
      mode        => $mode,
      players     => $players,
      pvp         => $pvp,
      pause       => $pause,
      name        => $servername,
      description => $description,
      password    => $password,
      intention   => $intention,
      autosave    => $autosave,
      vote_kick   => $vote_kick,
      console     => $console,
      masterport  => $masterport,
      clusterkey  => $clusterkey,
    }),
    mode    => '0400',
    require => File[$path],
  }
}