command => "/usr/bin/make install",
require => User[$cf_user],
refreshonly => true,
+ before => [
+ File[$cf_bot_app_conf],
+ Cron["py-cryptoportfolio-before"],
+ Cron["py-cryptoportfolio-after"],
+ ]
}
file { $cf_bot_app_conf:
mode => "0600",
content => template("role/cryptoportfolio/bot_config.ini.erb")
}
+
+ cron { "py-cryptoportfolio-before":
+ ensure => present,
+ command => "cd $cf_bot_app ; python main.py --config $cf_bot_app_conf --before",
+ user => "cryptoportfolio",
+ weekday => 7, # Sunday
+ hour => 22,
+ minute => 30,
+ environment => ["HOME=${cf_home}","PATH=/usr/bin/"],
+ require => [
+ File[$cf_bot_app_conf],
+ Archive["${cf_home}/${bot_version}.tar.gz"]
+ ],
+ }
+
+ cron { "py-cryptoportfolio-after":
+ ensure => present,
+ command => "cd $cf_bot_app ; python main.py --config $cf_bot_app_conf --after",
+ user => "cryptoportfolio",
+ weekday => 1, # Monday
+ hour => 1,
+ environment => ["HOME=${cf_home}","PATH=/usr/bin/"],
+ require => [
+ File[$cf_bot_app_conf],
+ Archive["${cf_home}/${bot_version}.tar.gz"]
+ ],
+ }
}
unless empty($front_version) {