2014-03-04 02:08:51 +08:00
|
|
|
---
|
2015-07-24 02:01:43 +08:00
|
|
|
- include: ./checks/check_system.yml
|
2014-03-04 02:08:51 +08:00
|
|
|
|
2015-07-24 02:01:43 +08:00
|
|
|
- include: ./checks/check_mandatory_vars.yml
|
2015-07-04 02:18:41 +08:00
|
|
|
|
2016-01-08 23:36:31 +08:00
|
|
|
- include: ./checks/check_firewall.yml
|
2016-06-06 20:08:53 +08:00
|
|
|
when: check_firewall
|
2016-01-08 23:36:31 +08:00
|
|
|
|
2015-07-24 02:01:43 +08:00
|
|
|
- include: ./misc/system_tuning.yml
|
2015-07-01 00:13:03 +08:00
|
|
|
when: osd_group_name in group_names
|
2014-09-05 03:14:11 +08:00
|
|
|
|
2015-07-24 02:01:43 +08:00
|
|
|
- include: ./pre_requisites/prerequisite_ice.yml
|
2014-12-18 01:01:44 +08:00
|
|
|
when: ceph_stable_ice
|
2016-02-04 01:27:16 +08:00
|
|
|
tags:
|
|
|
|
- package-install
|
2014-12-18 01:01:44 +08:00
|
|
|
|
2015-07-24 02:01:43 +08:00
|
|
|
- include: ./pre_requisites/prerequisite_rh_storage_iso_install.yml
|
2015-07-03 22:56:34 +08:00
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- ceph_stable_rh_storage
|
|
|
|
- ceph_stable_rh_storage_iso_install
|
2016-02-04 01:27:16 +08:00
|
|
|
tags:
|
|
|
|
- package-install
|
2015-07-03 00:23:11 +08:00
|
|
|
|
2015-07-24 02:01:43 +08:00
|
|
|
- include: ./pre_requisites/prerequisite_rh_storage_cdn_install.yml
|
2015-07-03 22:56:34 +08:00
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- ceph_stable_rh_storage
|
|
|
|
- ceph_stable_rh_storage_cdn_install
|
|
|
|
- ansible_os_family == "RedHat"
|
2016-02-04 01:27:16 +08:00
|
|
|
tags:
|
|
|
|
- package-install
|
2015-07-01 21:58:38 +08:00
|
|
|
|
2015-07-24 02:01:43 +08:00
|
|
|
- include: ./installs/install_on_redhat.yml
|
2015-01-07 18:25:34 +08:00
|
|
|
when: ansible_os_family == 'RedHat'
|
2016-02-04 01:27:16 +08:00
|
|
|
tags:
|
|
|
|
- package-install
|
2016-05-24 22:10:37 +08:00
|
|
|
|
|
|
|
- include: ./installs/install_rh_storage_on_redhat.yml
|
|
|
|
when:
|
|
|
|
- ansible_distribution == "RedHat"
|
|
|
|
- ceph_stable_rh_storage
|
|
|
|
tags:
|
|
|
|
- package-install
|
2015-01-07 18:25:34 +08:00
|
|
|
|
2015-07-24 02:01:43 +08:00
|
|
|
- include: ./installs/install_on_debian.yml
|
2016-03-09 05:23:32 +08:00
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- ansible_os_family == 'Debian'
|
|
|
|
- not ceph_stable_rh_storage
|
2016-03-09 05:23:32 +08:00
|
|
|
tags:
|
|
|
|
- package-install
|
|
|
|
|
|
|
|
- include: ./installs/install_rh_storage_on_debian.yml
|
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- ansible_os_family == 'Debian'
|
|
|
|
- ceph_stable_rh_storage
|
2016-02-04 01:27:16 +08:00
|
|
|
tags:
|
|
|
|
- package-install
|
2015-01-07 18:25:34 +08:00
|
|
|
|
2015-08-03 23:39:57 +08:00
|
|
|
- include: ./installs/install_rgw_on_redhat.yml
|
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- ansible_os_family == 'RedHat'
|
|
|
|
- radosgw_frontend == 'apache'
|
|
|
|
- rgw_group_name in group_names
|
2016-02-04 01:27:16 +08:00
|
|
|
tags:
|
|
|
|
- package-install
|
2015-08-03 23:39:57 +08:00
|
|
|
|
|
|
|
- include: ./installs/install_rgw_on_debian.yml
|
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- ansible_os_family == 'Debian'
|
|
|
|
- radosgw_frontend == 'apache'
|
|
|
|
- rgw_group_name in group_names
|
2016-02-04 01:27:16 +08:00
|
|
|
tags:
|
|
|
|
- package-install
|
2015-08-03 23:39:57 +08:00
|
|
|
|
2016-04-27 22:34:08 +08:00
|
|
|
- include: facts.yml
|
|
|
|
|
2016-02-02 22:10:24 +08:00
|
|
|
- set_fact:
|
|
|
|
dir_owner: ceph
|
|
|
|
dir_group: ceph
|
2016-02-09 17:51:31 +08:00
|
|
|
dir_mode: "0755"
|
2016-04-27 21:50:10 +08:00
|
|
|
when: is_after_hammer
|
2016-02-02 22:10:24 +08:00
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
dir_owner: root
|
|
|
|
dir_group: root
|
2016-02-09 17:51:31 +08:00
|
|
|
dir_mode: "0755"
|
2016-04-27 21:50:10 +08:00
|
|
|
when: is_before_infernalis
|
2016-02-02 22:10:24 +08:00
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
key_owner: root
|
|
|
|
key_group: root
|
2016-02-09 17:51:31 +08:00
|
|
|
key_mode: "0600"
|
2016-04-27 21:50:10 +08:00
|
|
|
when: is_before_infernalis
|
2016-02-02 22:10:24 +08:00
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
key_owner: ceph
|
|
|
|
key_group: ceph
|
2016-02-09 17:51:31 +08:00
|
|
|
key_mode: "0600"
|
2016-04-27 21:50:10 +08:00
|
|
|
when: is_after_hammer
|
2016-02-02 22:10:24 +08:00
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
activate_file_owner: ceph
|
|
|
|
activate_file_group: ceph
|
2016-02-09 17:51:31 +08:00
|
|
|
activate_file_mode: "0644"
|
2016-04-27 21:50:10 +08:00
|
|
|
when: is_after_hammer
|
2016-02-02 22:10:24 +08:00
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
activate_file_owner: root
|
|
|
|
activate_file_group: root
|
2016-02-09 17:51:31 +08:00
|
|
|
activate_file_mode: "0644"
|
2016-04-27 21:50:10 +08:00
|
|
|
when: is_before_infernalis
|
2016-02-02 22:10:24 +08:00
|
|
|
|
|
|
|
- set_fact:
|
2016-04-07 22:11:50 +08:00
|
|
|
rbd_client_directory_owner: root
|
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- is_before_infernalis
|
|
|
|
- rbd_client_directory_owner is not defined
|
|
|
|
or not rbd_client_directory_owner
|
2016-02-02 22:10:24 +08:00
|
|
|
|
|
|
|
- set_fact:
|
2016-04-07 22:11:50 +08:00
|
|
|
rbd_client_directory_owner: ceph
|
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- is_after_hammer
|
|
|
|
- rbd_client_directory_owner is not defined
|
|
|
|
or not rbd_client_directory_owner
|
2016-04-07 22:11:50 +08:00
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
rbd_client_directory_group: root
|
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- is_before_infernalis
|
|
|
|
- rbd_client_directory_group is not defined
|
|
|
|
or not rbd_client_directory_group
|
2016-04-07 22:11:50 +08:00
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
rbd_client_directory_group: ceph
|
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- is_after_hammer
|
|
|
|
- rbd_client_directory_group is not defined
|
|
|
|
or not rbd_client_directory_group
|
2016-04-07 22:11:50 +08:00
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
rbd_client_directory_mode: "1777"
|
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- is_before_infernalis
|
|
|
|
- rbd_client_directory_mode is not defined
|
|
|
|
or not rbd_client_directory_mode
|
2016-04-07 22:11:50 +08:00
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
rbd_client_directory_mode: "0770"
|
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- is_after_hammer
|
|
|
|
- rbd_client_directory_mode is not defined
|
|
|
|
or not rbd_client_directory_mode
|
2016-02-02 22:10:24 +08:00
|
|
|
|
2015-07-24 02:01:43 +08:00
|
|
|
- name: check for a ceph socket
|
2015-08-07 13:07:51 +08:00
|
|
|
shell: "stat /var/run/ceph/*.asok > /dev/null 2>&1"
|
2015-06-26 06:26:03 +08:00
|
|
|
changed_when: false
|
2015-07-29 00:21:15 +08:00
|
|
|
failed_when: false
|
2015-01-07 18:25:34 +08:00
|
|
|
register: socket
|
|
|
|
|
2015-07-01 00:07:03 +08:00
|
|
|
- name: check for a rados gateway socket
|
2015-08-07 13:07:51 +08:00
|
|
|
shell: "stat {{ rbd_client_admin_socket_path }}*.asok > /dev/null 2>&1"
|
2015-07-01 00:07:03 +08:00
|
|
|
changed_when: false
|
2015-07-29 00:21:15 +08:00
|
|
|
failed_when: false
|
2015-07-01 00:07:03 +08:00
|
|
|
register: socketrgw
|
|
|
|
|
2015-11-20 22:09:34 +08:00
|
|
|
- name: create a local fetch directory if it does not exist
|
2015-08-27 18:42:01 +08:00
|
|
|
local_action: file path={{ fetch_directory }} state=directory
|
2015-07-25 11:10:39 +08:00
|
|
|
changed_when: false
|
2016-02-04 19:36:46 +08:00
|
|
|
become: false
|
2015-08-26 17:49:22 +08:00
|
|
|
run_once: true
|
2016-05-09 22:08:33 +08:00
|
|
|
when: cephx or generate_fsid
|
2015-07-25 11:10:39 +08:00
|
|
|
|
2015-07-24 02:01:43 +08:00
|
|
|
- name: generate cluster uuid
|
2016-06-03 20:23:21 +08:00
|
|
|
local_action: shell python -c 'import uuid; print(str(uuid.uuid4()))' | tee {{ fetch_directory }}/ceph_cluster_uuid.conf
|
2015-09-04 00:18:53 +08:00
|
|
|
creates="{{ fetch_directory }}/ceph_cluster_uuid.conf"
|
2015-01-07 18:25:34 +08:00
|
|
|
register: cluster_uuid
|
2016-02-04 19:36:46 +08:00
|
|
|
become: false
|
2016-02-26 00:29:12 +08:00
|
|
|
when: generate_fsid
|
2015-01-07 18:25:34 +08:00
|
|
|
|
2015-07-24 02:01:43 +08:00
|
|
|
- name: read cluster uuid if it already exists
|
2015-08-27 18:42:01 +08:00
|
|
|
local_action: command cat {{ fetch_directory }}/ceph_cluster_uuid.conf
|
2015-09-04 00:18:53 +08:00
|
|
|
removes="{{ fetch_directory }}/ceph_cluster_uuid.conf"
|
2015-06-26 06:26:03 +08:00
|
|
|
changed_when: false
|
2015-01-07 18:25:34 +08:00
|
|
|
register: cluster_uuid
|
2016-02-04 19:36:46 +08:00
|
|
|
become: false
|
2016-02-26 00:29:12 +08:00
|
|
|
when: generate_fsid
|
2015-01-07 18:25:34 +08:00
|
|
|
|
2015-11-06 04:39:03 +08:00
|
|
|
- name: create ceph conf directory
|
|
|
|
file:
|
2016-01-23 00:43:47 +08:00
|
|
|
path: /etc/ceph
|
|
|
|
state: directory
|
2016-02-29 18:10:56 +08:00
|
|
|
owner: "{{ dir_owner }}"
|
|
|
|
group: "{{ dir_group }}"
|
|
|
|
mode: "{{ dir_mode }}"
|
2015-11-06 04:39:03 +08:00
|
|
|
|
2015-07-24 02:01:43 +08:00
|
|
|
- name: generate ceph configuration file
|
2016-02-15 03:58:04 +08:00
|
|
|
action: config_template
|
|
|
|
args:
|
2015-09-04 00:18:53 +08:00
|
|
|
src: ceph.conf.j2
|
2016-03-29 21:37:31 +08:00
|
|
|
dest: /etc/ceph/{{ cluster }}.conf
|
2016-02-29 18:10:56 +08:00
|
|
|
owner: "{{ dir_owner }}"
|
|
|
|
group: "{{ dir_group }}"
|
|
|
|
mode: "{{ activate_file_mode }}"
|
2015-12-16 23:11:14 +08:00
|
|
|
config_overrides: "{{ ceph_conf_overrides }}"
|
|
|
|
config_type: ini
|
2015-01-07 18:25:34 +08:00
|
|
|
notify:
|
2015-03-03 00:13:30 +08:00
|
|
|
- restart ceph mons
|
2015-07-01 00:07:03 +08:00
|
|
|
- restart ceph mons on ubuntu
|
2015-11-21 05:34:29 +08:00
|
|
|
- restart ceph mons with systemd
|
2015-03-03 00:13:30 +08:00
|
|
|
- restart ceph osds
|
|
|
|
- restart ceph osds on ubuntu
|
2015-11-21 05:34:29 +08:00
|
|
|
- restart ceph osds with systemd
|
2015-03-03 00:13:30 +08:00
|
|
|
- restart ceph mdss
|
2015-07-01 00:07:03 +08:00
|
|
|
- restart ceph mdss on ubuntu
|
2015-11-21 05:34:29 +08:00
|
|
|
- restart ceph mdss with systemd
|
2015-03-03 00:13:30 +08:00
|
|
|
- restart ceph rgws
|
2015-07-01 00:07:03 +08:00
|
|
|
- restart ceph rgws on ubuntu
|
|
|
|
- restart ceph rgws on red hat
|
2015-11-21 05:34:29 +08:00
|
|
|
- restart ceph rgws with systemd
|
2015-06-17 19:44:05 +08:00
|
|
|
|
2016-02-02 22:10:24 +08:00
|
|
|
- name: create rbd client directory
|
2015-09-04 00:18:53 +08:00
|
|
|
file:
|
2016-04-07 22:11:50 +08:00
|
|
|
path: "{{ item }}"
|
2015-09-04 00:18:53 +08:00
|
|
|
state: directory
|
2016-04-07 22:11:50 +08:00
|
|
|
owner: "{{ rbd_client_directory_owner }}"
|
|
|
|
group: "{{ rbd_client_directory_group }}"
|
|
|
|
mode: "{{ rbd_client_directory_mode }}"
|
|
|
|
with_items:
|
2016-04-14 04:10:44 +08:00
|
|
|
- "{{ rbd_client_admin_socket_path }}"
|
|
|
|
- "{{ rbd_client_log_path }}"
|
2016-04-07 22:11:50 +08:00
|
|
|
when: rbd_client_directories
|
2016-03-29 21:37:31 +08:00
|
|
|
|
|
|
|
- name: configure cluster name
|
|
|
|
lineinfile:
|
|
|
|
dest: /etc/sysconfig/ceph
|
|
|
|
insertafter: EOF
|
2016-04-06 09:33:05 +08:00
|
|
|
create: yes
|
2016-03-29 21:37:31 +08:00
|
|
|
line: "CLUSTER={{ cluster }}"
|
2016-05-09 22:08:33 +08:00
|
|
|
when: ansible_os_family == "RedHat"
|
2016-03-29 21:37:31 +08:00
|
|
|
|
2016-05-17 00:55:54 +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
|
2016-05-17 17:47:25 +08:00
|
|
|
# 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
|
2016-05-17 00:37:28 +08:00
|
|
|
- name: check /etc/default/ceph exist
|
|
|
|
stat:
|
|
|
|
path: /etc/default/ceph
|
|
|
|
register: etc_default_ceph
|
|
|
|
when: ansible_os_family == "Debian"
|
|
|
|
|
2016-03-29 21:37:31 +08:00
|
|
|
- name: configure cluster name
|
|
|
|
lineinfile:
|
2016-05-14 04:01:00 +08:00
|
|
|
dest: /etc/default/ceph
|
2016-03-29 21:37:31 +08:00
|
|
|
insertafter: EOF
|
2016-04-06 09:33:05 +08:00
|
|
|
create: yes
|
2016-03-29 21:37:31 +08:00
|
|
|
line: "CLUSTER={{ cluster }}"
|
2016-05-17 00:37:28 +08:00
|
|
|
when:
|
|
|
|
- ansible_os_family == "Debian"
|
|
|
|
- etc_default_ceph.stat.exists
|
|
|
|
- not etc_default_ceph.stat.isdir
|
|
|
|
|
|
|
|
- name: configure cluster name
|
|
|
|
lineinfile:
|
|
|
|
dest: /etc/default/ceph/ceph
|
|
|
|
insertafter: EOF
|
|
|
|
create: yes
|
|
|
|
line: "CLUSTER={{ cluster }}"
|
|
|
|
when:
|
|
|
|
- ansible_os_family == "Debian"
|
|
|
|
- etc_default_ceph.stat.exists
|
|
|
|
- etc_default_ceph.stat.isdir
|