aboutsummaryrefslogtreecommitdiff
path: root/modules/profile/manifests/boinc.pp
blob: b8d77cf817d6da4bcc0cc11458335a1d2347460c (plain) (blame)
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
34
class profile::boinc (
  Optional[String] $rpc_password = undef,
  Optional[String] $rpc_host     = undef,
) {
  unless empty($rpc_host) or empty($rpc_password) {
    ensure_packages(["boinc-nox", "lib32-glibc", "lib32-glib2"], { ensure => latest })

    file { "/var/lib/boinc/gui_rpc_auth.cfg":
      ensure  => present,
      content => $rpc_password,
      owner   => "boinc",
      group   => "boinc",
      mode    => "0600",
      require => Package["boinc-nox"]
    }
    ->
    file { "/var/lib/boinc/remote_hosts.cfg":
      ensure  => present,
      content => $rpc_host,
      owner   => "boinc",
      group   => "boinc",
      mode    => "0600",
    }
    ->
    service { "boinc":
      enable => false,
      ensure => "stopped",
    } ->
    service { "boinc-client":
      enable => true,
      ensure => "running",
    }
  }
}