diff options
author | Jesse Luehrs <doy@tozt.net> | 2019-08-23 23:37:11 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2019-08-23 23:37:11 -0400 |
commit | 28a9ca85a444048b19b6d415472cf27403473280 (patch) | |
tree | 562489aed7d70b8ff38214b7f9b6a83d9b84c0a1 | |
parent | 60bd703b3fb0b10281fbbf2e9152e46fdd3054cb (diff) | |
download | puppet-tozt-28a9ca85a444048b19b6d415472cf27403473280.tar.gz puppet-tozt-28a9ca85a444048b19b6d415472cf27403473280.zip |
add cronjob to reload ynab data
-rw-r--r-- | modules/tozt/files/ynab-export | 4 | ||||
-rw-r--r-- | modules/tozt/manifests/metabase.pp | 22 |
2 files changed, 26 insertions, 0 deletions
diff --git a/modules/tozt/files/ynab-export b/modules/tozt/files/ynab-export new file mode 100644 index 0000000..c7f906a --- /dev/null +++ b/modules/tozt/files/ynab-export @@ -0,0 +1,4 @@ +#!/bin/sh +set -eu + +/opt/ynab-export/bin/load diff --git a/modules/tozt/manifests/metabase.pp b/modules/tozt/manifests/metabase.pp index fac88a9..e6ab163 100644 --- a/modules/tozt/manifests/metabase.pp +++ b/modules/tozt/manifests/metabase.pp @@ -19,4 +19,26 @@ class tozt::metabase { "metabase": source => 'puppet:///modules/tozt/nginx/metabase.conf'; } + + file { + "/root/.config/ynab": + ensure => directory, + require => Conf::User["root"]; + "/etc/cron.hourly/ynab-export": + mode => '0755', + source => "puppet:///modules/tozt/ynab-export", + require => Exec["clone ynab-export"]; + } + + secret { "/root/.config/ynab/api-key": + source => "ynab", + require => File["/root/.config/ynab"]; + } + + exec { "clone ynab-export": + command => "/usr/bin/git clone git://github.com/doy/ynab-export", + cwd => "/opt", + creates => "/opt/ynab-export", + require => Class['git']; + } } |