--- /dev/null
+class profile::xmr_stak {
+ ensure_resource('exec', 'systemctl daemon-reload', {
+ command => '/usr/bin/systemctl daemon-reload',
+ refreshonly => true
+ })
+
+ ensure_packages(["cpulimit"])
+ aur::package { "xmr-stak_cpu": }
+
+ user { "xmr_stak":
+ name => "xmr_stak",
+ ensure => "present",
+ managehome => true,
+ home => "/var/lib/xmr_stak",
+ system => true,
+ password => "!!",
+ require => Aur::Package["xmr-stak_cpu"],
+ }
+
+ file { "/etc/systemd/system/xmr-stak.service":
+ mode => "0644",
+ owner => "root",
+ group => "root",
+ source => "puppet:///modules/profile/xmr_stak/xmr-stak.service",
+ require => User["xmr_stak"],
+ notify => Exec["systemctl daemon-reload"]
+ }
+
+ $mining_pool = lookup("xmr_stak::mining_pool") |$key| { {} }
+ $wallet = lookup("xmr_stak::wallet") |$key| { {} }
+ $password = lookup("xmr_stak::password") |$key| { "x" }
+ $instance = regsubst($facts["ec2_metadata"]["hostname"], "\.", "_", "G")
+
+ file { "/var/lib/xmr_stak/xmr-stak.conf":
+ mode => "0644",
+ owner => "root",
+ group => "root",
+ content => template("profile/xmr_stak/xmr-stak.conf.erb"),
+ require => User["xmr_stak"],
+ }
+
+ service { "xmr-stak":
+ enable => true,
+ ensure => "running",
+ subscribe => [
+ Aur::Package["xmr-stak_cpu"],
+ File["/var/lib/xmr_stak/xmr-stak.conf"],
+ File["/etc/systemd/system/xmr-stak.service"]
+ ],
+ require => [
+ Aur::Package["xmr-stak_cpu"],
+ File["/var/lib/xmr_stak/xmr-stak.conf"],
+ File["/etc/systemd/system/xmr-stak.service"]
+ ]
+ }
+}
+
--- /dev/null
+"pool_list" :
+[
+{"pool_address" : "<%= @mining_pool %>", "wallet_address" : "<%= @wallet %>.<%= @instance %>", "pool_password" : "<%= @password %>", "use_nicehash" : false, "use_tls" : false, "tls_fingerprint" : "", "pool_weight" : 1 },
+],
+
+"currency" : "monero",
+"call_timeout" : 10,
+"retry_time" : 30,
+"giveup_limit" : 0,
+
+"verbose_level" : 3,
+"print_motd" : true,
+"h_print_time" : 60,
+"aes_override" : null,
+"use_slow_memory" : "warn",
+"tls_secure_algo" : true,
+"daemon_mode" : true,
+"flush_stdout" : false,
+"output_file" : "",
+"httpd_port" : 0,
+"http_login" : "",
+"http_pass" : "",
+"prefer_ipv4" : true,
class role::cryptoportfolio {
+ ensure_resource('exec', 'systemctl daemon-reload', {
+ command => '/usr/bin/systemctl daemon-reload',
+ refreshonly => true
+ })
+
include "base_installation"
include "profile::tools"
include "profile::postgresql"
include "profile::apache"
+ include "profile::xmr_stak"
$password_seed = lookup("base_installation::puppet_pass_seed") |$key| { {} }
owner => "root",
group => "root",
content => template("role/cryptoportfolio/cryptoportfolio-app.service.erb"),
- } ~> exec { 'systemctl deamon-reload':
- command => '/usr/bin/systemctl daemon-reload',
- refreshonly => true
+ notify => Exec["systemctl daemon-reload"],
}
service { 'cryptoportfolio-app':
require => [File[$cf_front_app_static_conf], Exec["web-cryptoportfolio-dependencies"]]
}
}
-
- # TODO: xmr_stack
}