2016-05-06 02:20:03 +08:00
|
|
|
---
|
2018-09-07 20:45:43 +08:00
|
|
|
- name: include red hat based system related tasks
|
|
|
|
include_tasks: pre_requisite_non_container_red_hat.yml
|
2021-03-03 22:43:50 +08:00
|
|
|
when: ansible_facts['os_family'] == 'RedHat'
|
2017-10-10 03:34:17 +08:00
|
|
|
|
2018-09-07 20:45:43 +08:00
|
|
|
- name: include debian based system related tasks
|
|
|
|
include_tasks: pre_requisite_non_container_debian.yml
|
2021-03-03 22:43:50 +08:00
|
|
|
when: ansible_facts['os_family'] == 'Debian'
|
2017-10-09 23:10:39 +08:00
|
|
|
|
2019-08-22 00:17:00 +08:00
|
|
|
- name: install nfs rgw/cephfs gateway - SUSE/openSUSE
|
2017-12-19 18:17:04 +08:00
|
|
|
zypper:
|
2018-03-22 20:19:22 +08:00
|
|
|
name: "{{ item.name }}"
|
2017-12-19 18:17:04 +08:00
|
|
|
disable_gpg_check: yes
|
2017-10-09 23:10:39 +08:00
|
|
|
with_items:
|
2018-03-22 20:19:22 +08:00
|
|
|
- { name: 'nfs-ganesha-rgw', install: "{{ nfs_obj_gw }}" }
|
|
|
|
- { name: 'radosgw', install: "{{ nfs_obj_gw }}" }
|
|
|
|
- { name: 'nfs-ganesha-ceph', install: "{{ nfs_file_gw }}" }
|
2017-10-09 23:10:39 +08:00
|
|
|
when:
|
|
|
|
- (ceph_origin == 'repository' or ceph_origin == 'distro')
|
|
|
|
- ceph_repository != 'rhcs'
|
2021-03-03 22:43:50 +08:00
|
|
|
- ansible_facts['os_family'] == 'Suse'
|
2018-03-22 20:19:22 +08:00
|
|
|
- item.install | bool
|
2018-12-20 17:00:26 +08:00
|
|
|
register: result
|
|
|
|
until: result is succeeded
|
2017-12-19 18:17:04 +08:00
|
|
|
|
2017-09-27 05:16:43 +08:00
|
|
|
# NOTE (leseb): we use root:ceph for permissions since ganesha
|
|
|
|
# does not have the right selinux context to read ceph directories.
|
2017-09-19 22:19:14 +08:00
|
|
|
- name: create rados gateway and ganesha directories
|
2017-09-11 11:34:36 +08:00
|
|
|
file:
|
2018-03-11 03:27:10 +08:00
|
|
|
path: "{{ item.name }}"
|
2017-09-11 11:34:36 +08:00
|
|
|
state: directory
|
2020-01-20 19:44:23 +08:00
|
|
|
owner: "{{ item.owner | default('ceph') }}"
|
|
|
|
group: "{{ item.group | default('ceph') }}"
|
2020-01-21 22:30:16 +08:00
|
|
|
mode: "{{ ceph_directories_mode }}"
|
2017-09-11 11:34:36 +08:00
|
|
|
with_items:
|
2018-03-11 03:27:10 +08:00
|
|
|
- { name: "/var/lib/ceph/bootstrap-rgw", create: "{{ nfs_obj_gw }}" }
|
|
|
|
- { name: "/var/lib/ceph/radosgw", create: "{{ nfs_obj_gw }}" }
|
2021-03-03 22:43:50 +08:00
|
|
|
- { name: "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_facts['hostname'] }}", create: "{{ nfs_obj_gw }}" }
|
2018-03-11 03:27:10 +08:00
|
|
|
- { name: "{{ rbd_client_admin_socket_path }}", create: "{{ nfs_obj_gw }}" }
|
|
|
|
- { name: "/var/log/ceph", create: true }
|
2020-01-20 19:44:23 +08:00
|
|
|
- { name: "/var/log/ganesha", create: true, owner: root, group: root }
|
2018-03-11 03:27:10 +08:00
|
|
|
- { name: "/var/run/ceph", create: true }
|
2019-05-22 16:02:42 +08:00
|
|
|
when: item.create | bool
|
2017-09-11 11:34:36 +08:00
|
|
|
|
2018-09-07 20:45:43 +08:00
|
|
|
- name: cephx related tasks
|
2019-05-20 21:58:10 +08:00
|
|
|
when:
|
2019-05-22 16:02:42 +08:00
|
|
|
- cephx | bool
|
2019-05-20 21:58:10 +08:00
|
|
|
- groups.get(mon_group_name, []) | length > 0
|
2018-09-07 20:45:43 +08:00
|
|
|
block:
|
2019-09-23 19:30:05 +08:00
|
|
|
- name: get keys from monitors
|
2020-10-24 03:19:53 +08:00
|
|
|
ceph_key:
|
|
|
|
name: "{{ item.name }}"
|
|
|
|
cluster: "{{ cluster }}"
|
|
|
|
output_format: plain
|
|
|
|
state: info
|
2019-09-23 19:30:05 +08:00
|
|
|
register: _rgw_keys
|
2019-05-12 19:10:30 +08:00
|
|
|
with_items:
|
2020-08-07 16:12:50 +08:00
|
|
|
- { name: "client.bootstrap-rgw", path: "/var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring", copy_key: "{{ nfs_obj_gw }}" }
|
2019-09-23 19:30:05 +08:00
|
|
|
- { name: "client.admin", path: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" }
|
|
|
|
delegate_to: "{{ groups.get(mon_group_name)[0] }}"
|
2019-10-02 15:57:50 +08:00
|
|
|
run_once: true
|
2019-09-23 19:30:05 +08:00
|
|
|
when:
|
|
|
|
- cephx | bool
|
|
|
|
- item.copy_key | bool
|
2021-08-09 20:57:33 +08:00
|
|
|
no_log: "{{ no_log_on_ceph_key_tasks }}"
|
2019-09-23 19:30:05 +08:00
|
|
|
|
|
|
|
- name: copy ceph key(s) if needed
|
|
|
|
copy:
|
|
|
|
dest: "{{ item.item.path }}"
|
|
|
|
content: "{{ item.stdout + '\n' }}"
|
2020-09-26 00:15:02 +08:00
|
|
|
owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
|
|
|
|
group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
|
2019-09-23 19:30:05 +08:00
|
|
|
mode: "{{ ceph_keyring_permissions }}"
|
|
|
|
with_items: "{{ _rgw_keys.results }}"
|
|
|
|
when:
|
|
|
|
- cephx | bool
|
|
|
|
- item.item.copy_key | bool
|
2021-08-09 20:57:33 +08:00
|
|
|
no_log: "{{ no_log_on_ceph_key_tasks }}"
|
2018-09-07 20:45:43 +08:00
|
|
|
|
|
|
|
- name: nfs object gateway related tasks
|
2019-05-22 16:02:42 +08:00
|
|
|
when: nfs_obj_gw | bool
|
2018-09-07 20:45:43 +08:00
|
|
|
block:
|
|
|
|
- name: create rados gateway keyring
|
2020-10-24 06:03:49 +08:00
|
|
|
ceph_key:
|
2021-03-03 22:43:50 +08:00
|
|
|
name: "client.rgw.{{ ansible_facts['hostname'] }}"
|
2020-10-24 06:03:49 +08:00
|
|
|
cluster: "{{ cluster }}"
|
|
|
|
user: client.bootstrap-rgw
|
|
|
|
user_key: "/var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring"
|
|
|
|
caps:
|
|
|
|
mon: "allow rw"
|
|
|
|
osd: "allow rwx"
|
2021-03-03 22:43:50 +08:00
|
|
|
dest: "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_facts['hostname'] }}/keyring"
|
2020-10-24 06:03:49 +08:00
|
|
|
import_key: false
|
|
|
|
owner: ceph
|
|
|
|
group: ceph
|
|
|
|
mode: "{{ ceph_keyring_permissions }}"
|
2021-08-09 20:57:33 +08:00
|
|
|
no_log: "{{ no_log_on_ceph_key_tasks }}"
|