From 43b32537af2a223daa20e5ddac94c9a0d2375ff9 Mon Sep 17 00:00:00 2001 From: anpivkin Date: Wed, 15 Apr 2026 14:21:51 +0300 Subject: [PATCH] 18.2.7 --- CLAUDE.md | 88 ++++++++++++++++++ group_vars/all.yml | 2 +- .../__pycache__/ceph_config.cpython-314.pyc | Bin 6677 -> 6679 bytes .../__pycache__/ceph_crush.cpython-314.pyc | Bin 8353 -> 8355 bytes .../ceph_crush_rule_info.cpython-314.pyc | Bin 2991 -> 2993 bytes .../ceph_ec_profile.cpython-314.pyc | Bin 7263 -> 7265 bytes library/__pycache__/ceph_key.cpython-314.pyc | Bin 20192 -> 20194 bytes .../__pycache__/ceph_key_info.cpython-314.pyc | Bin 6830 -> 6832 bytes .../ceph_mgr_module.cpython-314.pyc | Bin 3222 -> 3224 bytes .../__pycache__/ceph_osd_flag.cpython-314.pyc | Bin 3415 -> 3417 bytes library/__pycache__/ceph_pool.cpython-314.pyc | Bin 19935 -> 19937 bytes .../__pycache__/ceph_volume.cpython-314.pyc | Bin 23951 -> 23953 bytes .../__pycache__/radosgw_user.cpython-314.pyc | Bin 19023 -> 19025 bytes .../__pycache__/dict2dict.cpython-314.pyc | Bin 1237 -> 1239 bytes .../ipaddrs_in_ranges.cpython-314.pyc | Bin 1643 -> 1645 bytes roles/ceph-defaults/defaults/main.yml | 2 +- vagrant.yaml | 8 +- 17 files changed, 93 insertions(+), 7 deletions(-) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..fb9525e --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,88 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project Overview + +This is **ceph-ansible** — Ansible playbooks, roles, and custom modules for deploying and managing Ceph clusters. The project is in maintenance mode; new deployments are encouraged to use `cephadm` instead. Supports Ceph releases from Dumpling (0.67) through Squid (19), with both containerized (Docker/Podman) and non-containerized deployment modes. + +## Common Commands + +### Linting +```bash +tox -e flake8 +``` +Max line length is 160 characters. Scans `./library`, `./module_utils/`, and `./tests/`. + +### Unit Tests +```bash +cd tests && py.test library/ module_utils/ +``` + +### Functional Tests (via Tox + Vagrant) +```bash +tox -e centos-container-all_daemons +tox -e ubuntu-non_container-all_daemons +tox -e rocky-container-lvm_osds +``` +Pattern: `{os}-{container|non_container}-{scenario}`. See `tox.ini` for all ~100+ environments. + +### RPM Building +```bash +make # builds SRPMs +make rpm # builds full RPMs +make clean +``` + +### After changing role defaults +```bash +./generate_group_vars_sample.sh +``` +The `group_vars/` sample files are version-controlled and must be regenerated when `roles/ceph-defaults/defaults/main.yml` changes. + +## Architecture + +### Playbook Entry Points +- `site.yml` — primary orchestration playbook; imports roles in dependency order for all daemon types (mons → osds → mgrs → clients → rgws → mdss → nfs → rbdmirrors → monitoring) +- `infrastructure-playbooks/` — operational playbooks run independently: `purge-cluster.yml`, `rolling_update.yml`, `shrink-*.yml`, `add-*.yml`, `cephadm-adopt.yml`, etc. + +### Role Dependency Chain +Most roles follow this pattern: +``` +ceph-defaults → ceph-facts → ceph-handler → ceph-validate → ceph-common → ceph-config → +``` +`ceph-defaults` is the canonical source for all configurable variables — check there before adding new variables. + +### Custom Modules (`library/`) +Python Ansible modules that wrap `ceph` CLI commands or the Ceph Python SDK: +- `ceph_key.py` — CephX authentication key management +- `ceph_pool.py` — pool create/modify/delete +- `ceph_crush.py` / `ceph_crush_rule.py` — CRUSH map management +- `ceph_ec_profile.py` — erasure coding profiles +- `ceph_fs.py` — CephFS filesystem management +- `ceph_config.py` — cluster config (`ceph config set/get`) +- `ceph_osd_flag.py` — OSD flags (noout, noscrub, etc.) +- `ceph_mgr_module.py` — mgr module enable/disable +- `ceph_volume.py` — OSD provisioning via `ceph-volume` +- `ceph_orch_apply.py` — cephadm orchestrator + +All modules share common container-execution utilities in `module_utils/ca_common.py`, which handles wrapping commands with `docker exec` or `podman exec` when running in containerized mode. + +### Filter Plugins (`plugins/filter/`) +- `dict2dict.py` — dict transformation +- `ipaddrs_in_ranges.py` — IP address filtering for network-aware config + +### Variable Precedence +1. `group_vars/all.yml.sample` — user-facing documented defaults (generated from role defaults) +2. `roles/ceph-defaults/defaults/main.yml` — authoritative defaults +3. Host/group vars in inventory — user overrides + +### Container vs. Non-Container +The boolean `containerized_deployment` variable (default: `false`) controls execution paths throughout roles and modules. When `true`, commands are prefixed with the container runtime and daemon container name. Both paths must be maintained in module code. + +## Key Conventions + +- **Commit format**: subject line (imperative mood) + blank line + body wrapped at 80 chars + `Signed-off-by:` line. Scope prefix encouraged (e.g., `ceph-osd: fix ...`). Reference issues with `Fixes: #XXXX`. +- **CI**: Jenkins runs on each PR. Add `[skip ci]` to PR title to bypass. Mergify handles merging (requires approval + CI pass). +- **Python style**: flake8, max 160 chars, no E501/W503. +- **Ansible collections required**: `ansible.utils`, `community.general`, `ansible.posix`, `openstack.ansible-config_template` — install with `ansible-galaxy collection install -r requirements.yml`. diff --git a/group_vars/all.yml b/group_vars/all.yml index 0cd5081..32e4d9f 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -155,7 +155,7 @@ ceph_repository: community # ceph_mirror: https://download.ceph.com ceph_stable_key: https://download.ceph.com/keys/release.asc -ceph_stable_release: squid +ceph_stable_release: 18.2.7 ceph_stable_repo: "{{ ceph_mirror }}/debian-{{ ceph_stable_release }}" #nfs_ganesha_stable: true # use stable repos for nfs-ganesha diff --git a/library/__pycache__/ceph_config.cpython-314.pyc b/library/__pycache__/ceph_config.cpython-314.pyc index e95c9d90d080539387e034880e90d7b1cf1631da..258d3ae108776547ccd43f1995f0e7dfb8113e7d 100644 GIT binary patch delta 63 zcmbPgGTnq*n~#@^0SJ_G?{DPZ$f0VjA6lGRRIHy~l$n>3TBILPl%JKFTvDu`m{**c Rl#{BPoLZ2v`96o4AOKXY6v6-i delta 61 zcmbPkGS!4zn~#@^0SE*RZrsSdkwe*1KO;XkRX;s7H#09&KcFZ-D>b>KSU)+nAVW7X PuQ)R)Cw22f4l_XjD=`!K diff --git a/library/__pycache__/ceph_crush.cpython-314.pyc b/library/__pycache__/ceph_crush.cpython-314.pyc index deb381b8733e4aa2a470be4f636a2f6291f4b9f8..57c81534ef819025aa11fe4aaed99c01aaf65c05 100644 GIT binary patch delta 63 zcmZ4JxY&_fn~#@^0SJ_G?{DP3!KP}ZA6lGRRIHy~l$n>3TBILPl%JKFTvDu`m{**c Rl#{BPoLZ2vnT>t6BmiV{6srIL delta 61 zcmZ4NxX_VXn~#@^0SE*RZrsRygH72&KO;XkRX;s7H#09&KcFZ-D>b>KSU)+nAVW7X PuQ)R)Cv`Ii`)o-7I!hDc diff --git a/library/__pycache__/ceph_crush_rule_info.cpython-314.pyc b/library/__pycache__/ceph_crush_rule_info.cpython-314.pyc index 1e4a41c53eef435b007b6444c952781e36518d5a..0310054d3da66ee01549fb58f1f46acdfc9c23f4 100644 GIT binary patch delta 63 zcmZ24zEPZ8n~#@^0SJ_G?{DPpXH|944=qkDD%MXg%FIhiEz%Dt%FjwoE-BVe%qz}J R%1PBtPA$mTyqEP8D*#VQ6)OM$ delta 61 zcmdlezFwSLn~#@^0SE*RZrsS-&#LUCpOK%Ns-K>ko0*rXA5fH^m6}{qte>1(kfEEH PSDcxYle&37>nBzKCK424 diff --git a/library/__pycache__/ceph_ec_profile.cpython-314.pyc b/library/__pycache__/ceph_ec_profile.cpython-314.pyc index 29fd08731884511188c3550a8fabce3e7f2004e6..1ebb6607fa3861536a02430c4d58089f49bf7db5 100644 GIT binary patch delta 63 zcmca_@z8=>n~#@^0SJ_G?{DPxVln~#@^0SE*RZrsT2%b{$mpOK%Ns-K>ko0*rXA5fH^m6}{qte>1(kfEEH PSDcxYle)Q<b8P|Cf(kvmUV)j~hCIJKx)KfNe3FD11|KcFZ-D>b>KSU)kZ TI5R0HRW~`cAY=0!VHaxvr27@| delta 63 zcmaDfm+`?|Ms96BUM>b85IDGTBX^##vYCEHer~FMdTMTFUZ#FPQGQlxa!Ij%a%w?_ RZem_>W>QY-=6S*{)&O}U6(|4z diff --git a/library/__pycache__/ceph_key_info.cpython-314.pyc b/library/__pycache__/ceph_key_info.cpython-314.pyc index 9fb0b81677afafda8ca2754f95924011f2c92999..f1e032c303770644ade173c80e879b7afbefe286 100644 GIT binary patch delta 63 zcmZ2yy1|rNn~#@^0SJ_G?{DNb=2W%S4=qkDD%MXg%FIhiEz%Dt%FjwoE-BVe%qz}J R%1PBtPA$mToXF`b2mnde6cqpf delta 61 zcmdmBy3Ukan~#@^0SE*RZrsRi%&BaxpOK%Ns-K>ko0*rXA5fH^m6}{qte>1(kfEEH PSDcxYle#&X(^n7xAm|fJ diff --git a/library/__pycache__/ceph_mgr_module.cpython-314.pyc b/library/__pycache__/ceph_mgr_module.cpython-314.pyc index 52026a9622b75a4f4e5f8b4505c51f41cdd27ed0..0c4b6054d875bab7b2238e89796d90cc59afacf4 100644 GIT binary patch delta 63 zcmbOxIYW|Ln~#@^0SJ_G?{DPx;8eBO4=qkDD%MXg%FIhiEz%Dt%FjwoE-BVe%qz}J R%1PBtPA$mTT*j%u3;;CG6P^G7 delta 61 zcmbOsIZcvVn~#@^0SE*RZrsT2!KrMkpOK%Ns-K>ko0*rXA5fH^m6}{qte>1(kfEEH PSDcxYle)QrQ-K)(41*HY diff --git a/library/__pycache__/ceph_osd_flag.cpython-314.pyc b/library/__pycache__/ceph_osd_flag.cpython-314.pyc index dda3e2d6ccca7fef2f92248371e36abc146833c8..f233e6aae9f79aabaf3a001767a0a92a00a35b1a 100644 GIT binary patch delta 63 zcmcaEbyJF4n~#@^0SJ_G?{DO0En~#@^0SE*RZrsSt$fazppOK%Ns-K>ko0*rXA5fH^m6}{qte>1(kfEEH PSDcxYle*cEOM@8z9#s<4 diff --git a/library/__pycache__/ceph_pool.cpython-314.pyc b/library/__pycache__/ceph_pool.cpython-314.pyc index ab31b9335ed0ddc62496e8b5c94b514e73efdf0c..8d27edac67a258c706094631f4f40f258017af32 100644 GIT binary patch delta 65 zcmcaVoAKdnMs96BUM>b8P|Cf(kvoK6)lxsSIJKx)KfNe3FD11|KcFZ-D>b>KSU)kZ TI5R0HRW~`cAY*eAf2b85IDGTBXW>QY-<`(`~I{b>KSU)kZ TI5R0HRW~`cAY=1!(G%_fm7NxN delta 63 zcmbQZo3Vd4BeymmFBbz42prtFk$a}7vZa1Ter~FMdTMTFUZ#FPQGQlxa!Ij%a%w?_ RZem_>W>QY-=98i)+yQDa6|VpQ diff --git a/library/__pycache__/radosgw_user.cpython-314.pyc b/library/__pycache__/radosgw_user.cpython-314.pyc index 9b2558577f0c95785cd1db2001e7c4ca0b538851..5643846c6d30ca267f84ef6f5b86be0b8aa2d20e 100644 GIT binary patch delta 65 zcmX>b8P|Cf(kz18l)kZ(GIJKx)KfNe3FD11|KcFZ-D>b>KSU)kZ TI5R0HRW~`cAY*ed?;jfgi!Bx0 delta 63 zcmcaOh4K6pMs96BUM>b85IDGTBeyEAvXy>Der~FMdTMTFUZ#FPQGQlxa!Ij%a%w?_ RZem_>W>QY-=1|^0HUMB#6%zme diff --git a/plugins/filter/__pycache__/dict2dict.cpython-314.pyc b/plugins/filter/__pycache__/dict2dict.cpython-314.pyc index c5fe229b919598e3cf403a0d1ef213ce216cfcc1..c97bfaff334383157d760a7b5efd60f821acab18 100644 GIT binary patch delta 63 zcmcc0d7YD6n~#@^0SJ_G?{DN5Wm0v}4=qkDD%MXg%FIhiEz%Dt%FjwoE-BVe%qz}J R%1PBtPA$mT?94QY2>?N~6Z!xE delta 61 zcmcc4d6kn}n~#@^0SE*RZrsQ%%A{ko0*rXA5fH^m6}{qte>1(kfEEH PSDcxYle*cJX%Z6v86Fcc diff --git a/plugins/filter/__pycache__/ipaddrs_in_ranges.cpython-314.pyc b/plugins/filter/__pycache__/ipaddrs_in_ranges.cpython-314.pyc index d56e8ab62bd47f7e2cf1f8c47f33eaa64e285cf0..00cf8fe583f3aeb3f145cda64127ea8a88e2a604 100644 GIT binary patch delta 63 zcmaFO^OlEOn~#@^0SJ_G?{DO8XHxah4=qkDD%MXg%FIhiEz%Dt%FjwoE-BVe%qz}J R%1PBtPA$mTyp?GiGXP~Z6+Hj| delta 61 zcmaFM^O}cSn~#@^0SE*RZrsS-&ZO+7pOK%Ns-K>ko0*rXA5fH^m6}{qte>1(kfEEH PSDcxYle&33(>7)RJ4Y0B diff --git a/roles/ceph-defaults/defaults/main.yml b/roles/ceph-defaults/defaults/main.yml index 938ef52..528ea0a 100644 --- a/roles/ceph-defaults/defaults/main.yml +++ b/roles/ceph-defaults/defaults/main.yml @@ -147,7 +147,7 @@ valid_ceph_repository: # ceph_mirror: https://download.ceph.com ceph_stable_key: https://download.ceph.com/keys/release.asc -ceph_stable_release: squid +ceph_stable_release: reef ceph_stable_repo: "{{ ceph_mirror }}/debian-{{ ceph_stable_release }}" nfs_ganesha_stable: true # use stable repos for nfs-ganesha diff --git a/vagrant.yaml b/vagrant.yaml index f8a9807..857c15f 100644 --- a/vagrant.yaml +++ b/vagrant.yaml @@ -1,17 +1,17 @@ all: hosts: ceph1: - ansible_host: 192.168.1.59 + ansible_host: 192.168.1.52 ansible_user: foo ansible_password: qweqwe become_password: qweqwe ceph2: - ansible_host: 192.168.1.152 + ansible_host: 192.168.1.91 ansible_user: foo ansible_password: qweqwe become_password: qweqwe ceph3: - ansible_host: 192.168.1.96 + ansible_host: 192.168.1.136 ansible_user: foo ansible_password: qweqwe become_password: qweqwe @@ -22,8 +22,6 @@ all: mons: hosts: ceph1: - ceph2: - ceph3: osds: hosts: ceph1: