From 7231fcfa0dc514619d0d0c3b2c9697a0722d25fa Mon Sep 17 00:00:00 2001 From: Andreas Stuerz Date: Tue, 23 Feb 2021 10:15:07 +0100 Subject: [PATCH] add config.d services --- .../scripts/OPNsense/HAProxy/syncCerts.py | 1 - .../conf/actions.d/actions_haproxy.conf | 26 ++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/syncCerts.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/syncCerts.py index d8f3d72b0..87632bda0 100755 --- a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/syncCerts.py +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/syncCerts.py @@ -164,7 +164,6 @@ class Diff(SyncWithTarget): print(f" CERT DEL : {diff['del']}") def show_transactions(self, output_format): - if output_format == 'json': print(json.dumps({'transactions': self.transactions})) diff --git a/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf b/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf index ce1ef790b..7301e83e8 100644 --- a/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf +++ b/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf @@ -74,4 +74,28 @@ message:change haproxy state for multiple server command:/usr/local/opnsense/scripts/OPNsense/HAProxy/socketCommand.py parameters: set-server-weight --server-ids %s --value %s type:script_output -message:change haproxy weight for multiple server \ No newline at end of file +message:change haproxy weight for multiple server + +[cert_diff] +command:/usr/local/opnsense/scripts/OPNsense/HAProxy/syncCerts.py +parameters: diff --output json --frontends %s +type:script_output +message:Show diff between configured ssl certificates and certs from HAProxy memory for multiple frontends + +[cert_sync] +command:/usr/local/opnsense/scripts/OPNsense/HAProxy/syncCerts.py +parameters: sync --frontends %s --output json +type:script_output +message:Sync ssl certificates into HAProxy memory for multiple frontends + +[cert_diff_bulk] +command:/usr/local/opnsense/scripts/OPNsense/HAProxy/syncCerts.py diff --output json +parameters: +type:script_output +message:Show diff between configured ssl certificates and certs from HAProxy memory for all frontends + +[cert_sync_bulk] +command:/usr/local/opnsense/scripts/OPNsense/HAProxy/syncCerts.py sync --output json +parameters: +type:script_output +message:Sync ssl certificates into HAProxy memory for all frontends