This repository contains the ceph.automation Ansible Collection.
Tested with ansible-core >=2.15 releases and the current development version of ansible-core.
Some modules and plugins require external libraries. Please check the requirements for each plugin or module you use in the documentation to find out which requirements are needed.
Please check the included content on the Ansible Galaxy page for this collection.
ansible-galaxy collection install ceph.automation
You can also include it in a requirements.yml file and install it via ansible-galaxy collection install -r requirements.yml using the format:
collections:
- name: ceph.automationTo upgrade the collection to the latest available version, run the following command:
ansible-galaxy collection install ceph.automation --upgradeYou can also install a specific version of the collection, for example, if you need to downgrade when something is broken in the latest version (please report an issue in this repository). Use the following syntax where X.Y.Z can be any available version:
ansible-galaxy collection install ceph.automation:==X.Y.ZSee Ansible Using collections for more details.
Several modules run Ceph commands either through cephadm (cephadm shell ceph …) or directly with the ceph binary on the target (keyring auth). This matters for clusters not managed by cephadm (for example some Proxmox VE setups).
| Parameter | Default | Purpose |
|---|---|---|
use_cephadm |
true |
true: cephadm shell; false: host ceph |
cluster |
ceph |
Cluster name for host ceph (--cluster) |
ceph_client |
client.admin |
Client name for host ceph (-n) |
keyring |
(derived) | Keyring path; default /etc/ceph/<cluster>.<ceph_client>.keyring |
These options are documented on each affected module and shared via the ceph.automation.ceph_cli doc fragment.
Use the ceph_cli action group so you set use_cephadm once (see meta/runtime.yml for the module list):
- name: Manage Ceph without cephadm shell
hosts: ceph_nodes
become: true
module_defaults:
group/ceph.automation.ceph_cli:
use_cephadm: false
# Optional if paths differ from defaults:
# cluster: ceph
# ceph_client: client.admin
# keyring: /etc/ceph/ceph.client.admin.keyring
tasks:
- name: Read a config value
ceph.automation.ceph_config:
action: get
who: global
option: osd_pool_default_size- hosts: mixed
become: true
module_defaults:
group/ceph.automation.ceph_cli:
use_cephadm: true
tasks:
- name: This task uses host ceph instead
ceph.automation.ceph_config:
use_cephadm: false
action: get
who: global
option: osd_pool_default_sizecephadm_registry_login only works with cephadm. It fails if use_cephadm: false.
See the changelog.
- Ansible Collection overview
- Ansible User guide
- Ansible Developer guide
- Ansible Collections Checklist
- Ansible Community code of conduct
- The Bullhorn (the Ansible Contributor newsletter)
- News for Maintainers
Apache License, Version 2.0.
See LICENSE to see the full text.