Puppet Class: anysync::coordinator::config

Defined in:
manifests/coordinator/config.pp

Overview

Parameters:

  • cfg (Hash)

    Defines config for daemon

  • accounts (Hash)

    Defines “account” settings for all nodes (see “any_sync_accounts” in README.md)

  • user (String)

    Defines user for daemon files and process

  • group (String)

    Defines group for daemon files and process

  • daemon_name (String)

    Defines daemon name

  • syslog_ng (Hash) (defaults to: $::anysync::_syslog_ng)

    enable or disable syslog-ng configuration for logging

  • network (Hash)
  • limit_nofile (Variant[Integer,Boolean]) (defaults to: $::anysync::limit_nofile)


14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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
# File 'manifests/coordinator/config.pp', line 14

class anysync::coordinator::config (
  Hash $cfg,
  Hash $network,
  Hash $accounts,
  String $user,
  String $group,
  String $daemon_name,
  Hash $syslog_ng = $::anysync::_syslog_ng,
  Variant[Integer,Boolean] $limit_nofile = $::anysync::limit_nofile,
) {
  $basedir = dirname($cfg['networkStorePath'])
  user { $user:
    ensure => present,
    shell => '/sbin/nologin',
    managehome => false,
  }
  -> group { $group:
    ensure => present,
  }
  -> file {
    "/etc/any-sync-coordinator/":
      ensure => directory,
    ;
    "/etc/any-sync-coordinator/config.yml":
      content => template("${module_name}/yaml.erb"),
      notify => Service["any-sync-coordinator"],
    ;
    # network.yml for any-sync-confapply
    # usage: any-sync-confapply -c /etc/any-sync-coordinator/config.yml -n /etc/any-sync-coordinator/network.yml -e
    "/etc/any-sync-coordinator/network.yml":
      content => template("${module_name}/network.yaml.erb"),
    ;
    [
      $basedir,
      $cfg['networkStorePath'],
    ]:
      ensure => directory,
      owner => $user,
      group => $group,
    ;
  }
  if $syslog_ng['ensure'] {
    syslog_ng::cfg { "any-sync-coordinator": * => $syslog_ng }
  }
  systemd::unit_file { "any-sync-coordinator.service":
    content => template("${module_name}/service.erb"),
    enable => true,
    active => true,
  }
}