deep_scrub_choked

This commit is contained in:
a.pivkin
2026-04-06 07:08:17 +03:00
commit 9149dc1d7f
840 changed files with 52471 additions and 0 deletions
@@ -0,0 +1,52 @@
---
- name: Configure cluster name
ansible.builtin.lineinfile:
dest: /etc/sysconfig/ceph
insertafter: EOF
create: true
line: "CLUSTER={{ cluster }}"
regexp: "^CLUSTER="
mode: "0644"
when: ansible_facts['os_family'] in ["RedHat", "Suse"]
# NOTE(leseb): we are performing the following check
# to ensure any Jewel installation will not fail.
# The following commit https://github.com/ceph/ceph/commit/791eba81a5467dd5de4f1680ed0deb647eb3fb8b
# fixed a package issue where the path was the wrong.
# This bug is not yet on all the distros package so we are working around it
# Impacted versions:
# - Jewel from UCA: https://bugs.launchpad.net/ubuntu/+source/ceph/+bug/1582773
# - Jewel from latest Canonical 16.04 distro
# - All previous versions from Canonical
# - Infernalis from ceph.com
- name: Debian based systems - configure cluster name
when: ansible_facts['os_family'] == "Debian"
block:
- name: Check /etc/default/ceph exist
ansible.builtin.stat:
path: /etc/default/ceph
register: etc_default_ceph
check_mode: false
- name: Configure cluster name
when: etc_default_ceph.stat.exists
block:
- name: When /etc/default/ceph is not dir
ansible.builtin.lineinfile:
dest: /etc/default/ceph
insertafter: EOF
create: true
regexp: "^CLUSTER="
line: "CLUSTER={{ cluster }}"
mode: "0644"
when: not etc_default_ceph.stat.isdir
- name: When /etc/default/ceph is dir
ansible.builtin.lineinfile:
dest: /etc/default/ceph/ceph
insertafter: EOF
create: true
regexp: "^CLUSTER="
line: "CLUSTER={{ cluster }}"
mode: "0644"
when: etc_default_ceph.stat.isdir
@@ -0,0 +1,36 @@
---
- name: Configure TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES for debian
ansible.builtin.lineinfile:
dest: "{{ etc_default_ceph.stat.isdir | ternary('/etc/default/ceph/ceph', '/etc/default/ceph') }}"
insertafter: EOF
create: true
regexp: "^TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES="
line: "TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES={{ ceph_tcmalloc_max_total_thread_cache }}"
mode: "0644"
when:
- ansible_facts['os_family'] == 'Debian'
- etc_default_ceph.stat.exists
notify:
- Restart ceph mons
- Restart ceph mgrs
- Restart ceph osds
- Restart ceph mdss
- Restart ceph rgws
- Restart ceph rbdmirrors
- name: Configure TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES for redhat
ansible.builtin.lineinfile:
dest: "/etc/sysconfig/ceph"
insertafter: EOF
create: true
regexp: "^TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES="
line: "TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES={{ ceph_tcmalloc_max_total_thread_cache }}"
mode: "0644"
when: ansible_facts['os_family'] == 'RedHat'
notify:
- Restart ceph mons
- Restart ceph mgrs
- Restart ceph osds
- Restart ceph mdss
- Restart ceph rgws
- Restart ceph rbdmirrors
@@ -0,0 +1,32 @@
---
- name: Config repository for Red Hat based OS
when: ansible_facts['os_family'] == 'RedHat'
block:
- name: Include installs/configure_redhat_repository_installation.yml
ansible.builtin.include_tasks: installs/configure_redhat_repository_installation.yml
when: ceph_origin == 'repository'
- name: Include installs/configure_redhat_local_installation.yml
ansible.builtin.include_tasks: installs/configure_redhat_local_installation.yml
when: ceph_origin == 'local'
- name: Config repository for Debian based OS
when: ansible_facts['os_family'] == 'Debian'
tags: package-install
block:
- name: Include installs/configure_debian_repository_installation.yml
ansible.builtin.include_tasks: installs/configure_debian_repository_installation.yml
when: ceph_origin == 'repository'
- name: Update apt cache if cache_valid_time has expired
ansible.builtin.apt:
update_cache: true
cache_valid_time: 3600
register: result
until: result is succeeded
- name: Include installs/configure_suse_repository_installation.yml
ansible.builtin.include_tasks: installs/configure_suse_repository_installation.yml
when:
- ansible_facts['os_family'] == 'Suse'
- ceph_origin == 'repository'
@@ -0,0 +1,12 @@
---
- name: Create rbd client directory
ansible.builtin.file:
path: "{{ item }}"
state: directory
owner: "{{ rbd_client_directory_owner }}"
group: "{{ rbd_client_directory_group }}"
mode: "{{ rbd_client_directory_mode }}"
with_items:
- "{{ rbd_client_admin_socket_path }}"
- "{{ rbd_client_log_path }}"
when: rbd_client_directories | bool
@@ -0,0 +1,16 @@
---
- name: Include debian_community_repository.yml
ansible.builtin.include_tasks: debian_community_repository.yml
when: ceph_repository == 'community'
- name: Include debian_dev_repository.yml
ansible.builtin.include_tasks: debian_dev_repository.yml
when: ceph_repository == 'dev'
- name: Include debian_custom_repository.yml
ansible.builtin.include_tasks: debian_custom_repository.yml
when: ceph_repository == 'custom'
- name: Include debian_uca_repository.yml
ansible.builtin.include_tasks: debian_uca_repository.yml
when: ceph_repository == 'uca'
@@ -0,0 +1,45 @@
---
- name: Make sure /tmp exists
ansible.builtin.file:
path: /tmp
state: directory
mode: "0755"
when: use_installer | bool
- name: Use mktemp to create name for rundep
ansible.builtin.tempfile:
path: /tmp
prefix: rundep.
register: rundep_location
when: use_installer | bool
- name: Copy rundep
ansible.builtin.copy:
src: "{{ ansible_dir }}/rundep"
dest: "{{ rundep_location.path }}"
mode: preserve
when: use_installer | bool
- name: Install ceph dependencies
ansible.builtin.script: "{{ ansible_dir }}/rundep_installer.sh {{ rundep_location.path }}"
when: use_installer | bool
- name: Ensure rsync is installed
ansible.builtin.package:
name: rsync
state: present
register: result
until: result is succeeded
- name: Synchronize ceph install
ansible.posix.synchronize:
src: "{{ ceph_installation_dir }}/"
dest: "/"
- name: Create user group ceph
ansible.builtin.group:
name: 'ceph'
- name: Create user ceph
ansible.builtin.user:
name: 'ceph'
@@ -0,0 +1,34 @@
---
- name: Configure epel repository
ansible.builtin.package:
name: epel-release
register: result
until: result is succeeded
tags: with_pkg
when:
- ansible_facts['distribution'] == 'Rocky'
- name: Install python3-packaging
ansible.builtin.yum:
name: python3-packaging
enablerepo: powertools
state: present
when: ansible_facts['distribution_major_version'] | int < 9
- name: Include redhat_community_repository.yml
ansible.builtin.include_tasks: redhat_community_repository.yml
when: ceph_repository == 'community'
- name: Include redhat_dev_repository.yml
ansible.builtin.include_tasks: redhat_dev_repository.yml
when: ceph_repository == 'dev'
- name: Include redhat_custom_repository.yml
ansible.builtin.include_tasks: redhat_custom_repository.yml
when: ceph_repository == 'custom'
# Remove yum caches so yum doesn't get confused if we are reinstalling a different ceph version
- name: Purge yum cache
ansible.builtin.command: yum clean all # noqa: [303]
changed_when: false
when: ansible_facts['pkg_mgr'] == 'yum'
@@ -0,0 +1,4 @@
---
- name: Include suse_obs_repository.yml
ansible.builtin.include_tasks: suse_obs_repository.yml
when: ceph_repository == 'obs'
@@ -0,0 +1,20 @@
---
- name: Install dependencies for apt modules
ansible.builtin.package:
name: ['apt-transport-https', 'ca-certificates', 'gnupg', 'software-properties-common']
update_cache: true
register: result
until: result is succeeded
- name: Configure debian ceph community repository stable key
ansible.builtin.apt_key:
data: "{{ lookup('file', role_path + '/files/cephstable.asc') }}"
state: present
register: result
until: result is succeeded
- name: Configure debian ceph stable community repository
ansible.builtin.apt_repository:
repo: "deb {{ ceph_stable_repo }} {{ ceph_stable_distro_source | default(ansible_facts['distribution_release']) }} main"
state: present
update_cache: true
@@ -0,0 +1,14 @@
---
- name: Configure debian custom apt key
ansible.builtin.apt_key:
url: "{{ ceph_custom_key }}"
state: present
register: result
until: result is succeeded
when: ceph_custom_key is defined
- name: Configure debian custom repository
ansible.builtin.apt_repository:
repo: "deb {{ ceph_custom_repo }} {{ ansible_facts['distribution_release'] }} main"
state: present
update_cache: true
@@ -0,0 +1,12 @@
---
- name: Fetch ceph debian development repository
ansible.builtin.uri:
url: "https://shaman.ceph.com/api/repos/ceph/{{ ceph_dev_branch }}/{{ ceph_dev_sha1 }}/{{ ansible_facts['distribution'] | lower }}/{{ ansible_facts['distribution_release'] }}/repo?arch={{ ansible_facts['architecture'] }}"
return_content: true
register: ceph_dev_deb_repo
- name: Configure ceph debian development repository
ansible.builtin.apt_repository:
repo: "{{ ceph_dev_deb_repo.content }}"
state: present
update_cache: true
@@ -0,0 +1,12 @@
---
- name: Add ubuntu cloud archive key package
ansible.builtin.package:
name: ubuntu-cloud-keyring
register: result
until: result is succeeded
- name: Add ubuntu cloud archive repository
ansible.builtin.apt_repository:
repo: "deb {{ ceph_stable_repo_uca }} {{ ceph_stable_release_uca }} main"
state: present
update_cache: true
@@ -0,0 +1,9 @@
---
- name: Install ceph for debian
ansible.builtin.apt:
name: "{{ debian_ceph_pkgs | unique }}"
update_cache: false
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 '' }}"
register: result
until: result is succeeded
@@ -0,0 +1,7 @@
---
- name: Install ceph bundle
community.general.swupd:
name: storage-cluster
state: present
register: result
until: result is succeeded
@@ -0,0 +1,13 @@
- name: Install dependencies
ansible.builtin.apt:
name: "{{ debian_package_dependencies }}"
state: present
update_cache: true
cache_valid_time: 3600
register: result
until: result is succeeded
- name: Include install_debian_packages.yml
ansible.builtin.include_tasks: install_debian_packages.yml
when:
- (ceph_origin == 'repository' or ceph_origin == 'distro')
@@ -0,0 +1,23 @@
---
- name: Install redhat dependencies
ansible.builtin.package:
name: "{{ redhat_package_dependencies }}"
state: present
register: result
until: result is succeeded
when: ansible_facts['distribution'] == 'RedHat'
- name: Install centos dependencies
ansible.builtin.yum:
name: "{{ centos_package_dependencies }}"
state: present
register: result
until: result is succeeded
when: ansible_facts['distribution'] == 'CentOS'
- name: Install redhat ceph packages
ansible.builtin.package:
name: "{{ redhat_ceph_pkgs | unique }}"
state: "{{ (upgrade_ceph_packages | bool) | ternary('latest', 'present') }}"
register: result
until: result is succeeded
@@ -0,0 +1,14 @@
---
- name: Install SUSE/openSUSE dependencies
ansible.builtin.package:
name: "{{ suse_package_dependencies }}"
state: present
register: result
until: result is succeeded
- name: Install SUSE/openSUSE ceph packages
ansible.builtin.package:
name: "{{ suse_ceph_pkgs | unique }}"
state: "{{ (upgrade_ceph_packages | bool) | ternary('latest', 'present') }}"
register: result
until: result is succeeded
@@ -0,0 +1,41 @@
---
- name: Install yum plugin priorities
ansible.builtin.package:
name: yum-plugin-priorities
register: result
until: result is succeeded
tags: with_pkg
when: ansible_facts['distribution_major_version'] | int == 7
- name: Configure red hat ceph community repository stable key
ansible.builtin.rpm_key:
key: "{{ ceph_stable_key }}"
state: present
register: result
until: result is succeeded
- name: Configure red hat ceph stable community repository
ansible.builtin.yum_repository:
name: ceph_stable
description: Ceph Stable $basearch repo
gpgcheck: true
state: present
gpgkey: "{{ ceph_stable_key }}"
baseurl: "{{ ceph_mirror }}/rpm-{{ ceph_stable_release }}/el{{ ansible_facts['distribution_major_version'] }}/$basearch"
file: ceph_stable
priority: 2
register: result
until: result is succeeded
- name: Configure red hat ceph stable noarch community repository
ansible.builtin.yum_repository:
name: ceph_stable_noarch
description: Ceph Stable noarch repo
gpgcheck: true
state: present
gpgkey: "{{ ceph_stable_key }}"
baseurl: "{{ ceph_mirror }}/rpm-{{ ceph_stable_release }}/el{{ ansible_facts['distribution_major_version'] }}/noarch"
file: ceph_stable
priority: 2
register: result
until: result is succeeded
@@ -0,0 +1,16 @@
---
- name: Configure red hat custom rpm key
ansible.builtin.rpm_key:
key: "{{ ceph_custom_key }}"
state: present
register: result
until: result is succeeded
when: ceph_custom_key is defined
- name: Configure red hat custom repository
ansible.builtin.get_url:
url: "{{ ceph_custom_repo }}"
dest: /etc/yum.repos.d
owner: root
group: root
mode: "0644"
@@ -0,0 +1,25 @@
---
- name: Fetch ceph red hat development repository
ansible.builtin.uri:
# Use the centos repo since we don't currently have a dedicated red hat repo
url: "https://shaman.ceph.com/api/repos/ceph/{{ ceph_dev_branch }}/{{ ceph_dev_sha1 }}/centos/{{ ansible_facts['distribution_major_version'] }}/repo?arch={{ ansible_facts['architecture'] }}"
return_content: true
register: ceph_dev_yum_repo
- name: Configure ceph red hat development repository
ansible.builtin.copy:
content: "{{ ceph_dev_yum_repo.content }}"
dest: /etc/yum.repos.d/ceph-dev.repo
owner: root
group: root
mode: "0644"
backup: true
- name: Remove ceph_stable repositories
ansible.builtin.yum_repository:
name: '{{ item }}'
file: ceph_stable
state: absent
with_items:
- ceph_stable
- ceph_stable_noarch
@@ -0,0 +1,8 @@
---
- name: Configure openSUSE ceph OBS repository
community.general.zypper_repository:
name: "OBS:filesystems:ceph:{{ ceph_release }}"
state: present
repo: "{{ ceph_obs_repo }}"
auto_import_keys: true
autorefresh: true
+63
View File
@@ -0,0 +1,63 @@
---
- name: Include configure_repository.yml
ansible.builtin.include_tasks: configure_repository.yml
tags: package-configure
- name: Include installs/install_redhat_packages.yml
ansible.builtin.include_tasks: installs/install_redhat_packages.yml
when:
- ansible_facts['os_family'] == 'RedHat'
- (ceph_origin == 'repository' or ceph_origin == 'distro')
tags: package-install
- name: Include installs/install_suse_packages.yml
ansible.builtin.include_tasks: installs/install_suse_packages.yml
when: ansible_facts['os_family'] == 'Suse'
tags: package-install
- name: Include installs/install_on_debian.yml
ansible.builtin.include_tasks: installs/install_on_debian.yml
tags: package-install
when: ansible_facts['os_family'] == 'Debian'
- name: Include_tasks installs/install_on_clear.yml
ansible.builtin.include_tasks: installs/install_on_clear.yml
when: ansible_facts['os_family'] == 'ClearLinux'
tags: package-install
- name: Get ceph version
ansible.builtin.command: ceph --version
changed_when: false
check_mode: false
register: ceph_version
- name: Set_fact ceph_version
ansible.builtin.set_fact:
ceph_version: "{{ ceph_version.stdout.split(' ')[2] }}"
- name: Set_fact ceph_release - override ceph_release with ceph_stable_release
ansible.builtin.set_fact:
ceph_release: "{{ ceph_stable_release }}"
when:
- ceph_origin == 'repository'
- ceph_repository not in ['dev', 'custom']
tags: always
- name: Include create_rbd_client_dir.yml
ansible.builtin.include_tasks: create_rbd_client_dir.yml
- name: Include configure_cluster_name.yml
ansible.builtin.include_tasks: configure_cluster_name.yml
- name: Include configure_memory_allocator.yml
ansible.builtin.include_tasks: configure_memory_allocator.yml
when:
- (ceph_tcmalloc_max_total_thread_cache | int) > 0
- (ceph_origin == 'repository' or ceph_origin == 'distro')
- name: Include selinux.yml
ansible.builtin.include_tasks: selinux.yml
when:
- ansible_facts['os_family'] == 'RedHat'
- inventory_hostname in groups.get(nfs_group_name, [])
or inventory_hostname in groups.get(rgwloadbalancer_group_name, [])
+22
View File
@@ -0,0 +1,22 @@
---
- name: If selinux is not disabled
when: ansible_facts['selinux']['status'] == 'enabled'
block:
- name: Install policycoreutils-python
ansible.builtin.package:
name: policycoreutils-python
state: present
register: result
until: result is succeeded
when: ansible_facts['distribution_major_version'] == '7'
- name: Install python3-policycoreutils on RHEL 8
ansible.builtin.package:
name: python3-policycoreutils
state: present
register: result
until: result is succeeded
when:
- inventory_hostname in groups.get(nfs_group_name, [])
or inventory_hostname in groups.get(rgwloadbalancer_group_name, [])
- ansible_facts['distribution_major_version'] == '8'