From f56852c27d096cb2976debb23fc34e49de620d28 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Fri, 29 Jan 2021 18:07:57 +0100 Subject: [PATCH] bundles/postfixadmin: use tagged release --- bundles/postfixadmin/items.py | 2 +- bundles/postfixadmin/metadata.py | 19 +++++++++++++++++++ nodes/htz-cloud/pirmasens.py | 1 + nodes/htz/ex42-1048908.py | 1 + 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/bundles/postfixadmin/items.py b/bundles/postfixadmin/items.py index 7e0e201..558f85a 100644 --- a/bundles/postfixadmin/items.py +++ b/bundles/postfixadmin/items.py @@ -19,7 +19,7 @@ directories = { git_deploy = { '/opt/postfixadmin': { 'repo': 'https://github.com/postfixadmin/postfixadmin.git', - 'rev': 'master', + 'rev': 'postfixadmin-{}'.format(node.metadata['postfixadmin']['version']), }, } diff --git a/bundles/postfixadmin/metadata.py b/bundles/postfixadmin/metadata.py index 53ecc79..c677fcd 100644 --- a/bundles/postfixadmin/metadata.py +++ b/bundles/postfixadmin/metadata.py @@ -20,3 +20,22 @@ defaults = { }, }, } + + +@metadata_reactor.provides( + 'icinga2_api/postfixadmin/services', +) +def icinga_check_for_new_release(metadata): + return { + 'icinga2_api': { + 'postfixadmin': { + 'services': { + 'POSTFIXADMIN UPDATE': { + 'command_on_monitored_host': '/usr/local/share/icinga/plugins/check_github_for_new_release postfixadmin/postfixadmin postfixadmin-{}'.format(metadata.get('postfixadmin/version')), + 'vars.notification.mail': True, + 'check_interval': '60m', + }, + }, + }, + }, + } diff --git a/nodes/htz-cloud/pirmasens.py b/nodes/htz-cloud/pirmasens.py index 86a5e67..b99af88 100644 --- a/nodes/htz-cloud/pirmasens.py +++ b/nodes/htz-cloud/pirmasens.py @@ -60,6 +60,7 @@ nodes['htz-cloud.pirmasens'] = { 'message_size_limit_mb': 50, }, 'postfixadmin': { + 'version': '3.3.5', 'setup_password': vault.decrypt('encrypt$gAAAAABfpwn8NKxTztI39GzhGw66NNsWa72Wq7Sa_LoIG_L0ewCVPzhmw93xhWo3jfT8hCn9sqJgbArmPHtLMcLkSHdBPbQe0bLZMSib-mA9sEQD0wgKMyuRCPHIIMKSAoMaJaYnHSTO-mz1q7_tKzd6LkHF_AGsboS1vpQvg-CDth6e0msTwe8='), }, 'rspamd': { diff --git a/nodes/htz/ex42-1048908.py b/nodes/htz/ex42-1048908.py index 6fb0f23..cf7c70b 100644 --- a/nodes/htz/ex42-1048908.py +++ b/nodes/htz/ex42-1048908.py @@ -281,6 +281,7 @@ nodes['htz.ex42-1048908'] = { 'message_size_limit_mb': 50, }, 'postfixadmin': { + 'version': '3.3.5', 'setup_password': vault.decrypt('encrypt$gAAAAABfpwn8NKxTztI39GzhGw66NNsWa72Wq7Sa_LoIG_L0ewCVPzhmw93xhWo3jfT8hCn9sqJgbArmPHtLMcLkSHdBPbQe0bLZMSib-mA9sEQD0wgKMyuRCPHIIMKSAoMaJaYnHSTO-mz1q7_tKzd6LkHF_AGsboS1vpQvg-CDth6e0msTwe8='), }, 'radicale': {