2017-09-11 16:54:03 +08:00
|
|
|
---
|
|
|
|
- name: set config and keys paths
|
|
|
|
set_fact:
|
|
|
|
ceph_config_keys:
|
|
|
|
- /var/lib/ceph/bootstrap-osd/{{ cluster }}.keyring
|
|
|
|
|
|
|
|
- name: wait for ceph.conf and keys
|
2017-10-05 05:10:10 +08:00
|
|
|
local_action: wait_for path={{ fetch_directory }}/{{ fsid }}/{{ item }}
|
2017-09-11 16:54:03 +08:00
|
|
|
become: false
|
|
|
|
with_items: "{{ ceph_config_keys }}"
|
|
|
|
|
|
|
|
- name: stat for ceph config and keys
|
|
|
|
local_action: stat path={{ fetch_directory }}/{{ fsid }}/{{ item }}
|
|
|
|
with_items: "{{ ceph_config_keys }}"
|
|
|
|
changed_when: false
|
|
|
|
become: false
|
|
|
|
failed_when: false
|
2017-10-25 22:53:34 +08:00
|
|
|
check_mode: no
|
2017-09-11 16:54:03 +08:00
|
|
|
register: statconfig
|
|
|
|
|
|
|
|
- name: try to copy ceph config and keys
|
|
|
|
copy:
|
2017-10-05 05:10:10 +08:00
|
|
|
src: "{{ fetch_directory }}/{{ fsid }}/{{ item }}"
|
|
|
|
dest: "{{ item }}"
|
2017-09-11 16:54:03 +08:00
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
changed_when: false
|
|
|
|
with_items: "{{ ceph_config_keys }}"
|
|
|
|
|
|
|
|
- name: set selinux permissions
|
|
|
|
shell: |
|
|
|
|
chcon -Rt svirt_sandbox_file_t {{ item }}
|
|
|
|
with_items:
|
|
|
|
- "{{ ceph_conf_key_directory }}"
|
|
|
|
- /var/lib/ceph
|
|
|
|
changed_when: false
|
2017-09-15 06:48:53 +08:00
|
|
|
when:
|
2017-09-29 08:19:09 +08:00
|
|
|
- ansible_os_family == 'RedHat'
|
2017-09-15 06:48:53 +08:00
|
|
|
- sestatus.stdout != 'Disabled'
|