possibility to absent public key from server and crons
PROD-17856
Change-Id: Id52a161f9dda801ed750d7de1b1e1c177f36f6e2
diff --git a/ceph/backup.sls b/ceph/backup.sls
index fb45576..d66ebb8 100644
--- a/ceph/backup.sls
+++ b/ceph/backup.sls
@@ -33,13 +33,12 @@
- group: root
- makedirs: true
+{%- if backup.cron %}
+
ceph_backup_runner_cron:
cron.present:
- name: /usr/local/bin/ceph-backup-runner-call.sh
- user: root
-{%- if not backup.cron %}
- - commented: True
-{%- endif %}
{%- if backup.client.backup_times is defined %}
{%- if backup.client.backup_times.dayOfWeek is defined %}
- dayweek: {{ backup.client.backup_times.dayOfWeek }}
@@ -70,6 +69,12 @@
- file: ceph_backup_runner_script
- file: ceph_call_backup_runner_script
+{%- else %}
+
+ceph_backup_runner_cron:
+ cron.absent:
+ - name: /usr/local/bin/ceph-backup-runner-call.sh
+ - user: root
{%- endif %}
@@ -129,6 +134,12 @@
- require:
- file: {{ backup.backup_dir }}/full
+{%- else %}
+
+ceph_key_{{ key.key }}:
+ ssh_auth.absent:
+ - user: ceph
+ - name: {{ key.key }}
{%- endif %}
@@ -143,13 +154,12 @@
- require:
- pkg: ceph_backup_server_packages
+{%- if backup.cron %}
+
ceph_server_cron:
cron.present:
- name: /usr/local/bin/ceph-backup-runner.sh
- user: ceph
-{%- if not backup.cron %}
- - commented: True
-{%- endif %}
{%- if backup.server.backup_times is defined %}
{%- if backup.server.backup_times.dayOfWeek is defined %}
- dayweek: {{ backup.server.backup_times.dayOfWeek }}
@@ -179,6 +189,13 @@
- require:
- file: ceph_server_script
+{%- else %}
+
+ceph_server_cron:
+ cron.absent:
+ - name: /usr/local/bin/ceph-backup-runner.sh
+ - user: ceph
+
{%- endif %}
{%- endif %}