$cf_bot_app = "${home}/bot"
$cf_bot_app_conf = "${home}/bot_config.ini"
+ $cf_bot_app_conf_hourly = "${home}/bot_config_hourly.ini"
$cf_bot_app_reports = "${home}/bot_reports"
ensure_packages(["python", "python-pip"])
],
}
+ if versioncmp($trader_version, "v1.3") >= 0 {
+ file { $cf_bot_app_conf_hourly:
+ owner => $user,
+ group => $group,
+ mode => "0600",
+ content => template("role/cryptoportfolio/bot_config_hourly.ini.erb"),
+ require => [
+ User["$user:"],
+ Archive["${home}/trader_${trader_version}.tar.gz"],
+ ],
+ }
+
+ cron::job::multiple { "py-cryptoportfolio-hourly":
+ ensure => present,
+ environment => ["HOME=${home}","PATH=/usr/bin/"],
+ require => [
+ File[$cf_bot_app_conf_hourly],
+ Archive["${home}/trader_${trader_version}.tar.gz"]
+ ],
+ jobs => [
+ {
+ command => "cd $cf_bot_app ; python main.py --config $cf_bot_app_conf_hourly",
+ user => $user,
+ minute => 30,
+ description => "Print the current state to redis",
+ },
+ ],
+ }
+ }
+
unless empty($webhook_url) {
exec { "bot-slack-notify":
refreshonly => true,