Use the ceph.conf from ceph.common (and reference to that)
diff --git a/ceph/mgr.sls b/ceph/mgr.sls
index 58e6dba..bfc58b1 100644
--- a/ceph/mgr.sls
+++ b/ceph/mgr.sls
@@ -8,13 +8,8 @@
mgr_packages:
pkg.installed:
- names: {{ mgr.pkgs }}
-
-/etc/ceph/{{ common.get('cluster_name', 'ceph') }}.conf:
- file.managed:
- - source: salt://ceph/files/{{ common.version }}/ceph.conf.{{ grains.os_family }}
- - template: jinja
- - require:
- - pkg: mgr_packages
+ - require_in:
+ - file: common_config
/var/lib/ceph/mgr/{{ common.get('cluster_name', 'ceph') }}-{{ grains.host }}/:
file.directory:
@@ -41,7 +36,7 @@
- enable: true
- names: [ceph-mgr@{{ grains.host }}]
- watch:
- - file: /etc/ceph/{{ common.get('cluster_name', 'ceph') }}.conf
+ - file: common_config
- require:
- pkg: mgr_packages
- cmd: ceph_create_mgr_keyring_{{ grains.host }}
@@ -57,11 +52,15 @@
cmd.run:
- name: "ceph -c /etc/ceph/{{ common.get('cluster_name', 'ceph') }}.conf config-key put mgr/dashboard/{{ grains.host }}/server_addr {{ mgr.dashboard.get('host', '::') }}"
- unless: "ceph -c /etc/ceph/{{ common.get('cluster_name', 'ceph') }}.conf config-key get mgr/dashboard/{{ grains.host }}/server_addr | grep {{ mgr.dashboard.get('host', '::') }}"
+ - require:
+ - file: common_config
ceph_dashboard_port:
cmd.run:
- name: "ceph -c /etc/ceph/{{ common.get('cluster_name', 'ceph') }}.conf config-key put mgr/dashboard/{{ grains.host }}/server_port {{ mgr.dashboard.get('port', '7000') }}"
- unless: "ceph -c /etc/ceph/{{ common.get('cluster_name', 'ceph') }}.conf config-key get mgr/dashboard/{{ grains.host }}/server_port | grep {{ mgr.dashboard.get('port', '7000') }}"
+ - require:
+ - file: common_config
ceph_restart_dashboard_plugin:
cmd.wait:
@@ -69,11 +68,15 @@
- watch:
- cmd: ceph_dashboard_address
- cmd: ceph_dashboard_port
+ - require:
+ - file: common_config
enable_ceph_dashboard:
cmd.run:
- name: "ceph -c /etc/ceph/{{ common.get('cluster_name', 'ceph') }}.conf mgr module enable dashboard"
- unless: "ceph -c /etc/ceph/{{ common.get('cluster_name', 'ceph') }}.conf mgr module ls | grep dashboard"
+ - require:
+ - file: common_config
{%- else %}
@@ -82,6 +85,7 @@
- name: "ceph -c /etc/ceph/{{ common.get('cluster_name', 'ceph') }}.conf mgr module disable dashboard"
- onlyif: "ceph -c /etc/ceph/{{ common.get('cluster_name', 'ceph') }}.conf mgr module ls | grep dashboard"
- require:
+ - file: common_config
- file: /var/lib/ceph/mgr/{{ common.get('cluster_name', 'ceph') }}-{{ grains.host }}/
{%- endif %}
diff --git a/ceph/mon.sls b/ceph/mon.sls
index a01a487..dc51bb4 100644
--- a/ceph/mon.sls
+++ b/ceph/mon.sls
@@ -6,13 +6,8 @@
mon_packages:
pkg.installed:
- names: {{ mon.pkgs }}
-
-/etc/ceph/{{ common.get('cluster_name', 'ceph') }}.conf:
- file.managed:
- - source: salt://ceph/files/{{ common.version }}/ceph.conf.{{ grains.os_family }}
- - template: jinja
- - require:
- - pkg: mon_packages
+ - require_in:
+ - file: common_config
cluster_{{ grains.host }}_secret_key:
cmd.run:
@@ -56,6 +51,7 @@
- unless: "test -f /var/lib/ceph/mon/{{ common.get('cluster_name', 'ceph') }}-{{ grains.host }}/kv_backend"
- require:
- pkg: mon_packages
+ - file: common_config
{% for keyring_name, keyring in mon.get('keyring', {}).iteritems() %}
@@ -102,7 +98,7 @@
- enable: true
- names: [ceph-mon@{{ grains.host }}]
- watch:
- - file: /etc/ceph/{{ common.get('cluster_name', 'ceph') }}.conf
+ - file: common_config
- require:
- pkg: mon_packages
{%- if grains.get('noservices') %}