From bdcfd78f03d54b20c25805b24b0443f2a107e72b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Isma=C3=ABl=20Bouya?= Date: Sat, 21 Apr 2018 15:20:15 +0200 Subject: [PATCH] Add boinc to use spare CPUs --- modules/profile/manifests/boinc.pp | 30 +++++++++++++++++++++++ modules/role/manifests/backup.pp | 1 + modules/role/manifests/cryptoportfolio.pp | 1 + 3 files changed, 32 insertions(+) create mode 100644 modules/profile/manifests/boinc.pp diff --git a/modules/profile/manifests/boinc.pp b/modules/profile/manifests/boinc.pp new file mode 100644 index 0000000..43c4a49 --- /dev/null +++ b/modules/profile/manifests/boinc.pp @@ -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", + } + } +} diff --git a/modules/role/manifests/backup.pp b/modules/role/manifests/backup.pp index 510a8ef..d01abd9 100644 --- a/modules/role/manifests/backup.pp +++ b/modules/role/manifests/backup.pp @@ -13,6 +13,7 @@ class role::backup ( include "profile::tools" include "profile::xmr_stak" include "profile::known_hosts" + include "profile::boinc" ensure_packages(["rsync"]) diff --git a/modules/role/manifests/cryptoportfolio.pp b/modules/role/manifests/cryptoportfolio.pp index 53b7abd..966f549 100644 --- a/modules/role/manifests/cryptoportfolio.pp +++ b/modules/role/manifests/cryptoportfolio.pp @@ -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" -- 2.41.0