diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-02-22 08:51:26 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-02-22 08:51:26 +0100 |
commit | a00e79467b6703ffc4eb3f5c14f6e24b46ec7916 (patch) | |
tree | 794e241f90cc71d9e198e3d45c7c67fa54ccbddf /modules/profile/manifests | |
parent | b859262351650df3368d4f3fa49a487a7d9b35b7 (diff) | |
parent | 68bbff6199a64dd32739487334260962261f7195 (diff) | |
download | Puppet-a00e79467b6703ffc4eb3f5c14f6e24b46ec7916.tar.gz Puppet-a00e79467b6703ffc4eb3f5c14f6e24b46ec7916.tar.zst Puppet-a00e79467b6703ffc4eb3f5c14f6e24b46ec7916.zip |
Merge branch 'xmr_stak'
Diffstat (limited to 'modules/profile/manifests')
-rw-r--r-- | modules/profile/manifests/tools.pp | 2 | ||||
-rw-r--r-- | modules/profile/manifests/xmr_stak.pp | 57 |
2 files changed, 58 insertions, 1 deletions
diff --git a/modules/profile/manifests/tools.pp b/modules/profile/manifests/tools.pp index 0b0ab46..9f9d593 100644 --- a/modules/profile/manifests/tools.pp +++ b/modules/profile/manifests/tools.pp | |||
@@ -1,3 +1,3 @@ | |||
1 | class profile::tools { | 1 | class profile::tools { |
2 | ensure_packages(['vim', 'bash-completion', 'net-tools']) | 2 | ensure_packages(['vim', 'bash-completion', 'net-tools', 'htop']) |
3 | } | 3 | } |
diff --git a/modules/profile/manifests/xmr_stak.pp b/modules/profile/manifests/xmr_stak.pp new file mode 100644 index 0000000..20d2c08 --- /dev/null +++ b/modules/profile/manifests/xmr_stak.pp | |||
@@ -0,0 +1,57 @@ | |||
1 | class profile::xmr_stak { | ||
2 | ensure_resource('exec', 'systemctl daemon-reload', { | ||
3 | command => '/usr/bin/systemctl daemon-reload', | ||
4 | refreshonly => true | ||
5 | }) | ||
6 | |||
7 | ensure_packages(["cpulimit"]) | ||
8 | aur::package { "xmr-stak_cpu": } | ||
9 | |||
10 | user { "xmr_stak": | ||
11 | name => "xmr_stak", | ||
12 | ensure => "present", | ||
13 | managehome => true, | ||
14 | home => "/var/lib/xmr_stak", | ||
15 | system => true, | ||
16 | password => "!!", | ||
17 | require => Aur::Package["xmr-stak_cpu"], | ||
18 | } | ||
19 | |||
20 | file { "/etc/systemd/system/xmr-stak.service": | ||
21 | mode => "0644", | ||
22 | owner => "root", | ||
23 | group => "root", | ||
24 | source => "puppet:///modules/profile/xmr_stak/xmr-stak.service", | ||
25 | require => User["xmr_stak"], | ||
26 | notify => Exec["systemctl daemon-reload"] | ||
27 | } | ||
28 | |||
29 | $mining_pool = lookup("xmr_stak::mining_pool") |$key| { {} } | ||
30 | $wallet = lookup("xmr_stak::wallet") |$key| { {} } | ||
31 | $password = lookup("xmr_stak::password") |$key| { "x" } | ||
32 | $instance = regsubst($facts["ec2_metadata"]["hostname"], "\.", "_", "G") | ||
33 | |||
34 | file { "/var/lib/xmr_stak/xmr-stak.conf": | ||
35 | mode => "0644", | ||
36 | owner => "root", | ||
37 | group => "root", | ||
38 | content => template("profile/xmr_stak/xmr-stak.conf.erb"), | ||
39 | require => User["xmr_stak"], | ||
40 | } | ||
41 | |||
42 | service { "xmr-stak": | ||
43 | enable => true, | ||
44 | ensure => "running", | ||
45 | subscribe => [ | ||
46 | Aur::Package["xmr-stak_cpu"], | ||
47 | File["/var/lib/xmr_stak/xmr-stak.conf"], | ||
48 | File["/etc/systemd/system/xmr-stak.service"] | ||
49 | ], | ||
50 | require => [ | ||
51 | Aur::Package["xmr-stak_cpu"], | ||
52 | File["/var/lib/xmr_stak/xmr-stak.conf"], | ||
53 | File["/etc/systemd/system/xmr-stak.service"] | ||
54 | ] | ||
55 | } | ||
56 | } | ||
57 | |||