parametrize client restrictions

Change-Id: I9640cf46f71ede1e0d24bac0b0e3d37a2ac19de0
diff --git a/README.rst b/README.rst
index 08ba87f..b73a1ad 100644
--- a/README.rst
+++ b/README.rst
@@ -63,6 +63,14 @@
               enabled: true
               key: ssh_rsa
 
+Backup server without strict client restriction
+
+.. code-block:: yaml
+
+    cassandra:
+      backup:
+        restrict_clients: false
+
 Client restore from local backup:
 
 .. code-block:: yaml
diff --git a/cassandra/backup.sls b/cassandra/backup.sls
index 84e2272..5014073 100644
--- a/cassandra/backup.sls
+++ b/cassandra/backup.sls
@@ -127,16 +127,18 @@
 {%- if key.get('enabled', False) %}
 
 {%- set clients = [] %}
-{%- for node_name, node_grains in salt['mine.get']('*', 'grains.items').iteritems() %}
-{%- if node_grains.get('cassandra', {}).get('backup', {}).get('client') %}
-{%- set client = node_grains.get('cassandra').get('backup').get('client') %}
-{%- if client.get('addresses') and client.get('addresses', []) is iterable %}
-{%- for address in client.addresses %}
-{%- do clients.append(address|string) %}
-{%- endfor %}
+{%- if backup.restrict_clients %}
+  {%- for node_name, node_grains in salt['mine.get']('*', 'grains.items').iteritems() %}
+    {%- if node_grains.get('cassandra', {}).get('backup', {}).get('client') %}
+    {%- set client = node_grains.get('cassandra').get('backup').get('client') %}
+      {%- if client.get('addresses') and client.get('addresses', []) is iterable %}
+        {%- for address in client.addresses %}
+          {%- do clients.append(address|string) %}
+        {%- endfor %}
+      {%- endif %}
+    {%- endif %}
+  {%- endfor %}
 {%- endif %}
-{%- endif %}
-{%- endfor %}
 
 cassandra_key_{{ key.key }}:
   ssh_auth.present:
diff --git a/cassandra/map.jinja b/cassandra/map.jinja
index a2405b0..d3632a4 100644
--- a/cassandra/map.jinja
+++ b/cassandra/map.jinja
@@ -23,11 +23,13 @@
     - rsync
     backup_dir: '/var/backups/cassandra'
     cron: True
+    restrict_clients: True
   RedHat:
     pkgs:
     - rsync
     backup_dir: '/var/backups/cassandra'
     cron: True
+    restrict_clients: True
 
 {%- endload %}