]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/commitdiff
Add boinc to use spare CPUs
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Sat, 21 Apr 2018 13:20:15 +0000 (15:20 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Sat, 21 Apr 2018 13:30:48 +0000 (15:30 +0200)
modules/profile/manifests/boinc.pp [new file with mode: 0644]
modules/role/manifests/backup.pp
modules/role/manifests/cryptoportfolio.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",
+    }
+  }
+}
index 510a8ef65fd470f5cf032c342635c5cabc9196cc..d01abd962ef7f20ad6249923ee8431732f72a7c2 100644 (file)
@@ -13,6 +13,7 @@ class role::backup (
   include "profile::tools"
   include "profile::xmr_stak"
   include "profile::known_hosts"
+  include "profile::boinc"
 
   ensure_packages(["rsync"])
 
index 53b7abd6fdd7fffe37f20a9299887f70a915ffe5..966f549fa81e3a73b8334bd8662ebd3cb3ee448e 100644 (file)
@@ -24,6 +24,7 @@ class role::cryptoportfolio (
   include "profile::postgresql"
   include "profile::apache"
   include "profile::xmr_stak"
+  include "profile::boinc"
 
   contain "role::cryptoportfolio::postgresql"
   contain "role::cryptoportfolio::apache"