]>
Commit | Line | Data |
---|---|---|
a045b9dc IB |
1 | class profile::xmr_stak ( |
2 | String $mining_pool, | |
3 | String $wallet, | |
62fe8998 | 4 | Optional[String] $cpulimit = "50", |
a045b9dc IB |
5 | Optional[String] $password = "x", |
6 | ) { | |
68bbff61 IB |
7 | ensure_resource('exec', 'systemctl daemon-reload', { |
8 | command => '/usr/bin/systemctl daemon-reload', | |
9 | refreshonly => true | |
10 | }) | |
11 | ||
12 | ensure_packages(["cpulimit"]) | |
13 | aur::package { "xmr-stak_cpu": } | |
14 | ||
15 | user { "xmr_stak": | |
16 | name => "xmr_stak", | |
17 | ensure => "present", | |
18 | managehome => true, | |
19 | home => "/var/lib/xmr_stak", | |
20 | system => true, | |
21 | password => "!!", | |
22 | require => Aur::Package["xmr-stak_cpu"], | |
23 | } | |
24 | ||
25 | file { "/etc/systemd/system/xmr-stak.service": | |
26 | mode => "0644", | |
27 | owner => "root", | |
28 | group => "root", | |
62fe8998 | 29 | content => template("profile/xmr_stak/xmr-stak.service.erb"), |
68bbff61 IB |
30 | require => User["xmr_stak"], |
31 | notify => Exec["systemctl daemon-reload"] | |
32 | } | |
33 | ||
a045b9dc | 34 | $instance = regsubst(lookup("base_installation::ldap_cn"), '\.', "_", "G") |
68bbff61 IB |
35 | |
36 | file { "/var/lib/xmr_stak/xmr-stak.conf": | |
37 | mode => "0644", | |
38 | owner => "root", | |
39 | group => "root", | |
40 | content => template("profile/xmr_stak/xmr-stak.conf.erb"), | |
41 | require => User["xmr_stak"], | |
42 | } | |
43 | ||
44 | service { "xmr-stak": | |
45 | enable => true, | |
46 | ensure => "running", | |
47 | subscribe => [ | |
48 | Aur::Package["xmr-stak_cpu"], | |
49 | File["/var/lib/xmr_stak/xmr-stak.conf"], | |
50 | File["/etc/systemd/system/xmr-stak.service"] | |
51 | ], | |
52 | require => [ | |
53 | Aur::Package["xmr-stak_cpu"], | |
54 | File["/var/lib/xmr_stak/xmr-stak.conf"], | |
55 | File["/etc/systemd/system/xmr-stak.service"] | |
56 | ] | |
57 | } | |
58 | } | |
59 |