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
+14
View File
@@ -0,0 +1,14 @@
---
galaxy_info:
company: Red Hat
author: Andrew Schoen
description: Validates Ceph config options
license: Apache
min_ansible_version: '2.7'
platforms:
- name: EL
versions:
- 'all'
galaxy_tags:
- system
dependencies: []
+115
View File
@@ -0,0 +1,115 @@
---
- name: Set_fact root_device
ansible.builtin.set_fact:
root_device: "{{ ansible_facts['mounts'] | selectattr('mount', 'match', '^/$') | map(attribute='device') | first }}"
- name: Lvm_volumes variable's tasks related
when:
- lvm_volumes is defined
- lvm_volumes | length > 0
block:
- name: Resolve devices in lvm_volumes
ansible.builtin.command: "readlink -f {{ item.data }}"
changed_when: false
register: _lvm_volumes_data_devices
with_items: "{{ lvm_volumes }}"
when: item.data_vg is undefined
- name: Set_fact lvm_volumes_data_devices
ansible.builtin.set_fact:
lvm_volumes_data_devices: "{{ lvm_volumes_data_devices | default([]) + [item.stdout] }}"
with_items: "{{ _lvm_volumes_data_devices.results }}"
when: item.skipped is undefined
- name: Fail if root_device is passed in lvm_volumes or devices
ansible.builtin.fail:
msg: "{{ root_device }} found in either lvm_volumes or devices variable"
when: root_device in lvm_volumes_data_devices | default([]) or root_device in devices | default([])
- name: Check devices are block devices
block:
- name: Get devices information
community.general.parted:
device: "{{ item }}"
unit: MiB
register: devices_parted
failed_when: false
with_items:
- "{{ devices | default([]) }}"
- "{{ dedicated_devices | default([]) }}"
- "{{ bluestore_wal_devices | default([]) }}"
- "{{ lvm_volumes_data_devices | default([]) }}"
- name: Fail if one of the devices is not a device
ansible.builtin.fail:
msg: "{{ item.item }} is not a block special file!"
when: item.rc is defined
with_items: "{{ devices_parted.results }}"
- name: Fail when gpt header found on osd devices
ansible.builtin.fail:
msg: "{{ item.disk.dev }} has gpt header, please remove it."
with_items: "{{ devices_parted.results }}"
when:
- item.skipped is undefined
- item.disk.table == 'gpt'
- item.partitions | length == 0
- name: Check logical volume in lvm_volumes
when: lvm_volumes is defined
block:
- name: Check data logical volume
ansible.builtin.stat:
path: "/dev/{{ item.data_vg }}/{{ item.data }}"
follow: true
register: lvm_volumes_data
loop: "{{ lvm_volumes }}"
when:
- item.data is defined
- item.data_vg is defined
- name: Fail if one of the data logical volume is not a device or doesn't exist
ansible.builtin.fail:
msg: "{{ item.item.data_vg }}/{{ item.item.data }} doesn't exist or isn't a block"
loop: "{{ lvm_volumes_data.results }}"
when:
- item.skipped is undefined
- not item.stat.exists | bool or not item.stat.isblk | bool
- name: Check bluestore db logical volume
ansible.builtin.stat:
path: "/dev/{{ item.db_vg }}/{{ item.db }}"
follow: true
register: lvm_volumes_db
loop: "{{ lvm_volumes }}"
when:
- osd_objectstore == 'bluestore'
- item.db is defined
- item.db_vg is defined
- name: Fail if one of the bluestore db logical volume is not a device or doesn't exist
ansible.builtin.fail:
msg: "{{ item.item.db_vg }}/{{ item.item.db }} doesn't exist or isn't a block"
loop: "{{ lvm_volumes_db.results }}"
when:
- item.skipped is undefined
- not item.stat.exists | bool or not item.stat.isblk | bool
- name: Check bluestore wal logical volume
ansible.builtin.stat:
path: "/dev/{{ item.wal_vg }}/{{ item.wal }}"
follow: true
register: lvm_volumes_wal
loop: "{{ lvm_volumes }}"
when:
- osd_objectstore == 'bluestore'
- item.wal is defined
- item.wal_vg is defined
- name: Fail if one of the bluestore wal logical volume is not a device or doesn't exist
ansible.builtin.fail:
msg: "{{ item.item.wal_vg }}/{{ item.item.wal }} doesn't exist or isn't a block"
loop: "{{ lvm_volumes_wal.results }}"
when:
- item.skipped is undefined
- not item.stat.exists | bool or not item.stat.isblk | bool
@@ -0,0 +1,24 @@
---
- name: Check if network interface exists
ansible.builtin.fail:
msg: "{{ radosgw_interface }} does not exist on {{ inventory_hostname }}"
when: radosgw_interface not in ansible_facts['interfaces']
- name: Check if network interface is active
ansible.builtin.fail:
msg: "{{ radosgw_interface }} is not active on {{ inventory_hostname }}"
when: hostvars[inventory_hostname]['ansible_facts'][(radosgw_interface | replace('-', '_'))]['active'] == "false"
- name: Check if network interface has an IPv4 address
ansible.builtin.fail:
msg: "{{ radosgw_interface }} does not have any IPv4 address on {{ inventory_hostname }}"
when:
- ip_version == "ipv4"
- hostvars[inventory_hostname]['ansible_facts'][(radosgw_interface | replace('-', '_'))]['ipv4'] is not defined
- name: Check if network interface has an IPv6 address
ansible.builtin.fail:
msg: "{{ radosgw_interface }} does not have any IPv6 address on {{ inventory_hostname }}"
when:
- ip_version == "ipv6"
- hostvars[inventory_hostname]['ansible_facts'][(radosgw_interface | replace('-', '_'))]['ipv6'] is not defined
@@ -0,0 +1,5 @@
---
- name: Check if network interface has an IP address in public_network
ansible.builtin.fail:
msg: "{{ inventory_hostname }} does not have any {{ ip_version }} address on {{ public_network }}"
when: hostvars[inventory_hostname]['ansible_facts']['all_' + ip_version + '_addresses'] | ips_in_ranges(hostvars[inventory_hostname]['public_network'].split(',')) | length == 0
+15
View File
@@ -0,0 +1,15 @@
---
- name: Fail if ceph_nfs_rgw_access_key or ceph_nfs_rgw_secret_key are undefined (nfs standalone)
ansible.builtin.fail:
msg: "ceph_nfs_rgw_access_key and ceph_nfs_rgw_secret_key must be set if nfs_obj_gw is True"
when:
- nfs_obj_gw | bool
- groups.get(mon_group_name, []) | length == 0
- (ceph_nfs_rgw_access_key is undefined or ceph_nfs_rgw_secret_key is undefined)
- name: Fail on openSUSE Leap 15.x using distro packages
ansible.builtin.fail:
msg: "ceph-nfs packages are not available from openSUSE Leap 15.x repositories (ceph_origin = 'distro')"
when:
- ceph_origin == 'distro'
- ansible_facts['distribution'] == 'openSUSE Leap'
+10
View File
@@ -0,0 +1,10 @@
---
- name: Fail if target_size_ratio is not set when pg_autoscale_mode is True
ansible.builtin.fail:
msg: "You must set a target_size_ratio value on following pool: {{ item.name }}."
with_items:
- "{{ cephfs_pools | default([]) }}"
- "{{ pools | default([]) }}"
when:
- item.pg_autoscale_mode | default(False) | bool
- item.target_size_ratio is undefined
@@ -0,0 +1,12 @@
---
- name: Ensure ceph_rbd_mirror_pool is set
ansible.builtin.fail:
msg: "ceph_rbd_mirror_pool needs to be provided"
when: ceph_rbd_mirror_pool | default("") | length == 0
- name: Ensure ceph_rbd_mirror_remote_cluster is set
ansible.builtin.fail:
msg: "ceph_rbd_mirror_remote_cluster needs to be provided"
when:
- ceph_rbd_mirror_remote_cluster | default("") | length == 0
- ceph_rbd_mirror_remote_user | default("") | length > 0
@@ -0,0 +1,19 @@
- name: Validate ceph_origin
ansible.builtin.fail:
msg: "ceph_origin must be either 'repository', 'distro' or 'local'"
when: ceph_origin not in ['repository', 'distro', 'local']
- name: Validate ceph_repository
ansible.builtin.fail:
msg: "ceph_repository must be either 'community', 'obs', 'dev', 'custom' or 'uca'"
when:
- ceph_origin == 'repository'
- ceph_repository not in ['community', 'obs', 'dev', 'custom', 'uca']
- name: Validate ceph_repository_community
ansible.builtin.fail:
msg: "ceph_stable_release must be 'squid'"
when:
- ceph_origin == 'repository'
- ceph_repository == 'community'
- ceph_stable_release not in ['squid']
@@ -0,0 +1,29 @@
---
- name: Fail if ec_profile is not set for ec pools
ansible.builtin.fail:
msg: "ec_profile must be set for ec pools"
loop: "{{ rgw_create_pools | dict2items }}"
when:
- item.value.type is defined
- item.value.type == 'ec'
- item.value.ec_profile is undefined
- name: Fail if ec_k is not set for ec pools
ansible.builtin.fail:
msg: "ec_k must be set for ec pools"
loop: "{{ rgw_create_pools | dict2items }}"
when:
- item.value.type is defined
- item.value.type == 'ec'
- item.value.create_profile | default(true)
- item.value.ec_k is undefined
- name: Fail if ec_m is not set for ec pools
ansible.builtin.fail:
msg: "ec_m must be set for ec pools"
loop: "{{ rgw_create_pools | dict2items }}"
when:
- item.value.type is defined
- item.value.type == 'ec'
- item.value.create_profile | default(true)
- item.value.ec_m is undefined
@@ -0,0 +1,53 @@
---
- name: Fail on unsupported ansible version (1.X)
ansible.builtin.fail:
msg: "Ansible version must be >= 2.x, please update!"
when: ansible_version.major|int < 2
- name: Fail on unsupported ansible version
ansible.builtin.fail:
msg: "Ansible version must be either 2.15, 2.16 or 2.17!"
when: ansible_version.minor|int not in [15, 16, 17]
- name: Fail on unsupported system
ansible.builtin.fail:
msg: "System not supported {{ ansible_facts['system'] }}"
when: ansible_facts['system'] not in ['Linux']
- name: Fail on unsupported architecture
ansible.builtin.fail:
msg: "Architecture not supported {{ ansible_facts['architecture'] }}"
when: ansible_facts['architecture'] not in ['x86_64', 'ppc64le', 'armv7l', 'aarch64']
- name: Fail on unsupported distribution
ansible.builtin.fail:
msg: "Distribution not supported {{ ansible_facts['os_family'] }}"
when: ansible_facts['os_family'] not in ['Debian', 'RedHat', 'ClearLinux', 'Suse']
- name: Fail on unsupported CentOS release
ansible.builtin.fail:
msg: "CentOS release {{ ansible_facts['distribution_major_version'] }} not supported with dashboard"
when:
- ansible_facts['distribution'] == 'CentOS'
- ansible_facts['distribution_major_version'] | int == 7
- not containerized_deployment | bool
- dashboard_enabled | bool
- name: Fail on unsupported distribution for ubuntu cloud archive
ansible.builtin.fail:
msg: "Distribution not supported by Ubuntu Cloud Archive: {{ ansible_facts['distribution'] }}"
when:
- ceph_repository == 'uca'
- ansible_facts['distribution'] != 'Ubuntu'
- name: Fail on unsupported SUSE/openSUSE distribution (only 15.x supported)
ansible.builtin.fail:
msg: "Distribution not supported: {{ ansible_facts['distribution'] }} {{ ansible_facts['distribution_major_version'] }}"
when:
- ansible_facts['distribution'] == 'openSUSE Leap' or ansible_facts['distribution'] == 'SUSE'
- ansible_facts['distribution_major_version'] != '15'
- name: Fail if systemd is not present
ansible.builtin.fail:
msg: "Systemd must be present"
when: ansible_facts['service_mgr'] != 'systemd'
+215
View File
@@ -0,0 +1,215 @@
---
- name: Include check_system.yml
ansible.builtin.include_tasks: check_system.yml
- name: Validate repository variables in non-containerized scenario
ansible.builtin.include_tasks: check_repository.yml
when: not containerized_deployment | bool
- name: Validate osd_objectstore
ansible.builtin.fail:
msg: "osd_objectstore must be 'bluestore''"
when: osd_objectstore not in ['bluestore']
- name: Validate radosgw network configuration
ansible.builtin.fail:
msg: "Either radosgw_address, radosgw_address_block or radosgw_interface must be provided"
when:
- rgw_group_name in group_names
- radosgw_address == 'x.x.x.x'
- radosgw_address_block == 'subnet'
- radosgw_interface == 'interface'
- name: Validate osd nodes
when: osd_group_name in group_names
block:
- name: Validate lvm osd scenario
ansible.builtin.fail:
msg: 'devices or lvm_volumes must be defined for lvm osd scenario'
when:
- not osd_auto_discovery | default(false) | bool
- devices is undefined
- lvm_volumes is undefined
- name: Validate bluestore lvm osd scenario
ansible.builtin.fail:
msg: 'data key must be defined in lvm_volumes'
when:
- osd_objectstore == 'bluestore'
- not osd_auto_discovery | default(false) | bool
- lvm_volumes is defined
- lvm_volumes | length > 0
- item.data is undefined
with_items: '{{ lvm_volumes }}'
- name: Debian based systems tasks
when: ansible_facts['os_family'] == 'Debian'
block:
- name: Fail if local scenario is enabled on debian
ansible.builtin.fail:
msg: "'local' installation scenario not supported on Debian systems"
when: ceph_origin == 'local'
- name: Fail if rhcs repository is enabled on debian
ansible.builtin.fail:
msg: "RHCS isn't supported anymore on Debian distribution"
when:
- ceph_origin == 'repository'
- ceph_repository == 'rhcs'
# SUSE/openSUSE Leap only supports the following:
# - ceph_origin == 'distro'
# - ceph_origin == 'repository' and ceph_repository == 'obs'
- name: SUSE/openSUSE Leap based system tasks
when: ansible_facts['os_family'] == 'Suse'
block:
- name: Check ceph_origin definition on SUSE/openSUSE Leap
ansible.builtin.fail:
msg: "Unsupported installation method origin:{{ ceph_origin }}"
when: ceph_origin not in ['distro', 'repository']
- name: Check ceph_repository definition on SUSE/openSUSE Leap
ansible.builtin.fail:
msg: "Unsupported installation method origin:{{ ceph_origin }} repo:{{ ceph_repository }}'
only valid combination is ceph_origin == 'repository' and ceph_repository == 'obs'"
when:
- ceph_origin == 'repository'
- ceph_repository != 'obs'
- name: Validate ntp daemon type
ansible.builtin.fail:
msg: "ntp_daemon_type must be one of chronyd, ntpd, or timesyncd"
when:
- ntp_service_enabled | bool
- ntp_daemon_type not in ['chronyd', 'ntpd', 'timesyncd']
# Since NTPd can not be installed on Atomic...
- name: Abort if ntp_daemon_type is ntpd on Atomic
ansible.builtin.fail:
msg: installation can't happen on Atomic and ntpd needs to be installed
when:
- is_atomic | default(False) | bool
- ansible_facts['os_family'] == 'RedHat'
- ntp_daemon_type == 'ntpd'
- name: Include check_devices.yml
ansible.builtin.include_tasks: check_devices.yml
when:
- osd_group_name in group_names
- not osd_auto_discovery | default(False) | bool
- name: Include check_eth_rgw.yml
ansible.builtin.include_tasks: check_eth_rgw.yml
when:
- rgw_group_name in group_names
- radosgw_interface != "dummy"
- radosgw_address == "x.x.x.x"
- radosgw_address_block == "subnet"
- name: Include check_rgw_pools.yml
ansible.builtin.include_tasks: check_rgw_pools.yml
when:
- inventory_hostname in groups.get(rgw_group_name, [])
- rgw_create_pools is defined
- name: Include check_nfs.yml
ansible.builtin.include_tasks: check_nfs.yml
when: inventory_hostname in groups.get(nfs_group_name, [])
- name: Include check_rbdmirror.yml
ansible.builtin.include_tasks: check_rbdmirror.yml
when:
- rbdmirror_group_name in group_names
- ceph_rbd_mirror_configure | default(false) | bool
- name: Monitoring related tasks
when: dashboard_enabled | bool
block:
- name: Fail if monitoring group doesn't exist
ansible.builtin.fail:
msg: "you must add a monitoring group and add at least one node."
when: groups[monitoring_group_name] is undefined
- name: Fail when monitoring doesn't contain at least one node.
ansible.builtin.fail:
msg: "you must add at least one node in the monitoring hosts group"
when: groups[monitoring_group_name] | length < 1
- name: Fail when dashboard_admin_password and/or grafana_admin_password are not set
ansible.builtin.fail:
msg: "you must set dashboard_admin_password and grafana_admin_password."
when:
- dashboard_admin_password is undefined
or grafana_admin_password is undefined
- name: Validate container registry credentials
ansible.builtin.fail:
msg: 'ceph_docker_registry_username and/or ceph_docker_registry_password variables need to be set'
when:
- ceph_docker_registry_auth | bool
- (ceph_docker_registry_username is not defined or ceph_docker_registry_password is not defined) or
(ceph_docker_registry_username | string | length == 0 or ceph_docker_registry_password | string | length == 0)
- name: Validate container service and container package
ansible.builtin.fail:
msg: 'both container_package_name and container_service_name should be defined'
when:
- (container_package_name is undefined and container_service_name is defined) or
(container_package_name is defined and container_service_name is undefined)
- name: Validate openstack_keys key format
ansible.builtin.fail:
msg: '{{ item.name }} key format invalid'
with_items: '{{ openstack_keys }}'
when:
- osd_group_name in group_names
- openstack_keys is defined
- openstack_keys | length > 0
- item.key is defined
- item.key is not match("^[a-zA-Z0-9+/]{38}==$")
- name: Validate clients keys key format
ansible.builtin.fail:
msg: '{{ item.name }} key format invalid'
with_items: '{{ keys }}'
when:
- client_group_name in group_names
- keys is defined
- keys | length > 0
- item.key is defined
- item.key is not match("^[a-zA-Z0-9+/]{38}==$")
- name: Validate openstack_keys caps
ansible.builtin.fail:
msg: '{{ item.name }} key has no caps defined'
with_items: '{{ openstack_keys }}'
when:
- osd_group_name in group_names
- openstack_keys is defined
- openstack_keys | length > 0
- item.caps is not defined
- name: Validate clients keys caps
ansible.builtin.fail:
msg: '{{ item.name }} key has no caps defined'
with_items: '{{ keys }}'
when:
- client_group_name in group_names
- keys is defined
- keys | length > 0
- item.caps is not defined
- name: Check virtual_ips is defined
ansible.builtin.fail:
msg: "virtual_ips is not defined."
when:
- rgwloadbalancer_group_name in group_names
- groups[rgwloadbalancer_group_name] | length > 0
- virtual_ips is not defined
- name: Validate virtual_ips length
ansible.builtin.fail:
msg: "There are more virual_ips defined than rgwloadbalancer nodes"
when:
- rgwloadbalancer_group_name in group_names
- (virtual_ips | length) > (groups[rgwloadbalancer_group_name] | length)