aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/ceph-mon
diff options
context:
space:
mode:
Diffstat (limited to 'deploy/adapters/ansible/roles/ceph-mon')
-rw-r--r--deploy/adapters/ansible/roles/ceph-mon/tasks/install_mon.yml14
-rw-r--r--deploy/adapters/ansible/roles/ceph-mon/vars/Debian.yml12
-rw-r--r--deploy/adapters/ansible/roles/ceph-mon/vars/RedHat.yml12
-rw-r--r--deploy/adapters/ansible/roles/ceph-mon/vars/main.yml10
4 files changed, 42 insertions, 6 deletions
diff --git a/deploy/adapters/ansible/roles/ceph-mon/tasks/install_mon.yml b/deploy/adapters/ansible/roles/ceph-mon/tasks/install_mon.yml
index 3b818ea2..658d109e 100644
--- a/deploy/adapters/ansible/roles/ceph-mon/tasks/install_mon.yml
+++ b/deploy/adapters/ansible/roles/ceph-mon/tasks/install_mon.yml
@@ -7,20 +7,22 @@
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
+- include_vars: "{{ ansible_os_family }}.yml"
+
- name: Create a default data directory
file: path="/var/lib/ceph/mon/ceph-{{ inventory_hostname }}" state="directory"
- name: Populate the monitor daemon
shell: "ceph-mon --mkfs -i {{ inventory_hostname }} --monmap /tmp/monmap --keyring /tmp/ceph.mon.keyring"
-- name: Touch the done file
- file: path="/var/lib/ceph/mon/ceph-{{ inventory_hostname }}/done" state="touch"
+- name: Touch the done and auto start file
+ file: path="/var/lib/ceph/mon/ceph-{{ inventory_hostname }}/{{ item }}" state="touch"
+ with_items:
+ - "done"
+ - "{{ ceph_start_type }}"
- name: start mon daemon
- shell: start ceph-mon id={{ inventory_hostname }}
-
-- name: auto start ceph-mon
- file: path="/var/lib/ceph/mon/ceph-{{ inventory_hostname }}/upstart" state="touch"
+ shell: "{{ ceph_start_script }}"
- name: wait for creating osd keyring
wait_for: path=/var/lib/ceph/bootstrap-osd/ceph.keyring
diff --git a/deploy/adapters/ansible/roles/ceph-mon/vars/Debian.yml b/deploy/adapters/ansible/roles/ceph-mon/vars/Debian.yml
new file mode 100644
index 00000000..16b7989b
--- /dev/null
+++ b/deploy/adapters/ansible/roles/ceph-mon/vars/Debian.yml
@@ -0,0 +1,12 @@
+##############################################################################
+# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+---
+
+ceph_start_script: "start ceph-mon id={{ inventory_hostname }}"
+ceph_start_type: "upstart"
diff --git a/deploy/adapters/ansible/roles/ceph-mon/vars/RedHat.yml b/deploy/adapters/ansible/roles/ceph-mon/vars/RedHat.yml
new file mode 100644
index 00000000..fa19fc08
--- /dev/null
+++ b/deploy/adapters/ansible/roles/ceph-mon/vars/RedHat.yml
@@ -0,0 +1,12 @@
+##############################################################################
+# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+---
+
+ceph_start_script: "/etc/init.d/ceph start mon.{{ inventory_hostname }}"
+ceph_start_type: "sysvinit"
diff --git a/deploy/adapters/ansible/roles/ceph-mon/vars/main.yml b/deploy/adapters/ansible/roles/ceph-mon/vars/main.yml
new file mode 100644
index 00000000..466ea6ab
--- /dev/null
+++ b/deploy/adapters/ansible/roles/ceph-mon/vars/main.yml
@@ -0,0 +1,10 @@
+##############################################################################
+# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+---
+