Commit Graph

215 Commits (main)

Author SHA1 Message Date
Teoman ONAY 823700bc1b ceph_orch_apply: fix yaml error when multiple rgw deployed
ceph orch ls rgw --format=yaml returns multiple documents
when multiple rgw are installed, this was not handled
correctly.

Signed-off-by: Teoman ONAY <tonay@ibm.com>
2024-08-23 13:56:29 +02:00
Seena Fallah c1f1c1e900 radosgw_user: support caps on user
Supporting adding/removing caps on the user.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
2024-08-20 08:41:11 +02:00
Seena Fallah d6ac0cc120 ceph-pool: add support updating crush rule of the pool
Support updating crush rule of the pool via crush rule name.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
2024-08-13 11:17:36 +02:00
Teoman ONAY 5a44fbeaa6 ceph_orch_apply: fix idempotency
As is idempotency does not work as the ceph orch
output does contain more attributes than the expected
spec.

Signed-off-by: Teoman ONAY <tonay@ibm.com>
2024-05-29 16:58:37 +02:00
Teoman ONAY f6fd034e7e ceph_orch_spec: Add ceph orch apply spec feature
Add new module ceph_orch_spec which applies ceph spec files.
This feature was needed to bind extra mount points to the RGW
container (/etc/pki/ca-trust/).

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2262133

Signed-off-by: Teoman ONAY <tonay@ibm.com>
2024-05-21 10:04:47 +02:00
Seena Fallah 52365166a4 ceph-key: check for key existance on absent state
check if the key is exists before removal.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
2024-05-21 09:39:41 +02:00
Seena Fallah 878cce5b48 radosgw_user: handle non-existence user on check mode
Set return code to 0 on check mode when the user doesn't exists and it will fail the module.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
2024-05-06 09:37:12 +02:00
Seena Fallah fb13ee35bf ceph_volume: set changed to false to readonly actions
Signed-off-by: Seena Fallah <seenafallah@gmail.com>
2024-04-08 20:14:48 +02:00
Seena Fallah 326e2e4d6b ceph_crush: add support check mode
Signed-off-by: Seena Fallah <seenafallah@gmail.com>
2024-04-08 20:14:48 +02:00
Seena Fallah a45defd386 ceph_pool: add support check mode
Signed-off-by: Seena Fallah <seenafallah@gmail.com>
2024-04-03 16:31:43 +02:00
Seena Fallah ed4b6e71b3 ceph_config: compare current vals in low
Check the current value and asked both in low case as the asked one might be in capital as it should be.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
2024-03-18 18:11:43 +01:00
Seena Fallah fa2eb2532e ceph_config: add support config remove
Add support rm action.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
2024-03-18 18:11:19 +01:00
Seena Fallah a7e881439e radosgw_user: add support check mode
Signed-off-by: Seena Fallah <seenafallah@gmail.com>
2024-03-16 20:18:47 +01:00
Seena Fallah a95726c409 radosgw_user: parse system and admin as boolean
The returned payload from rgw has them as a boolean. By having them as a string it would always report a change and try to modify the user.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
2024-03-16 20:18:47 +01:00
Seena Fallah beb046cba9 radosgw_zonegroup: add support check mode
Signed-off-by: Seena Fallah <seenafallah@gmail.com>
2024-03-16 20:18:15 +01:00
Seena Fallah e8d34b6ee6 radosgw_zonegroup: parse master as boolean
The returned payload from rgw has is_master as a boolean. By having master as a string it would always report a change and try to modify the zonegroup.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
2024-03-16 20:18:15 +01:00
Seena Fallah f0b4cc3f0d ceph_ec_profile: make int params str
Ceph return them as string so in comparision it would always fail

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
2024-03-16 20:17:45 +01:00
Seena Fallah 80666a20da ceph_ec_profile: add support more plugins
Add support more plugins with their respective args.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
2024-03-16 20:17:45 +01:00
Seena Fallah b60e0134a5 ceph-volume: add support check mode
Run read-only actions on check mode

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
2024-03-15 20:59:44 +01:00
Seena Fallah e219892aeb radosgw_zone: add support zone set
Support zone set from a json doc

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
2024-03-14 19:31:45 +01:00
Guillaume Abrioux 03f1e3f48e drop iscsigw support
This service is no longer maintained.
Let's drop its support within ceph-ansible.

Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
2024-02-16 08:59:05 +01:00
Teoman ONAY bba9955bf7 bump ansible-core to 2.16
- Remove python3 shebangs
- command module warn parameter is deprecated since 2.11 and removed
  from 2.14

Signed-off-by: Teoman ONAY <tonay@ibm.com>
2024-02-14 09:54:13 +01:00
Guillaume Abrioux e4eb268a56 tests: add flake8 to tox.ini
this:
- adds flake8 to tox.ini
- addresses all flake8 errors

Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
2024-02-14 09:54:13 +01:00
Guillaume Abrioux ae2ec3d275 library: add ceph_config module
This adds the module `ceph_config`

Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
2024-02-14 09:54:13 +01:00
Guillaume Abrioux c342035fb6 library: add ceph_authtool module
This adds the module `ceph_authtool`.

Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
2024-02-14 09:54:13 +01:00
Guillaume Abrioux e433d2b955 library/ceph_crush_rule: module refactor
This refactor makes the 'name' argument not mandatory because when
'state' is 'info' we shouldn't need to pass it.

The second change is just a duplicate code removal.

Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
2024-02-14 09:54:13 +01:00
Dmitriy Rabotyagov b610297554 Do not pass NoneType as argument to ceph_crush_rule
With ansible-core 2.15 it is not possible to pass argument of unexpected
type, as otherwise module will fail with:
`'None' is not a string and conversion is not allowed`

With that we want to only get all existing crush rules, so we can simply
supply an empty string as a name argument, which would satisfy
requirements and have same behaviour for previous ansible versions.

Alternative approach would be to stop making `name` as a required
argument to the module and use empty string as default value
when info state is used.

Signed-off-by: Dmitriy Rabotyagov <noonedeadpunk@gmail.com>
2023-12-06 19:13:39 +01:00
Nathan Hoad 8923931df4 Specify the zone when requesting zonegroup information.
Signed-off-by: Nathan Hoad <nhoad@bloomberg.net>
2023-08-08 07:52:21 +02:00
Konstantin Shalygin d1f85f5ad3 library: ceph_crush: set containerized param to false to respect docstrings
Signed-off-by: Konstantin Shalygin <k0ste@k0ste.ru>
2023-08-08 07:50:47 +02:00
Guillaume Abrioux 896d82877f osd: drop filestore support
filestore objectstore will be gone in the next Ceph release.the
This drops the filestore support in ceph-ansible.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2023-05-31 23:07:13 +02:00
Guillaume Abrioux 855f742486 library: fix a bug in ceph_key module
`name` is a mandatory parameter when `state` is either
`present` or `absent` or `update` or `info`.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2023-05-31 23:07:13 +02:00
Guillaume Abrioux aaa9f1d291 ceph_key: drop unused result parameter
This parameter is not used anywhere in this function, so we can drop it.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2023-05-31 15:31:44 +02:00
Guillaume Abrioux 15b91cef90 osd: drop filestore support
filestore is about to be removed. This commit removes the filestore
support in ceph-ansible.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2023-03-03 15:00:29 +01:00
Teoman ONAY c39bbc3dea Initialize rbd pool at pool creation
When creating a RBD pool it needs to be initialized as per documentation[1]
Modified (pre_)generate_ceph_cmd to make it usable with any command with
the same parameters as the ceph command

[1]https://docs.ceph.com/en/latest/rbd/rados-rbd-cmds/#create-a-block-device-pool

Signed-off-by: Teoman ONAY <tonay@redhat.com>
2023-01-18 14:13:03 +01:00
Guillaume Abrioux e55ca01881 tests: use quay.io instead of quay.ceph.io
This makes the CI use quay.io instead of quay.ceph.io

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2022-12-13 14:38:58 +01:00
John Karasev 72ff93f685 library/radosgw_user.py: fix user update
Removes the case when display_name was defined prevously but
was not provided when modifying. Without this change the module
will change display_name to name even if display_name was not name
originally. See #7296

Signed-off-by: John Karasev <john.karasev@intel.com>
2022-10-10 11:00:58 +02:00
quangln94 e0ed0939b7 Update ceph_ec_profile.py
This parameters "crush_root" unsupported for (ceph_ec_profile) module: crush_root
Follow this issue: https://github.com/ceph/ceph-ansible/issues/7306
2022-10-05 08:38:07 +02:00
Seena Fallah bb849a5586 ceph_pool: set target size ratio on both 'on' and 'warn' mode
when we set target_size_ratio to warn it means that the administrator wants to get suggestion from the mgr module but apply it manually when he/she wants. So it's in the same approach as 'on' mode just triggered by hand.
So there is no need to set pg_num when target_size_ratio is 'warn' and the mgr module will calculate the correct pg_num and the administrator will adjust it whenever he/she wants.

It is the same approach that was in #6471

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
2022-05-31 14:37:04 +02:00
David Galloway bcedff95bd master->main
Signed-off-by: David Galloway <dgallowa@redhat.com>
2022-05-30 15:15:15 +02:00
Mathias Chapelain 65003f4ff9 library: Add radosgw_caps to manage capabilities
This commit add `radosgw_caps` module to be able to manage RadosGW users
capabilities.

Usage from module's documentation:
```YAML
- name: add users read write and all buckets capabilities
  radosgw_caps:
    name: foo
    state: present
    caps:
      - users=read,write
      - buckets=*
- name: remove usage write capabilities
  radosgw_caps:
    name: foo
    state: absent
    caps:
      - usage=write
```

This module support check mode by simulating the original `radosgw-admin`
behavior when adding capabilities.

Signed-off-by: Mathias Chapelain <mathias.chapelain@proton.ch>
2022-02-16 09:44:36 +01:00
Mathias Chapelain f0f1dd986a library/ceph_pool: Fix potential null value when creating pools
Before, creating a pool by providing *only* `pg_num` would result in an
error as it would produce `--pgp-num null`.

This commit fix this behavior by defaulting `pgp_num` value to `pg_num`.

Signed-off-by: Mathias Chapelain <mathias.chapelain@proton.ch>
2022-02-15 15:54:07 +01:00
Dmitriy Rabotyagov 2eb0a88a67 Use upstream config_template collection
In order to reduce need of module
internal maintenance and to join forces on plugin development,
it's proposed to switch to using upstream version of
config_template module.

As it's shipped as collection, it's installation for end-users
is trivial and aligns with general approach of shipping extra modules.

Signed-off-by: Dmitriy Rabotyagov <noonedeadpunk@ya.ru>
2022-01-18 20:22:10 +01:00
yasinlachiny 2a28758472 cephadm: set allow_overwrite at bootstrap step
Signed-off-by: yasinlachiny <yasin.lachiny@gmail.com>
2022-01-07 10:08:33 +01:00
Benoît Knecht 09b56a8890 library/ceph_ec_profile.py: Support CRUSH device class
The `crush_device_class` option of the `ceph_ec_profile` module was documented
but not implemented.

This commit adds it and ensures its value is updated on the corresponding EC
profile.

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
2021-12-01 08:39:14 +01:00
Guillaume Abrioux b02d71c307 ceph_volume: support overriding bind-mounts
This makes it possible to call `podman run` with custom bind-mounts.

cephadm-adopt.yml playbook needs it for a very specific use case:

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2027411

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2021-11-30 18:39:31 +01:00
Seena Fallah ae6be71b08 cephadm: set ssh configs at bootstrap step
Add support ssh_user and ssh_config to cephadm bootstrap plugin

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
2021-10-15 14:40:51 +02:00
Dimitri Savineau 687b20fb22 ceph-volume: hide OSD keyring during creation
When using ceph-volume lvm create/prepare/batch then the keyring of each
OSD created is displayed in the output.
Let's replace those by some '*' chars.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
2021-08-13 01:10:03 +02:00
Dimitri Savineau 17784624e0 library: exit on user creation failure
When the ceph dashboard user creation fails then the issue is hidden
as we don't check the return code and don't print the error message
in the module output.

This ends up with a failure on the ceph dashboard set roles command saying
that the user doesn't exist.

By failing on the user creation, we will have an explicit explaination of
the issue (like weak password).

Closes: #6197

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
2021-08-02 15:50:02 +02:00
Guillaume Abrioux 70f1d6e2cd lib/ceph-volume: support zapping by osd_id
This commit adds the support for zapping an osd by osd_id in the
ceph_volume module.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2021-07-13 09:41:21 -04:00
Wong Hoi Sing Edison beda1fe773 library: flake8 ceph-ansible modules
This commit ensure all ceph-ansible modules pass flake8 properly.

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
2021-06-30 15:39:48 +02:00