ceph-ansible/roles/ceph-client/tasks/pre_requisite.yml

46 lines
1.1 KiB
YAML

---
- name: check keys has been filled in users.key variables
fail:
msg: "you must generate and set keys properly in users.key variables"
with_items: "{{ keys }}"
when:
- user_config
- item.key == 'ADD-KEYRING-HERE=='
- name: set selinux permissions
shell: |
chcon -Rt svirt_sandbox_file_t {{ item }}
with_items:
- /etc/ceph
- /var/lib/ceph
changed_when: false
when:
- containerized_deployment
- ansible_os_family == 'RedHat'
- sestatus is defined
- sestatus.stdout != 'Disabled'
- name: copy ceph admin keyring when non containerized deployment
copy:
src: "{{ fetch_directory }}/{{ fsid }}/etc/ceph/{{ cluster }}.client.admin.keyring"
dest: "/etc/ceph/"
owner: "ceph"
group: "ceph"
mode: "0600"
when:
- not containerized_deployment
- cephx
- copy_admin_key
- name: copy ceph admin keyring when containerized deployment
copy:
src: "{{ fetch_directory }}/{{ fsid }}/etc/ceph/{{ cluster }}.client.admin.keyring"
dest: "/etc/ceph/"
owner: "{{ ceph_uid }}"
group: "{{ ceph_uid }}"
mode: "0600"
when:
- containerized_deployment
- cephx
- copy_admin_key