2016-05-06 02:20:03 +08:00
|
|
|
---
|
2019-10-07 16:34:07 +08:00
|
|
|
# global/common requirement
|
|
|
|
- name: stop nfs server service
|
|
|
|
systemd:
|
2021-03-03 22:43:50 +08:00
|
|
|
name: "{{ 'nfs-server' if ansible_facts['os_family'] == 'RedHat' else 'nfsserver' if ansible_facts['os_family'] == 'Suse' else 'nfs-kernel-server' if ansible_facts['os_family'] == 'Debian' }}"
|
2019-10-07 16:34:07 +08:00
|
|
|
state: stopped
|
|
|
|
enabled: no
|
|
|
|
failed_when: false
|
|
|
|
|
2017-09-27 05:16:43 +08:00
|
|
|
- name: include pre_requisite_non_container.yml
|
2018-08-21 22:23:35 +08:00
|
|
|
include_tasks: pre_requisite_non_container.yml
|
2019-05-22 16:02:42 +08:00
|
|
|
when: not containerized_deployment | bool
|
2017-09-19 22:19:14 +08:00
|
|
|
|
2017-09-27 05:16:43 +08:00
|
|
|
- name: include pre_requisite_container.yml
|
2018-08-21 22:23:35 +08:00
|
|
|
include_tasks: pre_requisite_container.yml
|
2019-05-22 16:02:42 +08:00
|
|
|
when: containerized_deployment | bool
|
2017-09-27 05:16:43 +08:00
|
|
|
|
2023-08-04 15:45:28 +08:00
|
|
|
- name: set_fact _rgw_hostname
|
|
|
|
set_fact:
|
2024-02-13 23:01:38 +08:00
|
|
|
_rgw_hostname: "{{ hostvars[inventory_hostname]['ansible_facts']['hostname'] }}"
|
2023-08-04 15:45:28 +08:00
|
|
|
|
|
|
|
- name: set rgw parameter (log file)
|
|
|
|
ceph_config:
|
|
|
|
action: set
|
|
|
|
who: "client.rgw.{{ _rgw_hostname }}"
|
|
|
|
option: "log file"
|
|
|
|
value: "/var/log/ceph/{{ cluster }}-rgw-{{ hostvars[inventory_hostname]['ansible_facts']['hostname'] }}.log"
|
|
|
|
environment:
|
|
|
|
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
|
|
|
|
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
|
|
|
|
loop: "{{ groups.get('nfss', []) }}"
|
|
|
|
|
2017-09-19 22:19:14 +08:00
|
|
|
- name: include create_rgw_nfs_user.yml
|
2018-08-21 22:23:35 +08:00
|
|
|
import_tasks: create_rgw_nfs_user.yml
|
2019-05-20 21:58:10 +08:00
|
|
|
when: groups.get(mon_group_name, []) | length > 0
|
2017-09-19 22:19:14 +08:00
|
|
|
|
2021-04-01 20:37:45 +08:00
|
|
|
- name: install nfs-ganesha-selinux on RHEL 8
|
|
|
|
package:
|
|
|
|
name: nfs-ganesha-selinux
|
|
|
|
state: present
|
|
|
|
register: result
|
|
|
|
until: result is succeeded
|
|
|
|
when:
|
|
|
|
- not containerized_deployment | bool
|
|
|
|
- inventory_hostname in groups.get(nfs_group_name, [])
|
|
|
|
- ansible_facts['os_family'] == 'RedHat'
|
|
|
|
- ansible_facts['distribution_major_version'] == '8'
|
|
|
|
|
2017-09-27 05:16:43 +08:00
|
|
|
# NOTE (leseb): workaround for issues with ganesha and librgw
|
2021-04-01 20:37:45 +08:00
|
|
|
- name: add ganesha_t to permissive domain
|
|
|
|
selinux_permissive:
|
|
|
|
name: ganesha_t
|
|
|
|
permissive: true
|
|
|
|
failed_when: false
|
2017-09-19 22:19:14 +08:00
|
|
|
when:
|
2019-05-22 16:02:42 +08:00
|
|
|
- not containerized_deployment | bool
|
2021-03-03 22:43:50 +08:00
|
|
|
- ansible_facts['os_family'] == 'RedHat'
|
2021-04-01 20:37:45 +08:00
|
|
|
- ansible_facts['selinux']['status'] == 'enabled'
|
2016-05-06 02:20:03 +08:00
|
|
|
|
2020-03-20 03:44:20 +08:00
|
|
|
- name: nfs with external ceph cluster task related
|
2019-05-20 21:58:10 +08:00
|
|
|
when:
|
|
|
|
- groups.get(mon_group_name, []) | length == 0
|
|
|
|
- ceph_nfs_ceph_user is defined
|
2020-03-20 03:44:20 +08:00
|
|
|
block:
|
|
|
|
- name: create keyring directory
|
|
|
|
file:
|
2020-05-05 22:46:14 +08:00
|
|
|
path: "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ item }}"
|
2020-03-20 03:44:20 +08:00
|
|
|
state: directory
|
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' }}"
|
2020-03-20 03:44:20 +08:00
|
|
|
mode: "0755"
|
2020-05-05 22:46:14 +08:00
|
|
|
with_items:
|
|
|
|
- "{{ ceph_nfs_ceph_user }}"
|
2021-03-03 22:43:50 +08:00
|
|
|
- "{{ ansible_facts['hostname'] }}"
|
2020-04-10 17:05:25 +08:00
|
|
|
|
|
|
|
- name: set_fact rgw_client_name
|
|
|
|
set_fact:
|
|
|
|
rgw_client_name: "client.rgw.{{ ceph_nfs_ceph_user }}"
|
2020-03-20 03:44:20 +08:00
|
|
|
|
|
|
|
- name: get client cephx keys
|
|
|
|
copy:
|
2020-04-10 17:05:25 +08:00
|
|
|
dest: "{{ item.1 }}"
|
|
|
|
content: "{{ item.0.content | b64decode }}"
|
|
|
|
mode: "{{ item.0.item.get('mode', '0600') }}"
|
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' }}"
|
2020-04-10 17:05:25 +08:00
|
|
|
with_nested:
|
|
|
|
- "{{ hostvars[groups['_filtered_clients'][0]]['slurp_client_keys']['results'] | default([]) }}"
|
2021-03-03 22:43:50 +08:00
|
|
|
- ['/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ceph_nfs_ceph_user }}/keyring', "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_facts['hostname'] }}/keyring"]
|
2020-03-20 03:44:20 +08:00
|
|
|
when:
|
2020-04-30 22:21:14 +08:00
|
|
|
- not item.0.get('skipped', False)
|
2020-05-05 22:46:14 +08:00
|
|
|
- item.0.item.name == 'client.' + ceph_nfs_ceph_user or item.0.item.name == rgw_client_name
|
2021-08-09 20:57:33 +08:00
|
|
|
no_log: "{{ no_log_on_ceph_key_tasks }}"
|
2019-05-20 21:58:10 +08:00
|
|
|
|
2017-09-27 05:16:43 +08:00
|
|
|
- name: include start_nfs.yml
|
2018-08-21 22:23:35 +08:00
|
|
|
import_tasks: start_nfs.yml
|