2015-01-21 01:43:47 +08:00
|
|
|
---
|
2016-10-26 03:16:42 +08:00
|
|
|
- name: enable extras repo for centos
|
|
|
|
ini_file:
|
|
|
|
dest: /etc/yum.repos.d/CentOS-Base.repo
|
|
|
|
section: extras
|
|
|
|
option: enabled
|
|
|
|
value: 1
|
2016-10-19 19:36:49 +08:00
|
|
|
when: ansible_distribution == 'CentOS'
|
2016-10-18 04:44:30 +08:00
|
|
|
|
2016-11-28 22:16:56 +08:00
|
|
|
- name: install rependencies
|
|
|
|
package:
|
2015-10-19 09:24:47 +08:00
|
|
|
name: parted
|
|
|
|
state: present
|
2016-04-23 03:13:36 +08:00
|
|
|
when: ansible_os_family != 'ClearLinux'
|
2015-01-21 01:43:47 +08:00
|
|
|
|
2017-01-27 18:10:21 +08:00
|
|
|
- name: create bootstrap-osd and osd directories
|
2015-11-17 23:10:02 +08:00
|
|
|
file:
|
2017-01-27 18:10:21 +08:00
|
|
|
path: "{{ item }}"
|
2015-11-17 23:10:02 +08:00
|
|
|
state: directory
|
2017-01-20 17:14:35 +08:00
|
|
|
owner: "ceph"
|
|
|
|
group: "ceph"
|
|
|
|
mode: "0755"
|
|
|
|
when:
|
|
|
|
cephx
|
2017-01-27 18:10:21 +08:00
|
|
|
with_items:
|
|
|
|
- /var/lib/ceph/bootstrap-osd/
|
|
|
|
- /var/lib/ceph/osd/
|
2015-11-17 23:10:02 +08:00
|
|
|
|
2016-07-19 23:55:57 +08:00
|
|
|
- name: copy ceph admin key when using dmcrypt
|
|
|
|
set_fact:
|
|
|
|
copy_admin_key: true
|
|
|
|
when:
|
2017-07-27 23:05:59 +08:00
|
|
|
- osd_scenario == 'collocated'
|
2016-07-19 23:55:57 +08:00
|
|
|
|
2016-02-22 01:25:42 +08:00
|
|
|
- name: copy osd bootstrap key
|
2015-10-19 09:24:47 +08:00
|
|
|
copy:
|
2016-02-25 19:04:17 +08:00
|
|
|
src: "{{ fetch_directory }}/{{ fsid }}{{ item.name }}"
|
2016-02-25 19:10:45 +08:00
|
|
|
dest: "{{ item.name }}"
|
2017-01-20 17:14:35 +08:00
|
|
|
owner: "ceph"
|
|
|
|
group: "ceph"
|
|
|
|
mode: "0600"
|
2016-02-25 19:04:17 +08:00
|
|
|
with_items:
|
2016-03-29 21:37:31 +08:00
|
|
|
- { name: "/var/lib/ceph/bootstrap-osd/{{ cluster }}.keyring", copy_key: true }
|
|
|
|
- { name: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" }
|
2015-11-20 22:09:34 +08:00
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- cephx
|
|
|
|
- item.copy_key|bool
|