better monkey patch
diff --git a/backupninja/client.sls b/backupninja/client.sls
index 0cc1cb3..624ac05 100644
--- a/backupninja/client.sls
+++ b/backupninja/client.sls
@@ -88,8 +88,10 @@
- defaults:
service_config: {{ service_group }}/files/backupninja.conf
{%- if client.config_monkeypatch is defined and client.config_monkeypatch %}
+ {%- if service in client.monkey_patched %}
service_config_monkeypatch: {{ service_group }}/files/backupninja_monkeypatch.conf
{%- endif %}
+ {%- endif %}
- require:
- pkg: backupninja_packages
diff --git a/backupninja/files/rsync.conf b/backupninja/files/rsync.conf
index f3ae9d0..def0e5b 100644
--- a/backupninja/files/rsync.conf
+++ b/backupninja/files/rsync.conf
@@ -229,6 +229,6 @@
# fsck command
#fsck = fsck
-{%- if client.config_monkeypatch is defined and client.config_monkeypatch %}
+{%- if service_config_monkeypatch is defined %}
{% include service_config_monkeypatch %}
{%- endif %}
\ No newline at end of file
diff --git a/backupninja/map.jinja b/backupninja/map.jinja
index efc358a..75f18da 100644
--- a/backupninja/map.jinja
+++ b/backupninja/map.jinja
@@ -9,6 +9,10 @@
'taiga.server',
'webcms.server',
] %}
+{% set monkey_patched = [
+ 'leonardo.server',
+ 'postgresql.server',
+] %}
{%- if grains.osrelease >= '14.04' %}
{% set config_monkeypatch = True %}
{%- else %}
@@ -22,6 +26,7 @@
'report_email': 'root',
'config': '/etc/default/backupninja',
'supported_services': services,
+ 'monkey_patched': monkey_patched,
'config_monkeypatch': '{{ config_monkeypatch }}'
},
'RedHat': {
@@ -29,6 +34,7 @@
'service': 'backupninja',
'report_email': 'root',
'config': '/etc/sysconfig/backupninja',
+ 'monkey_patched': monkey_patched,
'supported_services': services
},
}, merge=salt['pillar.get']('backupninja:client')) %}