aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/ceph-config
diff options
context:
space:
mode:
authorgrakiss <grakiss.wanglei@huawei.com>2016-01-16 16:55:17 +0800
committerJustin chi <chigang@huawei.com>2016-01-30 05:16:47 +0000
commitc18316e7551812933def751fc7485c5bd57d4f3a (patch)
tree5468138bb93e2793724c08f4c9e8e93507d44c00 /deploy/adapters/ansible/roles/ceph-config
parenta7664d66d61424d6e931daf14e0cc50b82db76a7 (diff)
Use ceph_adm node to create global config
JIRA: COMPASS-276 - use ceph_adm for global config Change-Id: I9229699909aff6ba0f0f429e8a883746cf37e5dc Signed-off-by: grakiss <grakiss.wanglei@huawei.com> (cherry picked from commit 36ab89d5ddcd76c2bf7c7db5e6d60887ae44b12f)
Diffstat (limited to 'deploy/adapters/ansible/roles/ceph-config')
-rwxr-xr-xdeploy/adapters/ansible/roles/ceph-config/tasks/create_config.yml18
1 files changed, 9 insertions, 9 deletions
diff --git a/deploy/adapters/ansible/roles/ceph-config/tasks/create_config.yml b/deploy/adapters/ansible/roles/ceph-config/tasks/create_config.yml
index 0822239e..2ef9b0cd 100755
--- a/deploy/adapters/ansible/roles/ceph-config/tasks/create_config.yml
+++ b/deploy/adapters/ansible/roles/ceph-config/tasks/create_config.yml
@@ -1,14 +1,14 @@
- name: gen ceph fsid
shell: uuidgen
register: ceph_fsid
- run_once: true
+ when: inventory_hostname in groups['ceph_adm']
- name: gen ceph conf
local_action:
module: "template"
src: "ceph.j2"
dest: "/tmp/ceph.conf"
- run_once: true
+ when: inventory_hostname in groups['ceph_adm']
- name: "make directory for ceph config file"
file: path="/etc/ceph" state="directory"
@@ -23,7 +23,7 @@
- name: gen create monmap script
local_action: template src="create_monmap.j2" dest="/tmp/create_monmap.sh" mode=0755
- run_once: true
+ when: inventory_hostname in groups['ceph_adm']
- name: create monmap
script: /tmp/create_monmap.sh
@@ -31,23 +31,23 @@
- name: create mon.keyring
shell: "ceph-authtool --create-keyring /tmp/ceph.mon.keyring --gen-key -n mon. --cap mon 'allow *'"
- when: inventory_hostname == groups['ceph_mon'][0]
+ when: inventory_hostname in groups['ceph_adm']
- name: create admin.keyring
shell: "ceph-authtool --create-keyring /etc/ceph/ceph.client.admin.keyring --gen-key -n client.admin --set-uid=0 --cap mon 'allow *' --cap osd 'allow *' --cap mds 'allow'"
- when: inventory_hostname == groups['ceph_mon'][0]
-
+ when: inventory_hostname in groups['ceph_adm']
+
- name: Add the client.admin key to the ceph.mon.keyring
shell: "ceph-authtool /tmp/ceph.mon.keyring --import-keyring /etc/ceph/ceph.client.admin.keyring"
- when: inventory_hostname == groups['ceph_mon'][0]
+ when: inventory_hostname in groups['ceph_adm']
- name: fetch mon.keyring to local
fetch: src="/tmp/ceph.mon.keyring" dest="/tmp/ceph.mon.keyring" flat=yes
- when: inventory_hostname == groups['ceph_mon'][0]
+ when: inventory_hostname in groups['ceph_adm']
- name: fetch client.admin.keyring to local
fetch: src="/etc/ceph/ceph.client.admin.keyring" dest="/tmp/ceph.client.admin.keyring" flat=yes
- when: inventory_hostname == groups['ceph_mon'][0]
+ when: inventory_hostname in groups['ceph_adm']
- name: copy mon.keyring to remote nodes
copy: src="/tmp/ceph.mon.keyring" dest="/tmp/ceph.mon.keyring"