]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blobdiff - modules/profile/manifests/boinc.pp
Add boinc to use spare CPUs
[perso/Immae/Projets/Puppet.git] / modules / profile / manifests / boinc.pp
diff --git a/modules/profile/manifests/boinc.pp b/modules/profile/manifests/boinc.pp
new file mode 100644 (file)
index 0000000..43c4a49
--- /dev/null
@@ -0,0 +1,30 @@
+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"])
+
+    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 => true,
+      ensure => "running",
+    }
+  }
+}