]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blobdiff - modules/profile/manifests/xmr_stak.pp
Make cpu limit for xmr stak parameter
[perso/Immae/Projets/Puppet.git] / modules / profile / manifests / xmr_stak.pp
index 20d2c08baebdfb1e33c8a6896e639aadeab5edfd..ccb6baaf97028cec06840e95cfae882514a649f5 100644 (file)
@@ -1,4 +1,9 @@
-class profile::xmr_stak {
+class profile::xmr_stak (
+  String           $mining_pool,
+  String           $wallet,
+  Optional[String] $cpulimit = "50",
+  Optional[String] $password = "x",
+) {
   ensure_resource('exec', 'systemctl daemon-reload', {
     command     => '/usr/bin/systemctl daemon-reload',
     refreshonly =>  true
@@ -21,15 +26,12 @@ class profile::xmr_stak {
     mode    => "0644",
     owner   => "root",
     group   => "root",
-    source  => "puppet:///modules/profile/xmr_stak/xmr-stak.service",
+    content => template("profile/xmr_stak/xmr-stak.service.erb"),
     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")
+  $instance = regsubst(lookup("base_installation::ldap_cn"), '\.', "_", "G")
 
   file { "/var/lib/xmr_stak/xmr-stak.conf":
     mode    => "0644",