Skip to content

Comments

feat: replace raw cephadm commands with ceph.cephadm collection modules#867

Draft
fabiendupont wants to merge 3 commits intoseapath:mainfrom
fabiendupont:feat/migrate-to-cephadm-ansible
Draft

feat: replace raw cephadm commands with ceph.cephadm collection modules#867
fabiendupont wants to merge 3 commits intoseapath:mainfrom
fabiendupont:feat/migrate-to-cephadm-ansible

Conversation

@fabiendupont
Copy link

@fabiendupont fabiendupont commented Feb 18, 2026

Replace raw command: calls to cephadm/ceph CLI with idempotent modules from the ceph.cephadm Ansible collection across day-1 (deploy) and day-2 (remove/replace) operations.

Key changes:

  • Add ceph.cephadm collection dependency (ansible-requirements.yaml)
  • Use cephadm_bootstrap, cephadm_registry_login, ceph_orch_host, ceph_orch_apply, and ceph_config modules in place of command: tasks
  • Simplify SSH key distribution using ceph cephadm get-pub-key
  • Split multi-document spec.yaml.j2 into single-document templates for ceph_orch_apply compatibility
  • Add cephadm_preflight.yaml for host preparation (Debian, CentOS, OracleLinux, Yocto)
  • Rewrite machine removal with graceful drain before host removal, falling back to forced offline removal when host is unreachable
  • Add complete machine replacement playbook (drain, remove, add, OSD)
  • Extract setup_user.yml for independent inclusion from playbooks
  • Fix ceph.conf.j2 bug: replace undefined cephadm_network variable with public_network / cluster_network from inventory
  • Apply ceph_conf_overrides via ceph_config (was silently ignored)

Depends on #866

fabiendupont and others added 3 commits February 17, 2026 18:26
In the current implementation, every node installs a registry locally
and pull/push the cephadm image. However, this is neither truly
disconnected as pull requires internet, nor resource efficient as a
single registry is enough.

This commit introduces a registry role that deploys
docker.io/registry:v2 and allows importing images from internet (pull)
or from an exported tarball (load). The seapath_setup_disconnected.yaml
playbook installs the registry on the Ansible control node as a
singleton.

TLS is enabled by default: the registry auto-generates a self-signed CA
and server certificate when no user-provided certs are given. The CA is
distributed to all cluster nodes so they trust the registry over HTTPS.
The registry listens on port 443 to avoid specifying the port in image
names.

The *_physical_machine roles are updated to use that registry as a
mirror, which doesn't require changing the images names, both for Docker
and Podman. They install the registry CA certificate in certs.d and set
insecure = false when TLS is enabled.

The cephadm role is updated to remove image management, which is now
handled by the registry role, so cephadm is focused on Ceph cluster
management.

Contributes to seapath#442

Co-authored-by: Fabien Dupont <fdupont@redhat.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Fabien Dupont <fdupont@redhat.com>
Replace raw `command:` calls to cephadm/ceph CLI with idempotent modules
from the ceph.cephadm Ansible collection across day-1 (deploy) and day-2
(remove/replace) operations.

Key changes:
- Add ceph.cephadm collection dependency (ansible-requirements.yaml)
- Use cephadm_bootstrap, cephadm_registry_login, ceph_orch_host,
  ceph_orch_apply, and ceph_config modules in place of command: tasks
- Simplify SSH key distribution using ceph cephadm get-pub-key
- Split multi-document spec.yaml.j2 into single-document templates
  for ceph_orch_apply compatibility
- Add cephadm_preflight.yaml for host preparation (Debian, CentOS,
  OracleLinux, Yocto)
- Rewrite machine removal with graceful drain before host removal,
  falling back to forced offline removal when host is unreachable
- Add complete machine replacement playbook (drain, remove, add, OSD)
- Extract setup_user.yml for independent inclusion from playbooks
- Fix ceph.conf.j2 bug: replace undefined cephadm_network variable
  with public_network / cluster_network from inventory
- Apply ceph_conf_overrides via ceph_config (was silently ignored)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Fabien Dupont <fdupont@redhat.com>
Merge CentOS and OracleLinux roles into unified redhat* roles, introduce
ansible_os_family-based conditionals, and add Rocky/AlmaLinux detection.
This reduces maintenance burden and enables adoption of new RHEL-family
distros without duplicating roles.

Changes:
- Add Rocky and AlmaLinux detection in detect_seapath_distro
- Set ansible_os_family for Yocto; use native ansible_os_family for
  RedHat/Debian families
- Create roles/redhat (merged centos + oraclelinux base setup)
- Create roles/redhat_physical_machine (merged physical machine roles)
- Create roles/redhat_hypervisor (renamed from centos_hypervisor)
- Create roles/redhat_tests (renamed from oraclelinux_tests)
- Merge CentOS.yml/OracleLinux.yml vars into RedHat.yml across 8 roles
- Create unified seapath_setup_prerequisredhat.yaml playbook
- Update all playbook conditionals to use ansible_os_family == "RedHat"
- Delete old centos*, oraclelinux* roles and prerequisite playbooks

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fabien Dupont <fdupont@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant