summaryrefslogtreecommitdiff
path: root/modules/profiles/manifests/syncthing.pp
blob: 7d8183ea9eac331d705191912f0895e60675b83c (plain)
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
class profiles::syncthing (
  Array[String] $enable_for = []
) {

  # TODO add repo for those systems that need it

  package { 'syncthing':
    ensure => installed
  }

  systemd::dropin_file { 'nospam.conf':
    unit    => 'syncthing@.service',
    content => @(EOF)
      [Service]
      ExecStart=
      ExecStart=/bin/bash -c 'set -o pipefail; /usr/bin/syncthing -no-browser -no-restart -logflags=0 | grep -v "INFO: "'
      | EOF
  }

  $enable_for.map |$user| {
    service { "syncthing@${user}":
      enable => true,
    }
  }

  # TODO manage synced data

}