parametrize client restrictions

Change-Id: I8b2bc63b385ea38fd1f098b5de6dbaaf65f06b80
diff --git a/README.rst b/README.rst
index 82b14f6..1829485 100644
--- a/README.rst
+++ b/README.rst
@@ -93,7 +93,16 @@
   .. note:: If the ``backup_dir`` argument is ommited backups will be made to
   default location, same on both client and server side.
 
-Client restore from local backups: 
+
+Backup server without strict client restriction
+
+.. code-block:: yaml
+
+    xtrabackup:
+      server:
+        restrict_clients: false
+
+Client restore from local backups:
 
 .. code-block:: yaml
 
diff --git a/xtrabackup/map.jinja b/xtrabackup/map.jinja
index 3209a7a..2cd5203 100644
--- a/xtrabackup/map.jinja
+++ b/xtrabackup/map.jinja
@@ -16,11 +16,13 @@
   'Debian': {

     'pkgs': ['rsync'],

     'cron': True,

+    'restrict_clients': True,

     'backup_dir': '/var/backups/mysql/xtrabackup'

   },

   'RedHat': {

     'pkgs': ['rsync'],

     'cron': True,

+    'restrict_clients': True,

     'backup_dir': '/var/backups/mysql/xtrabackup'

   },

 }, merge=salt['pillar.get']('xtrabackup:server')) %}

diff --git a/xtrabackup/server.sls b/xtrabackup/server.sls
index 876e26f..487e5b9 100644
--- a/xtrabackup/server.sls
+++ b/xtrabackup/server.sls
@@ -47,16 +47,18 @@
 {%- if key.get('enabled', False) %}
 
 {%- set clients = [] %}
-{%- for node_name, node_grains in salt['mine.get']('*', 'grains.items').iteritems() %}
-{%- if node_grains.get('xtrabackup', {}).get('client') %}
-{%- set client = node_grains.xtrabackup.get("client") %}
-{%- if client.get('addresses') and client.get('addresses', []) is iterable %}
-{%- for address in client.addresses %}
-{%- do clients.append(address|string) %}
-{%- endfor %}
+{%- if server.restrict_clients %}
+  {%- for node_name, node_grains in salt['mine.get']('*', 'grains.items').iteritems() %}
+    {%- if node_grains.get('xtrabackup', {}).get('client') %}
+    {%- set client = node_grains.xtrabackup.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 %}
 
 xtrabackup_key_{{ key.key }}:
   ssh_auth.present: