Commit Graph

5581 Commits (e31363ea9b7b39d0ea34a26f693ed58874caa42d)
 

Author SHA1 Message Date
Teoman ONAY e31363ea9b dashboad: rgw frontends entries in ceph.conf are incorrect
There was multiple rgw frontends entries while there was just one
rgw instance on each host. The other entries were the details from
the other rgw hosts in the cluster

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

Signed-off-by: Teoman ONAY <tonay@ibm.com>
2023-09-27 11:58:43 +02:00
Teoman ONAY fe0dd57f71 Speed up the some facts settings by running them once
Signed-off-by: Teoman ONAY <tonay@ibm.com>
2023-09-27 11:58:29 +02:00
Teoman ONAY e832c9e308 Fix selinux label issues
Add --security-opt label=disable to all containers
accessing /var/lib/ceph. podman selinux relabeling behavious changed
since version podman-3:4.2.0-1 which prevent some containers to access
files in these subdirectories.

Signed-off-by: Teoman ONAY <tonay@ibm.com>
2023-07-11 11:35:19 +02:00
Teoman ONAY 2d0de9184a Fixes selinux relabeling issue for nfs container
Signed-off-by: Teoman ONAY <tonay@ibm.com>
2023-07-11 11:35:19 +02:00
Teoman ONAY bb92e27707 shrink-osd fails when the OSD container is stopped
ceph-volume simple scan cannot be executed as it is meant to be
run inside the OSD container.

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

Signed-off-by: Teoman ONAY <tonay@ibm.com>
2023-03-16 10:48:25 +01:00
Guillaume Abrioux badd681d97 ceph-config: make sure rgw_instances is set
We need to make sure `rgw_instances` is set before `ceph.conf` is
rendered. Otherwise, the `ceph-crash` play in the main playbook updates
(via ceph-handler) the `ceph.conf` on rgw nodes and removes rgw instances
sections.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit e47288ef6c)
2023-02-07 10:57:35 +01:00
Teoman ONAY a76ae5af16 Updates ceph systemd unit files and reloads systemd
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2147570

Signed-off-by: Teoman ONAY <tonay@ibm.com>
2023-01-31 14:19:08 +01:00
Guillaume Abrioux b368ea1c33 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>
(cherry picked from commit e55ca01881)
2023-01-24 10:08:47 +01:00
Guillaume Abrioux fc202a7598 tests: pin ubuntu 20.04 version in github action for pytest
3.6 has reached EOL and is no longer supported in newer ubuntu releases.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2023-01-20 15:10:59 +01:00
Teoman ONAY afe3f04376 whitelist->allowlist in tox/ini
https://github.com/tox-dev/tox/blob/master/docs/changelog.rst#v3180-2020-07-23

Signed-off-by: Teoman ONAY <tonay@ibm.com>
2023-01-20 14:48:28 +01:00
David Galloway 1b911e3f83 whitelist->allowlist
https://github.com/tox-dev/tox/blob/master/docs/changelog.rst#v3180-2020-07-23

Signed-off-by: David Galloway <dgallowa@redhat.com>
2023-01-20 14:45:19 +01:00
Guillaume Abrioux 534fdd9958 facts: fsid tasks when deploying clients Ceph with external cluster
These tasks are unnecessary executed when deploying client nodes on
an external Ceph cluster.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2023-01-03 13:43:06 +01:00
Teoman ONAY 2c94bac7db Setting fact _radosgw_address fail when RGW is on a different network
Changed the when condition to only execute that fact setting on RGW
nodes while before it was run on all nodes and failed if the node
was not on the same network range as the RGW.

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

Signed-off-by: Teoman ONAY <tonay@redhat.com>
(cherry picked from commit 590e57cc1b)
2022-10-20 16:24:43 +02:00
Guillaume Abrioux 3cca408738 switch-to-containers: ignore errors when stopping service
There might be cases where it can break idempotency.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 09b8f7b2ea)
2022-10-17 10:31:45 +02:00
Guillaume Abrioux 37db27eefa switch-to-containers: fix rbd-mirror migration
`--state=enabled` isn't a valid filter so the unit from the packaging
never gets removed.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 7664da58da)
2022-10-15 07:09:13 +02:00
Guillaume Abrioux 5a47840044 rbd-mirror: add rx peer only once
in order to avoid the following error:

```
multiple RX peers are not currently supported
```

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit aa64747cd1)
2022-09-14 09:33:19 +02:00
Guillaume Abrioux cf36d5e8e8 rbd-mirror: fix multiple rbd-mirror daemon support
This `run_once: true` breaks multiple rbd-mirror daemons support
as it would make all rbd-mirror daemons use the same keyring.
Each rbd-mirror daemon needs its own keyring in order to start.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit cfe6ca7adf)
2022-09-12 15:30:19 +02:00
Guillaume Abrioux f6058d2599 tests: remove galaxy requirements step
This is not needed in this branch.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2022-09-12 14:22:13 +02:00
Guillaume Abrioux 0b82f0bd29 rbd-mirror: fix keyring setup
This task doesn't setup a proper keyring.
This task wasn't backported because it relies on a feature of the `ceph_key` module that wasn't
available in the branch `rhcs-4.3`.

Given that this feature is now backported, let's use it.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2022-09-12 14:22:13 +02:00
Dimitri Savineau c1dd0a6cbe library/ceph_key: add output format parameter
The ceph_key module currently only supports the json output for the
info state.
When using this state on an entity then we something want the output
as:
  - plain for copying it to another node.
  - json in order to get only a subset information of the entity (like
the key or caps).

This patch adds the output_format parameter which uses json as a
default value for backward compatibility. It removes the internal and
hardcoded variable also called output_format.
In addition of json and plain outputs, there's also xml and yaml
values available.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit 7d3d51d6da)
2022-09-12 14:22:13 +02:00
Guillaume Abrioux a8fe484e15 ceph-config: allow overriding osd_memory_target
If `osd_memory_target` is set in group_vars, the default value (4Gb)
should be overridden.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 03713070eb)
2022-08-16 12:00:36 +02:00
Guillaume Abrioux 694be0dce9 facts: set is_rgw_instances_defined from configure_dashboard
When we come from configure_dashboard.yml, this fact should be set if
`rgw_instances` is defined in group_vars/host_vars. Otherwise, the next
task that set the fact `rgw_instances` will be run as it will assume it
wasn't user defined.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 33ac715cfb)
2022-08-11 17:01:48 +02:00
Guillaume Abrioux f3296c18d8 config: use osd_memory_target value from ceph_conf_overrides if defined
otherwise it's impossible to override `osd_memory_target`
via `ceph_conf_overrides`.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit cf4836dc95)
2022-08-10 16:32:49 +02:00
Guillaume Abrioux 611c8399ff rbd-mirror: do not call config_template with fqcn
This branch supports Ansible 2.9 only which doesn't use collections.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2022-08-09 06:55:02 +02:00
Guillaume Abrioux 97c3b9691d replace 'master' references with 'main'
Because the branch'master' was renamed 'main'

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 0ce39416e8)
2022-08-08 13:46:31 +02:00
Guillaume Abrioux 9167e19b1c tests: skip rbdmirror tests on non-secondary daemon
the daemon is not running on the 'primary' daemon.
Therefore, these tests are not needed.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 37e67fb672)
2022-08-08 13:06:50 +02:00
Guillaume Abrioux 056de01714 tests: set no_log_on_ceph_key_tasks=false
In order to not have to always reproduce it when a failure shows up in the CI
having the failure logged can make us save some time.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit f1239b6907)
2022-08-08 13:05:23 +02:00
Guillaume Abrioux 64d912bad2 rbd-mirror: follow up on recent rbd-mirror refactor
- ensure /var/lib/ceph/bootstrap-rbd-mirror exists
- always install ceph-base on rbdmirror nodes (otherwise, ceph-crash
  isn't present)

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 041435e1e3)
(cherry picked from commit b634fb1cb3)
(cherry picked from commit 302da16c27)
2022-08-08 13:05:23 +02:00
Teoman ONAY 0ab159242a Set ceph_rbd_mirror_pool default value
Signed-off-by: Teoman ONAY <tonay@redhat.com>
(cherry picked from commit 0c50bfac98)
(cherry picked from commit 8a0b5a9571)
(cherry picked from commit 4359464bb6)
2022-08-08 13:05:23 +02:00
Guillaume Abrioux ee5303bd0f rbd-mirror: major refactor
- Use config-key store to add cluster peer.
- Support multiple pools mirroring.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit b74ff6e22c)
2022-08-08 13:05:20 +02:00
Guillaume Abrioux 658274b7f2 config: do not always set _osd_memory_target
When 'osd_memory_target' is overridden in ceph_conf_overrides.
The task that sets the fact `osd_memory_target` in the ceph-config role
should be skipped.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2056675#c11

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit cb5d6b48fb)
2022-08-08 09:46:26 +02:00
Teoman ONAY 89d7518db8 Playbook fails when using --limit to install new MDS
"set_fact container_run_cmd" is not set when using --limit on MDS as facts
were not run on first MON.

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

Signed-off-by: Teoman ONAY <tonay@redhat.com>
(cherry picked from commit 9a4a3f5f19)
2022-08-01 15:55:20 +02:00
Guillaume Abrioux 76ae5f9ef7 config: followup on 8a5628b51
Add missing `--cluster {{ cluster }}` on task
`set osd_memory_target` in the main.yml file of the
ceph-config role.
Also it moves the task after ceph configuration file is actually written.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 9f59c7286f)
2022-07-22 11:12:26 +02:00
Guillaume Abrioux 4661c5679f shrink-osd: use command instead of ceph_volume_simple_scan
This module isn't available in RHCS 4

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2022-07-18 10:11:27 +02:00
Guillaume Abrioux f8e969c890 backup-and-restore: use archive/unarchive approach
current approach is too complex and causes too many issues permission
issues.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit dffe7b47de)
2022-07-11 14:05:47 +02:00
Guillaume Abrioux 1b09682f75 backup-and-restore: various fixes
- preserve mode and ownership on main directories
- make sure the directories are well present prior to restoring files.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 047af3a3f6)
2022-07-11 14:05:43 +02:00
Guillaume Abrioux 1ecdc189b1 backup-and-restore: fix check on 'target_node' variable
If the user doesn't pass a valid name (present in the inventory)
the playbook will fail like following:

```
fatal: [localhost -> {{ target_node }}]: FAILED! =>
  msg: |-
    The task includes an option with an undefined variable. The error was: "hostvars['10.70.46.40']" is undefined
```

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit b18a1aa3ca)
2022-07-11 14:05:40 +02:00
Guillaume Abrioux e28615809c backup-and-restore: fix check on 'mode' variable
Typical failure:

```
fatal: [localhost]: FAILED! =>
  msg: |-
    The conditional check 'mode not in ['backup', 'restore']' failed. The error was: error while evaluating conditional (mode not in ['backup', 'restore']): 'mode' is undefined
```

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 848dd03fa6)
2022-07-11 14:05:36 +02:00
Guillaume Abrioux 85049464ce backup-and-restore: fix a typo
Typo introduced during initial implementation.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit e28c486e52)
2022-07-11 14:05:33 +02:00
Guillaume Abrioux 2c2833b540 contrib: add a playbook
this playbook can backup or restore some ceph files.
(/etc/ceph, /var/lib/ceph, ...)

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit ed0bba4d77)
2022-07-11 14:05:27 +02:00
Guillaume Abrioux f9b7bd327c config/osd: various fixes
- sets `osd_memory_target` per osd host.
- ceph.conf refactor (osd)

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 8a5628b516)
2022-07-11 14:01:23 +02:00
Guillaume Abrioux 68470e91e7 config: fix indentation in main.yml
For consistency and readability.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 5283fa6e96)
2022-07-11 14:01:09 +02:00
Teoman ONAY 6feb7646a1 Refresh /etc/ceph/osd json files content before zapping the disks
If the physical disk to device path mapping has changed since the
last ceph-volume simple scan (e.g. addition or removal of disks),
a wrong disk could be deleted.

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

Signed-off-by: Teoman ONAY <tonay@redhat.com>
(cherry picked from commit 64e08f2c0b)
2022-07-11 09:16:34 +02:00
Guillaume Abrioux 6dc7bfdd3c facts: fix set_radosgw_address.yml
use `include_tasks` instead of `import_tasks`.
Given that with `import_tasks` statements are preprocessed
and the tasks that defines it hasn't been run yet, it will fail
and complain like following:

```
The error was: 'ansible.vars.hostvars.HostVarsVars object' has no attribute '_interface'
```

Using `include_tasks` instead fixes this.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 434793e2fe)
(cherry picked from commit d57377ef61)
2022-07-07 10:30:25 +02:00
Guillaume Abrioux f8cc43558f facts: fix deployments with different net interface names
Deployments when radosgws don't have the same names for
network interface.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit f6b49f78a9)
(cherry picked from commit ab6fc3e6f7)
2022-07-07 10:30:20 +02:00
Guillaume Abrioux 28063d1d69 purge: reset-failed ceph-crash
This ensures we always reset-failed the ceph-crash service.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit e368ee0fc9)
2022-05-23 09:53:31 +02:00
Guillaume Abrioux 6485e1a69e purge: remove ceph directories on client nodes
Otherwise any ceph directories are left over on client nodes
after the purge.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 20035852a4)
(cherry picked from commit 346d4a1e1d)
2022-05-19 18:00:13 +02:00
Guillaume Abrioux 36fceeaaff update: speed up client play
there's no need to run the roles ceph-facts, ceph-config and ceph-client
altogether on client nodes in rolling update playbook.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 817c03bc0e)
(cherry picked from commit c0da98b1d6)
2022-05-19 17:58:01 +02:00
Guillaume Abrioux 8d9ebf2d0b container: align systemd units with rpm
Update `After=` and `Wants=` parameters in container systemd units
and make them be aligned with the systemd units that come
from the packaging.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit f01536ea19)
(cherry picked from commit 690c879aef)
2022-05-19 17:55:17 +02:00
Guillaume Abrioux f4bd5c7d91 switch2containers: fail if less than 3 monitors
This playbook doesn't support less than 3 monitors present in the inventory.
Just like the rolling_update playbook, let's fail if less than
3 monitors are present.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit f08129edf2)
(cherry picked from commit b970ab6691)
2022-05-19 17:53:53 +02:00