parametrize client restrictions
Change-Id: I4c21f6190a5dcc9b70ff60143cceae94cdeb834a
diff --git a/README.rst b/README.rst
index eb74d17..8450bf9 100644
--- a/README.rst
+++ b/README.rst
@@ -721,6 +721,14 @@
enabled: true
key: ssh_rsa
+Backup server without strict client restriction
+
+.. code-block:: yaml
+
+ ceph:
+ backup:
+ restrict_clients: false
+
Migration from Decapod to salt-formula-ceph
--------------------------------------------
diff --git a/ceph/backup.sls b/ceph/backup.sls
index 44c18a6..c4601e5 100644
--- a/ceph/backup.sls
+++ b/ceph/backup.sls
@@ -88,16 +88,18 @@
{%- if key.get('enabled', False) %}
{%- set clients = [] %}
-{%- for node_name, node_grains in salt['mine.get']('*', 'grains.items').iteritems() %}
-{%- if node_grains.get('ceph_backup', {}).get('client') %}
-{%- set client = node_grains.get('ceph_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('ceph_backup', {}).get('client') %}
+ {%- set client = node_grains.get('ceph_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 %}
ceph_key_{{ key.key }}:
ssh_auth.present:
diff --git a/ceph/map.jinja b/ceph/map.jinja
index 4873230..b8eb105 100644
--- a/ceph/map.jinja
+++ b/ceph/map.jinja
@@ -98,11 +98,13 @@
- rsync
backup_dir: '/var/backups/ceph'
cron: True
+ restrict_clients: True
RedHat:
pkgs:
- rsync
backup_dir: '/var/backups/ceph'
cron: True
+ restrict_clients: True
{%- endload %}