deep_scrub_choked
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
---
|
||||
- name: Create bootstrap-mds and mds directories
|
||||
ansible.builtin.file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
|
||||
group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
|
||||
mode: "{{ ceph_directories_mode }}"
|
||||
with_items:
|
||||
- /var/lib/ceph/bootstrap-mds/
|
||||
- /var/lib/ceph/mds/{{ cluster }}-{{ ansible_facts['hostname'] }}
|
||||
|
||||
- name: Get keys from monitors
|
||||
ceph_key_info:
|
||||
name: "{{ item.name }}"
|
||||
cluster: "{{ cluster }}"
|
||||
output_format: plain
|
||||
state: info
|
||||
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 }}"
|
||||
register: _mds_keys
|
||||
with_items:
|
||||
- { name: "client.bootstrap-mds", path: "/var/lib/ceph/bootstrap-mds/{{ cluster }}.keyring", copy_key: true }
|
||||
- { name: "client.admin", path: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" }
|
||||
delegate_to: "{{ groups.get(mon_group_name)[0] }}"
|
||||
run_once: true
|
||||
when:
|
||||
- cephx | bool
|
||||
- item.copy_key | bool
|
||||
no_log: "{{ no_log_on_ceph_key_tasks }}"
|
||||
|
||||
- name: Copy ceph key(s) if needed
|
||||
ansible.builtin.copy:
|
||||
dest: "{{ item.item.path }}"
|
||||
content: "{{ item.stdout + '\n' }}"
|
||||
owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
|
||||
group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
|
||||
mode: "{{ ceph_keyring_permissions }}"
|
||||
with_items: "{{ _mds_keys.results }}"
|
||||
when:
|
||||
- cephx | bool
|
||||
- item.item.copy_key | bool
|
||||
no_log: "{{ no_log_on_ceph_key_tasks }}"
|
||||
|
||||
- name: Create mds keyring
|
||||
ceph_key:
|
||||
name: "mds.{{ ansible_facts['hostname'] }}"
|
||||
cluster: "{{ cluster }}"
|
||||
user: client.bootstrap-mds
|
||||
user_key: "/var/lib/ceph/bootstrap-mds/{{ cluster }}.keyring"
|
||||
caps:
|
||||
mon: "allow profile mds"
|
||||
mds: "allow"
|
||||
osd: "allow rwx"
|
||||
dest: "/var/lib/ceph/mds/{{ cluster }}-{{ ansible_facts['hostname'] }}/keyring"
|
||||
import_key: false
|
||||
owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
|
||||
group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
|
||||
mode: "{{ ceph_keyring_permissions }}"
|
||||
no_log: "{{ no_log_on_ceph_key_tasks }}"
|
||||
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 }}"
|
||||
when: cephx | bool
|
||||
@@ -0,0 +1,26 @@
|
||||
---
|
||||
- name: Include_tasks systemd.yml
|
||||
ansible.builtin.include_tasks: systemd.yml
|
||||
|
||||
- name: Enable ceph-mds.target
|
||||
ansible.builtin.service:
|
||||
name: ceph-mds.target
|
||||
enabled: true
|
||||
daemon_reload: true
|
||||
when: containerized_deployment | bool
|
||||
|
||||
- name: Systemd start mds container
|
||||
ansible.builtin.systemd:
|
||||
name: ceph-mds@{{ ansible_facts['hostname'] }}
|
||||
state: started
|
||||
enabled: true
|
||||
masked: false
|
||||
daemon_reload: true
|
||||
|
||||
- name: Wait for mds socket to exist
|
||||
ansible.builtin.command: "{{ container_binary }} exec ceph-mds-{{ ansible_facts['hostname'] }} sh -c 'stat /var/run/ceph/{{ cluster }}-mds.{{ ansible_facts['hostname'] }}.asok || stat /var/run/ceph/{{ cluster }}-mds.{{ ansible_facts['fqdn'] }}.asok'"
|
||||
changed_when: false
|
||||
register: multi_mds_socket
|
||||
retries: 5
|
||||
delay: 15
|
||||
until: multi_mds_socket.rc == 0
|
||||
@@ -0,0 +1,36 @@
|
||||
---
|
||||
- name: Import ceph-facts role
|
||||
ansible.builtin.import_role:
|
||||
name: ceph-facts
|
||||
tasks_from: get_def_crush_rule_name.yml
|
||||
|
||||
- name: Create filesystem pools
|
||||
ceph_pool:
|
||||
name: "{{ item.name }}"
|
||||
cluster: "{{ cluster }}"
|
||||
pg_num: "{{ item.pg_num | default(omit) }}"
|
||||
pgp_num: "{{ item.pgp_num | default(omit) }}"
|
||||
size: "{{ item.size | default(omit) }}"
|
||||
min_size: "{{ item.min_size | default(omit) }}"
|
||||
pool_type: "{{ item.type | default('replicated') }}"
|
||||
rule_name: "{{ item.rule_name | default(omit) }}"
|
||||
erasure_profile: "{{ item.erasure_profile | default(omit) }}"
|
||||
pg_autoscale_mode: "{{ item.pg_autoscale_mode | default(omit) }}"
|
||||
target_size_ratio: "{{ item.target_size_ratio | default(omit) }}"
|
||||
with_items: "{{ cephfs_pools }}"
|
||||
delegate_to: "{{ groups[mon_group_name][0] }}"
|
||||
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 }}"
|
||||
|
||||
- name: Create ceph filesystem
|
||||
ceph_fs:
|
||||
name: "{{ cephfs }}"
|
||||
cluster: "{{ cluster }}"
|
||||
data: "{{ cephfs_data_pool.name }}"
|
||||
metadata: "{{ cephfs_metadata_pool.name }}"
|
||||
max_mds: "{{ mds_max_mds if not rolling_update | bool else omit }}"
|
||||
delegate_to: "{{ groups[mon_group_name][0] }}"
|
||||
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 }}"
|
||||
@@ -0,0 +1,17 @@
|
||||
---
|
||||
- name: Include create_mds_filesystems.yml
|
||||
ansible.builtin.include_tasks: create_mds_filesystems.yml
|
||||
when:
|
||||
- inventory_hostname == groups[mds_group_name] | first
|
||||
- not rolling_update | bool
|
||||
|
||||
- name: Include common.yml
|
||||
ansible.builtin.include_tasks: common.yml
|
||||
|
||||
- name: Non_containerized.yml
|
||||
ansible.builtin.include_tasks: non_containerized.yml
|
||||
when: not containerized_deployment | bool
|
||||
|
||||
- name: Containerized.yml
|
||||
ansible.builtin.include_tasks: containerized.yml
|
||||
when: containerized_deployment | bool
|
||||
@@ -0,0 +1,48 @@
|
||||
---
|
||||
- name: Install ceph mds for debian
|
||||
ansible.builtin.apt:
|
||||
name: ceph-mds
|
||||
state: "{{ (upgrade_ceph_packages | bool) | ternary('latest', 'present') }}"
|
||||
default_release: "{{ ceph_stable_release_uca | default('') if ceph_origin == 'repository' and ceph_repository == 'uca' else '' }}{{ ansible_facts['distribution_release'] ~ '-backports' if ceph_origin == 'distro' and ceph_use_distro_backports | bool else '' }}"
|
||||
when:
|
||||
- mds_group_name in group_names
|
||||
- ansible_facts['os_family'] == 'Debian'
|
||||
register: result
|
||||
until: result is succeeded
|
||||
|
||||
- name: Install ceph-mds package on redhat or SUSE/openSUSE
|
||||
ansible.builtin.package:
|
||||
name: "ceph-mds"
|
||||
state: "{{ (upgrade_ceph_packages | bool) | ternary('latest', 'present') }}"
|
||||
register: result
|
||||
until: result is succeeded
|
||||
when:
|
||||
- mds_group_name in group_names
|
||||
- ansible_facts['os_family'] in ['Suse', 'RedHat']
|
||||
|
||||
- name: Ensure systemd service override directory exists
|
||||
ansible.builtin.file:
|
||||
state: directory
|
||||
path: "/etc/systemd/system/ceph-mds@.service.d/"
|
||||
mode: "0755"
|
||||
when:
|
||||
- ceph_mds_systemd_overrides is defined
|
||||
- ansible_facts['service_mgr'] == 'systemd'
|
||||
|
||||
- name: Add ceph-mds systemd service overrides
|
||||
openstack.config_template.config_template:
|
||||
src: "ceph-mds.service.d-overrides.j2"
|
||||
dest: "/etc/systemd/system/ceph-mds@.service.d/ceph-mds-systemd-overrides.conf"
|
||||
config_overrides: "{{ ceph_mds_systemd_overrides | default({}) }}"
|
||||
config_type: "ini"
|
||||
when:
|
||||
- ceph_mds_systemd_overrides is defined
|
||||
- ansible_facts['service_mgr'] == 'systemd'
|
||||
|
||||
- name: Start and add that the metadata service to the init sequence
|
||||
ansible.builtin.systemd:
|
||||
name: ceph-mds@{{ ansible_facts['hostname'] }}
|
||||
state: started
|
||||
enabled: true
|
||||
masked: false
|
||||
changed_when: false
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
- name: Generate systemd unit file
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/ceph-mds.service.j2"
|
||||
dest: /etc/systemd/system/ceph-mds@.service
|
||||
owner: "root"
|
||||
group: "root"
|
||||
mode: "0644"
|
||||
notify: Restart ceph mdss
|
||||
|
||||
- name: Generate systemd ceph-mds target file
|
||||
ansible.builtin.copy:
|
||||
src: ceph-mds.target
|
||||
dest: /etc/systemd/system/ceph-mds.target
|
||||
mode: "0644"
|
||||
when: containerized_deployment | bool
|
||||
Reference in New Issue
Block a user