diff options
author | Jesse Luehrs <doy@tozt.net> | 2020-07-11 02:27:24 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2020-07-11 02:45:15 -0400 |
commit | d79af16f91204018bfdfd4b859a2156d9c21b87f (patch) | |
tree | 30922027d9e371464a15783da0f37a47d7b6345f | |
parent | b1075daf36e8bd4cd7c04d8a0367f97a76fa66e0 (diff) | |
download | puppet-tozt-d79af16f91204018bfdfd4b859a2156d9c21b87f.tar.gz puppet-tozt-d79af16f91204018bfdfd4b859a2156d9c21b87f.zip |
make the cron wrapper use godwrap
-rw-r--r-- | modules/cron/manifests/init.pp | 2 | ||||
-rw-r--r-- | modules/cron/templates/job | 2 | ||||
-rw-r--r-- | modules/go/manifests/init.pp | 5 | ||||
-rw-r--r-- | modules/godwrap/manifests/init.pp | 13 | ||||
-rw-r--r-- | modules/tick/files/plugins/godwrap.conf | 4 | ||||
-rw-r--r-- | modules/tick/manifests/client/base_plugins.pp | 1 | ||||
-rw-r--r-- | modules/tick/manifests/client/plugin/godwrap.pp | 7 |
7 files changed, 33 insertions, 1 deletions
diff --git a/modules/cron/manifests/init.pp b/modules/cron/manifests/init.pp index b1fd335..d715a86 100644 --- a/modules/cron/manifests/init.pp +++ b/modules/cron/manifests/init.pp @@ -1,4 +1,6 @@ class cron { + include godwrap + $from = "${facts['networking']['hostname']}-cron" $password = secret::value('cron_email_password') diff --git a/modules/cron/templates/job b/modules/cron/templates/job index cb5eb18..105de7e 100644 --- a/modules/cron/templates/job +++ b/modules/cron/templates/job @@ -1,3 +1,3 @@ #!/bin/sh -exec /etc/cronjobs/<%= @name %> +exec godwrap run --name <%= @name %> --status /media/persistent/godwrap --mode 0644 -- /etc/cronjobs/<%= @name %> diff --git a/modules/go/manifests/init.pp b/modules/go/manifests/init.pp new file mode 100644 index 0000000..dfe376c --- /dev/null +++ b/modules/go/manifests/init.pp @@ -0,0 +1,5 @@ +class go { + package { "go": + ensure => installed; + } +} diff --git a/modules/godwrap/manifests/init.pp b/modules/godwrap/manifests/init.pp new file mode 100644 index 0000000..5e7f493 --- /dev/null +++ b/modules/godwrap/manifests/init.pp @@ -0,0 +1,13 @@ +class godwrap { + include go + + package::makepkg { 'godwrap': + ensure => installed, + require => Package["go"]; + } + + file { + "/media/persistent/godwrap": + ensure => directory; + } +} diff --git a/modules/tick/files/plugins/godwrap.conf b/modules/tick/files/plugins/godwrap.conf new file mode 100644 index 0000000..0defc28 --- /dev/null +++ b/modules/tick/files/plugins/godwrap.conf @@ -0,0 +1,4 @@ +[[inputs.execd]] +command = ["/usr/bin/godwrap", "influxdb", "--execd", "--status", "/media/persistent/godwrap"] +data_format = "influx" +signal = "STDIN" diff --git a/modules/tick/manifests/client/base_plugins.pp b/modules/tick/manifests/client/base_plugins.pp index ff3df42..4a9c4df 100644 --- a/modules/tick/manifests/client/base_plugins.pp +++ b/modules/tick/manifests/client/base_plugins.pp @@ -33,6 +33,7 @@ class tick::client::base_plugins { class { [ "tick::client::plugin::duplicati", + "tick::client::plugin::godwrap", "tick::client::plugin::pacman", ]: } diff --git a/modules/tick/manifests/client/plugin/godwrap.pp b/modules/tick/manifests/client/plugin/godwrap.pp new file mode 100644 index 0000000..508e817 --- /dev/null +++ b/modules/tick/manifests/client/plugin/godwrap.pp @@ -0,0 +1,7 @@ +class tick::client::plugin::godwrap { + file { "/etc/telegraf/telegraf.d/godwrap.conf": + source => 'puppet:///modules/tick/plugins/godwrap.conf', + require => File["/etc/telegraf/telegraf.d"], + notify => Service["telegraf"]; + } +} |