From 28a9ca85a444048b19b6d415472cf27403473280 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 23 Aug 2019 23:37:11 -0400 Subject: add cronjob to reload ynab data --- modules/tozt/files/ynab-export | 4 ++++ modules/tozt/manifests/metabase.pp | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 modules/tozt/files/ynab-export 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']; + } } -- cgit v1.2.3-54-g00ecf