Merge "add requirements of ceph.conf in for states generating/updating keyrings"
diff --git a/ceph/setup/keyring.sls b/ceph/setup/keyring.sls
index d718047..5ba3c5d 100644
--- a/ceph/setup/keyring.sls
+++ b/ceph/setup/keyring.sls
@@ -34,12 +34,16 @@
- name: "ceph -c /etc/ceph/{{ ceph_cluster }}.conf auth import -i {{ keyring_path }}"
- onchanges:
- file: {{ keyring_path }}
+ - require:
+ - file: common_config
ceph_update_caps_for_{{ keyring_client_name }}:
cmd.run:
- name: ceph -c /etc/ceph/{{ ceph_cluster }}.conf auth caps client.{{ keyring_client_name }} {%- for cap_name, cap in keyring.caps.iteritems() %} {{ cap_name }} '{{ cap }}' {%- endfor %}
- onchanges:
- file: {{ keyring_path }}
+ - require:
+ - file: common_config
{%- endif %}
@@ -49,6 +53,8 @@
cmd.run:
- name: ceph -c /etc/ceph/{{ ceph_cluster }}.conf auth get-or-create client.{{ keyring_client_name }} {%- for cap_name, cap in keyring.caps.iteritems() %} {{ cap_name }} '{{ cap }}' {%- endfor %} > {{ keyring_path }}
- unless: "test -f {{ keyring_path }}"
+ - require:
+ - file: common_config
{%- if salt['file.file_exists']('/usr/bin/ceph') %}
{%- set caps = salt['cmd.shell']('ceph auth list --format json') | load_json %}
@@ -59,6 +65,9 @@
ceph_update_caps_{{ cap_name }}_for_{{ keyring_client_name }}:
cmd.run:
- name: ceph -c /etc/ceph/{{ ceph_cluster }}.conf auth caps client.{{ keyring_client_name }} {{ cap_name }} '{{ cap }}'
+ - require:
+ - file: common_config
+
{%- endif %}
{%- endfor %}
{%- endif %}