{"id":18800612,"url":"https://github.com/ceph/cephadm-ansible","last_synced_at":"2025-04-04T12:07:24.514Z","repository":{"id":37851226,"uuid":"364964444","full_name":"ceph/cephadm-ansible","owner":"ceph","description":"ansible playbooks to be used with cephadm","archived":false,"fork":false,"pushed_at":"2025-03-28T09:11:53.000Z","size":431,"stargazers_count":128,"open_issues_count":12,"forks_count":56,"subscribers_count":78,"default_branch":"devel","last_synced_at":"2025-03-28T09:23:34.009Z","etag":null,"topics":["ceph","cephadm"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ceph.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-06T15:56:46.000Z","updated_at":"2025-03-28T08:04:46.000Z","dependencies_parsed_at":"2023-11-08T13:40:04.547Z","dependency_job_id":"12e9384b-89be-49bb-9eb5-04b98bab5830","html_url":"https://github.com/ceph/cephadm-ansible","commit_stats":{"total_commits":186,"total_committers":17,"mean_commits":"10.941176470588236","dds":"0.33870967741935487","last_synced_commit":"1d3efbc73b82ea44833874572c5edd632b8c44b7"},"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceph%2Fcephadm-ansible","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceph%2Fcephadm-ansible/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceph%2Fcephadm-ansible/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceph%2Fcephadm-ansible/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ceph","download_url":"https://codeload.github.com/ceph/cephadm-ansible/tar.gz/refs/heads/devel","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247174418,"owners_count":20896078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ceph","cephadm"],"created_at":"2024-11-07T22:19:23.085Z","updated_at":"2025-04-04T12:07:24.488Z","avatar_url":"https://github.com/ceph.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cephadm-ansible\n\ncephadm-ansible is a collection of Ansible playbooks and modules\nto simplify workflows that are not covered by [cephadm].\n\nSome examples of workflows covered with playbooks are the following:\n\n* Distribute ssh key: Copy an SSH public key to a specified user on remote hosts\n* Preflight: Initial setup of hosts before bootstrapping the cluster\n* Client: Setting up client hosts\n* Purge: Remove a Ceph cluster\n* RocksDB resharding: Reshard the rocksDB database for a given OSD\n* Insecure registry: Add registry as insecure to registries.conf\n\nThis project provides some Ansible modules which allow you to write your own playbooks:\n\n* cephadm_registry_login: Log in to container registry\n* cephadm_bootstrap: Bootstrap a Ceph cluster using cephadm\n* ceph_orch_host: Add/Remove hosts (Can also add label(s) to hosts)\n* ceph_orch_apply: Apply a service spec\n* ceph_orch_daemon: Stop/Start daemon(s)\n* ceph_config: Set ceph configuration\n\n# Terminology\n**\u003cins\u003eadmin host\u003c/ins\u003e:**\\\nA host where the admin keyring and ceph config file is present.\\\nAlthough the admin host and the bootstrap host are usually the same host, it is possible to have multiple admin hosts later.\\\n`cephadm` will make a host become 'admin' when the label `_admin` is added to that host. (ie: `ceph orch host label add \u003chost\u003e _admin`).\\\nThis hosts should be present in the group `[admin]` in the ansible inventory.\\\nIf for some reason you decide a host shouldn't be a 'admin host' anymore, you have to :\n\n* remove it from the group `[admin]` in the ansible inventory,\n* remove the admin keyring,\n* remove the ceph config file,\n* remove the '_admin' label. (ie `ceph orch host label rm \u003chost\u003e _admin`)\n\n\n**\u003cins\u003eansible host\u003c/ins\u003e:**\\\nThe host where any cephadm-ansible playbook is run.\n\n**\u003cins\u003ebootstrap host\u003c/ins\u003e:**\\\nThe host where the ceph cluster will start.\\\nUnless you pass `--skip-admin-label` option to `ceph bootstram` command, this host will get the admin keyring and the ceph config file present, therefore, it should be considered as an 'admin host'.\nThis hosts should be present in the group `[admin]` in the ansible inventory.\n\n\n# Ansible inventory\nThe ansible inventory is a file where all the hosts intended to be part of the ceph cluster will be listed.\\\nThe most common format are INI or YAML.\n\nAlthough you probably want to keep it as simple as possible, you can organize your inventory and create groups, `cephadm-ansible` won't make any difference except for the following requirements:\n\n* Client hosts must be defined in a dedicated group `[clients]`.\n* Both `cephadm-purge-cluster.yml` and `cephadm-clients.yml` playbooks requires a group `[admin]` with at least one admin host (usually it will be the bootstrap node).\n\n\u003e **__NOTE:__** the name of the client group can be changed. In that case you have to set the variable `client_group`.\n\nOtherwise, you can create groups such as `[monitors]`, `[osds]`, `[rgws]`, that might help you keep clarity in your inventory file and probably ease the `--limit` usage if you plan to use it to target a group of node only.\n\nA basic inventory would look like following:\n\n```ini\n# cat hosts\nceph-mon1\nceph-mon2\nceph-mon3\nceph-osd1\nceph-osd2\nceph-osd3\nceph-mds1\nceph-mds2\nceph-rgw1\nceph-rgw2\n\n[clients]\nceph-client1\nceph-client2\nceph-client3\n\n[admin]\nceph-mon1\n```\n\n\n# Preflight\n\nThis playbook configures the Ceph repository.\nIt also installs some prerequisites (podman, lvm2, chronyd, cephadm, ...)\n\n## Usage:\n\n```\nansible-playbook -i \u003cinventory host file\u003e cephadm-preflight.yml\n```\n\nYou can limit the execution to a set of hosts by using `--limit` option:\n\n```\nansible-playbook -i \u003cinventory host file\u003e cephadm-preflight.yml --limit \u003cmy_osd_group|my_node_name\u003e\n```\n\nYou can override variables using `--extra-vars` parameter:\n\n```\nansible-playbook -i \u003cinventory host file\u003e cephadm-preflight.yml --extra-vars \"ceph_origin=rhcs\"\n```\n\nIf you plan to deploy client nodes, you must define a group called \"clients\" in your inventory:\n\neg:\n\n```\n$ cat hosts\nnode1\nnode2\nnode3\n\n[clients]\nclient1\nclient2\nclient3\nnode123\n```\n\nThen you can run the playbook as shown above.\n\nOptions:\n\n`ceph_origin`: The source of Ceph repositories.\\\n**valid values:**\n\n* `rhcs`: Repository from Red Hat Ceph Storage.\n* `community`: Community repository (https://download.ceph.com)\n* `custom`: Custom repository.\n* `shaman`: Devel repository.\n\n**default**: community\n\n`ceph_stable_key`: URL to the gpg key.\\\n**default**: https://download.ceph.com/keys/release.asc\n\n`ceph_release`: The release of Ceph.\n**default**: pacific\n\n`ceph_dev_branch`: The development branch to be used in shaman when `ceph_origin` is 'shaman'.\\\n**default**: main\n\n`ceph_dev_sha1`: The sha1 corresponding to the build to be used when `ceph_origin` is 'shaman'.\\\n**default**: latest\n\n`custom_repo_url`: The url of the repository when `ceph_origin` is 'custom'.\n`custom_repo_gpgkey`: The url of the gpg key corresponding to the repository set in `custom_repo_url` when `ceph_origin` is 'custom'.\n\n# Purge\n\nThis playbook purges a Ceph cluster managed with cephadm\n\nYou must define a group `[admin]` in your inventory with a node where\nthe admin keyring is present at `/etc/ceph/ceph.client.admin.keyring`\n\n## Usage:\n\n```\nansible-playbook -i \u003cinventory host file\u003e cephadm-purge-cluster.yml -e fsid=\u003cyour fsid\u003e\n```\n\n[cephadm]: https://docs.ceph.com/en/latest/cephadm/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceph%2Fcephadm-ansible","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fceph%2Fcephadm-ansible","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceph%2Fcephadm-ansible/lists"}