2016-12-09 21:51:35 +08:00
|
|
|
---
|
|
|
|
- name: configure cluster name
|
|
|
|
lineinfile:
|
|
|
|
dest: /etc/sysconfig/ceph
|
|
|
|
insertafter: EOF
|
|
|
|
create: yes
|
|
|
|
line: "CLUSTER={{ cluster }}"
|
2017-10-23 21:35:59 +08:00
|
|
|
regexp: "^CLUSTER="
|
2017-09-15 06:48:53 +08:00
|
|
|
when:
|
2017-10-12 21:55:20 +08:00
|
|
|
- ansible_os_family in ["RedHat", "Suse"]
|
2016-12-09 21:51:35 +08:00
|
|
|
|
|
|
|
# NOTE(leseb): we are performing the following check
|
|
|
|
# to ensure any Jewel installation will not fail.
|
|
|
|
# The following commit https://github.com/ceph/ceph/commit/791eba81a5467dd5de4f1680ed0deb647eb3fb8b
|
|
|
|
# fixed a package issue where the path was the wrong.
|
|
|
|
# This bug is not yet on all the distros package so we are working around it
|
|
|
|
# Impacted versions:
|
|
|
|
# - Jewel from UCA: https://bugs.launchpad.net/ubuntu/+source/ceph/+bug/1582773
|
|
|
|
# - Jewel from latest Canonical 16.04 distro
|
|
|
|
# - All previous versions from Canonical
|
|
|
|
# - Infernalis from ceph.com
|
2018-09-07 20:45:43 +08:00
|
|
|
- name: debian based systems - configure cluster name
|
|
|
|
block:
|
|
|
|
- name: check /etc/default/ceph exist
|
|
|
|
stat:
|
|
|
|
path: /etc/default/ceph
|
|
|
|
register: etc_default_ceph
|
|
|
|
check_mode: no
|
2016-12-09 21:51:35 +08:00
|
|
|
|
2018-09-07 20:45:43 +08:00
|
|
|
- name: configure cluster name
|
|
|
|
block:
|
|
|
|
- name: when /etc/default/ceph is not dir
|
|
|
|
lineinfile:
|
|
|
|
dest: /etc/default/ceph
|
|
|
|
insertafter: EOF
|
|
|
|
create: yes
|
|
|
|
regexp: "^CLUSTER="
|
|
|
|
line: "CLUSTER={{ cluster }}"
|
|
|
|
when:
|
|
|
|
- not etc_default_ceph.stat.isdir
|
2016-12-09 21:51:35 +08:00
|
|
|
|
2018-09-07 20:45:43 +08:00
|
|
|
- name: when /etc/default/ceph is dir
|
|
|
|
lineinfile:
|
|
|
|
dest: /etc/default/ceph/ceph
|
|
|
|
insertafter: EOF
|
|
|
|
create: yes
|
|
|
|
regexp: "^CLUSTER="
|
|
|
|
line: "CLUSTER={{ cluster }}"
|
|
|
|
when:
|
|
|
|
- etc_default_ceph.stat.isdir
|
|
|
|
when:
|
|
|
|
- etc_default_ceph.stat.exists
|
2016-12-09 21:51:35 +08:00
|
|
|
when:
|
|
|
|
- ansible_os_family == "Debian"
|