Add cleanup_snaphots parameter

We need to have an option to enable cleanup of outdated snaphots
in cassandra data dir as it's meaningless to keep them on db node as
we're storing backups in specific BACKUPDIR and copy backups on
remote backup server.

Change-Id: I24e83ce5f10751a3e54192d5aa0fd864628f6270
Related-PROD: PROD-27054
(cherry picked from commit 4cba4c8aede0cb776c9820a498190f934d69ff54)
diff --git a/README.rst b/README.rst
index c6b2af8..d203fd2 100644
--- a/README.rst
+++ b/README.rst
@@ -25,6 +25,7 @@
       backup:
         client:
           enabled: true
+          cleanup_snaphots: true
           full_backups_to_keep: 3
           hours_before_full: 24
           target:
@@ -43,6 +44,7 @@
       backup:
         client:
           enabled: true
+          cleanup_snaphots: true
           full_backups_to_keep: 3
           hours_before_full: 24
           containers:
@@ -59,6 +61,7 @@
       backup:
         client:
           enabled: true
+          cleanup_snaphots: true
           full_backups_to_keep: 3
           hours_before_full: 24
 
@@ -73,6 +76,7 @@
     backup:
       client:
         enabled: true
+        cleanup_snaphots: true
         full_backups_to_keep: 3
         incr_before_full: 3
         backup_times:
diff --git a/cassandra/files/backup/cassandra-backup-client-runner-call.sh b/cassandra/files/backup/cassandra-backup-client-runner-call.sh
index 06ae68f..e507f56 100644
--- a/cassandra/files/backup/cassandra-backup-client-runner-call.sh
+++ b/cassandra/files/backup/cassandra-backup-client-runner-call.sh
@@ -138,6 +138,24 @@
 
 # Cleanup
 # ---------
+
+    {%- if backup.client.get('cleanup_snaphots', True) %}
+    echo "Cleanup old snapshots from cassandra data dir"
+
+    {%- if backup.client.containers is defined %}
+
+    {%- for container_name in backup.client.containers %}
+    docker exec {{ container_name }} nodetool -h $JMXIP clearsnapshot 2>&1
+    {%- endfor %}
+
+    {%- else %}
+
+    nodetool -h $JMXIP clearsnapshot 2>&1
+
+    {%- endif %}
+
+    {%- endif %}
+
 if [ $SKIPCLEANUP = false ] ; then
     {%- if backup.client.backup_times is not defined %}
     echo "----------------------------"
diff --git a/tests/pillar/cassandra.sls b/tests/pillar/cassandra.sls
index 64ed6c4..d0e9848 100644
--- a/tests/pillar/cassandra.sls
+++ b/tests/pillar/cassandra.sls
@@ -5,5 +5,4 @@
       cassandra-21x:
         source: "deb [arch=amd64] http://www.apache.org/dist/cassandra/debian 21x main"
         architectures: amd64
-        key_server: pool.sks-keyservers.net
-        key_id: A278B781FE4B2BDA
+        key_url: "https://www.apache.org/dist/cassandra/KEYS"