]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/log
ceph-ansible.git
2 years agolibrary: fix a bug in ceph_key module
Guillaume Abrioux [Sat, 24 Sep 2022 05:15:36 +0000 (07:15 +0200)]
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>
2 years agoVagrantfile: address deprecation warning
Guillaume Abrioux [Sat, 24 Sep 2022 06:38:31 +0000 (08:38 +0200)]
Vagrantfile: address deprecation warning

```
==> mgr0: Libvirt Provider: volume_cache is deprecated. Use disk_driver
:cache => 'unsafe' instead.
```

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2 years agoceph_key: drop unused result parameter
Guillaume Abrioux [Wed, 31 May 2023 11:03:42 +0000 (11:03 +0000)]
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>
2 years agoReplace ip_version check with ansible test
Lukas Bezdicka [Wed, 19 Apr 2023 11:16:49 +0000 (13:16 +0200)]
Replace ip_version check with ansible test

Instead of checking ip_version variable we should check the input
address for ip version and select code path based on that.

This solves ceph adoption with mixed ipv6 and ipv4 networks.

Resolves: rhbz#2186226
Signed-off-by: Lukas Bezdicka <lbezdick@redhat.com>
2 years agotests: disable internal repos
Guillaume Abrioux [Thu, 16 Mar 2023 16:43:03 +0000 (17:43 +0100)]
tests: disable internal repos

they are broken at the moment.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2 years agoceph-config: exclude already counted osds by lvm_volumes
Seena Fallah [Sun, 26 Feb 2023 14:11:26 +0000 (15:11 +0100)]
ceph-config: exclude already counted osds by lvm_volumes

Exclude lvm_volumes defined disks from existing osds while it has been counted by the "count number of osds for lvm scenario" task.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
2 years agodevices: allow using lvm_volumes with devices
Seena Fallah [Sun, 26 Feb 2023 14:08:09 +0000 (15:08 +0100)]
devices: allow using lvm_volumes with devices

* Exclude device from lvm_volumes while osd_auto_discovery is true
* Sum num_osds on both lvm_volumes and devices list

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
2 years agoRemove all vagrant boxes
Teoman ONAY [Thu, 16 Mar 2023 21:27:57 +0000 (22:27 +0100)]
Remove all vagrant boxes

Remove all existing vagrant boxes to prevent vagrant from using
older ones

Signed-off-by: Teoman ONAY <tonay@ibm.com>
2 years agoceph-mgr: Fix reference to copy_admin_key variable
René Højbjerg Larsen [Fri, 3 Mar 2023 14:15:16 +0000 (15:15 +0100)]
ceph-mgr: Fix reference to copy_admin_key variable

Enabling installation of the admin key to mgr nodes by setting
"copy_admin_key: true" is broken. This is because the variable is not
referenced correctly (using inline Jinja2 templating).

Signed-off-by: René Højbjerg Larsen <rhl@jfm.dk>
2 years agomgr: fix a typo
Lorenz Bausch [Thu, 9 Mar 2023 10:18:48 +0000 (11:18 +0100)]
mgr: fix a typo

This commit fixes a typo in `roles/ceph-mgr/defaults/main.yml`
(s/mpdules/modules)

Signed-off-by: Lorenz Bausch <info@lorenzbausch.de>
2 years agoshrink-osd fails when the OSD container is stopped
Teoman ONAY [Wed, 1 Mar 2023 20:26:54 +0000 (21:26 +0100)]
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>
2 years agoFix selinux label issues
Teoman ONAY [Tue, 14 Mar 2023 11:26:56 +0000 (12:26 +0100)]
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>
2 years agoFixes selinux relabeling issue for nfs container
Teoman ONAY [Thu, 2 Mar 2023 22:01:48 +0000 (23:01 +0100)]
Fixes selinux relabeling issue for nfs container

Signed-off-by: Teoman ONAY <tonay@ibm.com>
2 years agoUses a more recent version of the CentOS stream 8 box
Teoman ONAY [Tue, 7 Feb 2023 13:30:52 +0000 (14:30 +0100)]
Uses a more recent version of the CentOS stream 8 box

Uses the latest centos/streamX image available.

Signed-off-by: Teoman ONAY <tonay@ibm.com>
2 years agoosd: drop filestore support
Guillaume Abrioux [Wed, 15 Feb 2023 03:35:01 +0000 (04:35 +0100)]
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>
2 years agodevices: remove duplicated disks after the readlink resolve
Seena Fallah [Mon, 13 Feb 2023 17:07:25 +0000 (18:07 +0100)]
devices: remove duplicated disks after the readlink resolve

If a disk has a symlink it will be re-added to the devices lists one with resolved path and the other with a defined path.
We can rebuild the list from the readlink output cause readlink always return the correct path for all disks.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
2 years agodevices: exclude db disks on osd_auto_discovery enabled
Seena Fallah [Mon, 13 Feb 2023 16:12:41 +0000 (17:12 +0100)]
devices: exclude db disks on osd_auto_discovery enabled

Exclude disks were defined in dedicated_devices and bluestore_wal_devices on osd_auto_discovery enabled.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
2 years agoCollocated mgr with mon fails to start on RHEL 8.7
Teoman ONAY [Tue, 7 Feb 2023 13:53:39 +0000 (14:53 +0100)]
Collocated mgr with mon fails to start on RHEL 8.7

With podman version podman-3:4.2.0-4.module+el8.7.0+17064+3b31f55c and
later, when mgr fails to start if mon is already running.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2169767
Signed-off-by: Teoman ONAY <tonay@ibm.com>
2 years agoceph-config: make sure rgw_instances is set
Guillaume Abrioux [Tue, 7 Feb 2023 00:52:43 +0000 (01:52 +0100)]
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>
2 years agoInitialize rbd pool at pool creation
Teoman ONAY [Tue, 29 Nov 2022 08:47:58 +0000 (09:47 +0100)]
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>
2 years agoCheck first the OSD storage file rather than after created
Mario Codeniera [Tue, 6 Dec 2022 08:18:03 +0000 (21:18 +1300)]
Check first the OSD storage file rather than after created

Signed-off-by: Mario Codeniera <M.Codeniera@massey.ac.nz>
3 years agotests: use quay.io instead of quay.ceph.io
Guillaume Abrioux [Tue, 6 Dec 2022 12:14:07 +0000 (13:14 +0100)]
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>
3 years agocephadm-adopt: fix rbd-mirror adoption
Guillaume Abrioux [Mon, 14 Nov 2022 11:29:37 +0000 (12:29 +0100)]
cephadm-adopt: fix rbd-mirror adoption

The recent rbdmirror refactor introduced a regression in the
cephadm-adopt playbook.
Given that the rbd-mirror peer addition is now done by using the monitor
config-key store method during the cluster deployment, we can drop this
play from the cephadm-adopt.yml playbook.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2140569
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agoSetting fact _radosgw_address fail when RGW is on a different network
Teoman ONAY [Tue, 18 Oct 2022 13:28:54 +0000 (15:28 +0200)]
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>
3 years agodashboard: support --limit execution with rgw
Guillaume Abrioux [Wed, 13 Apr 2022 08:42:47 +0000 (10:42 +0200)]
dashboard: support --limit execution with rgw

When the following conditions are met:

- rgw is deployed,
- dashboard is deployed,
- playbook is called with --limit,
- a node being processed is collocated on either a mon or mgr.

The playbook fails because `rgw_instances` is undefined.
The idea here is to make sure this variable is always defined.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2063029
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agofacts: follow up on aa0cc93
Guillaume Abrioux [Thu, 21 Apr 2022 08:06:56 +0000 (10:06 +0200)]
facts: follow up on aa0cc93

when these variables are defined in the inventory host file,
all tasks are skipped then because the node being played isn't
aware about the values from the rgw nodes.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2063029
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agoswitch-to-containers: ignore errors when stopping service
Guillaume Abrioux [Mon, 17 Oct 2022 08:20:21 +0000 (10:20 +0200)]
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>
3 years agoswitch-to-containers: fix rbd-mirror migration
Guillaume Abrioux [Fri, 14 Oct 2022 17:33:26 +0000 (19:33 +0200)]
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>
3 years agolibrary/radosgw_user.py: fix user update
John Karasev [Wed, 28 Sep 2022 18:57:41 +0000 (11:57 -0700)]
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>
3 years agoceph-osd: remove unused ceph config set for osd_memory_target
Seena Fallah [Sat, 24 Sep 2022 17:49:09 +0000 (19:49 +0200)]
ceph-osd: remove unused ceph config set for osd_memory_target

As the conf is always being set in the config file there is no need to set it in with `ceph config`.
Also this will make it hard to run the playbook with the `ceph_update_config` tag as it won't run and will create an inconsistency between the config managements of the cluster

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
3 years agoceph-config: fix overriding osd_memory_target
Seena Fallah [Sat, 24 Sep 2022 17:46:20 +0000 (19:46 +0200)]
ceph-config: fix overriding osd_memory_target

When the value is overriding in `ceph_conf_overrides`, there is no need to calculate and set `osd_memory_target` again as we wanted to override the conf by our desired value.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
3 years agoceph-config: don't check for devices on existing osds
Seena Fallah [Sat, 24 Sep 2022 17:21:41 +0000 (19:21 +0200)]
ceph-config: don't check for devices on existing osds

When osd_auto_discovery is true the `devices` var will be empty (as the disks have holders).
Also in general there is no need to check for devices to list the devices with ceph-volume as we have `default({})` on the stdout in `num_osds` set fact in the next task

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
3 years agoceph-config: always set _osd_memory_target
Seena Fallah [Sat, 24 Sep 2022 17:07:36 +0000 (19:07 +0200)]
ceph-config: always set _osd_memory_target

this should be set when rolling_update is true as well, otherwise, it will reset to default on the upgrade

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
3 years agocommon: v18/reef kickoff
Guillaume Abrioux [Fri, 7 Oct 2022 08:49:00 +0000 (10:49 +0200)]
common: v18/reef kickoff

align with ceph/ceph/pull/47458 since it has been merged.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agodoc: update README-MULTISITE.md
quangln94 [Fri, 7 Oct 2022 14:23:47 +0000 (16:23 +0200)]
doc: update README-MULTISITE.md

I update the parameters according to this PR: #7315
In addition, where rgw_zonesecondary: True and rgw_zonemaster: False,

I change rgw_zonegroupmaster to be False as those lines below:

https://github.com/ceph/ceph-ansible/blob/main/README-MULTISITE.md?plain=1#L396
https://github.com/ceph/ceph-ansible/blob/main/README-MULTISITE.md?plain=1#L417
https://github.com/ceph/ceph-ansible/blob/main/README-MULTISITE.md?plain=1#L520
https://github.com/ceph/ceph-ansible/blob/main/README-MULTISITE.md?plain=1#L535
Add note at line 205 here https://github.com/ceph/ceph-ansible/blob/main/README-MULTISITE.md?plain=1#L205

Signed-off-by: quangln94 <ngocquang.ptit@gmail.com>
3 years agoUpdate ceph_ec_profile.py
quangln94 [Fri, 23 Sep 2022 07:32:04 +0000 (14:32 +0700)]
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

3 years agorbd-mirror: add rx peer only once
Guillaume Abrioux [Tue, 13 Sep 2022 14:54:22 +0000 (16:54 +0200)]
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>
3 years agorbd-mirror: fix multiple rbd-mirror daemon support
Guillaume Abrioux [Mon, 12 Sep 2022 13:07:19 +0000 (15:07 +0200)]
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>
3 years agoceph-crash: add missing \ in service file
Seena Fallah [Wed, 7 Sep 2022 17:57:34 +0000 (19:57 +0200)]
ceph-crash: add missing \ in service file

regression by: d374e634edbb55cc1012308dff848a42a01fb012

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
3 years agoceph-crash: add support cluster name
Seena Fallah [Sat, 27 Aug 2022 20:26:23 +0000 (22:26 +0200)]
ceph-crash: add support cluster name

add cluster name to CEPH_ARGS env var to support custom cluster name
this can change as an arg to ceph-crash when https://github.com/ceph/ceph/pull/47836 released

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
3 years agoceph-config: allow overriding osd_memory_target
Guillaume Abrioux [Tue, 16 Aug 2022 07:43:50 +0000 (09:43 +0200)]
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>
3 years agoconfig: use osd_memory_target value from ceph_conf_overrides if defined
Guillaume Abrioux [Tue, 9 Aug 2022 20:44:36 +0000 (22:44 +0200)]
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>
3 years agoconfig: do not always set _osd_memory_target
Guillaume Abrioux [Mon, 8 Aug 2022 05:43:54 +0000 (07:43 +0200)]
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>
3 years agorolling_update: fix rbd-mirror play
Guillaume Abrioux [Wed, 3 Aug 2022 07:09:15 +0000 (09:09 +0200)]
rolling_update: fix rbd-mirror play

There's no service to stop/mask when the node being upgraded is
a 'primary node' only (1 way replication).

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agotests: isolate ansible collections
Guillaume Abrioux [Fri, 29 Jul 2022 09:15:17 +0000 (11:15 +0200)]
tests: isolate ansible collections

When Ansible collections are installed, they should be isolated.
Otherwise, they will be shared in any scheduled job.
This might cause issues when running different branch versions for instance.
This also replace `ANSIBLE_CALLBACK_WHITELIST` with `ANSIBLE_CALLBACK_ENABLED` as it's
going to be deprecated in Ansible 2.15.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agoadopt: fix placement update calls for rgw
Guillaume Abrioux [Tue, 2 Aug 2022 07:01:04 +0000 (09:01 +0200)]
adopt: fix placement update calls for rgw

The commands called here are not built correctly.
This commit fixes it.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2058038#c27
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agoflake8: fix 'error E275 missing whitespace after keyword'
Guillaume Abrioux [Mon, 1 Aug 2022 21:39:35 +0000 (23:39 +0200)]
flake8: fix 'error E275 missing whitespace after keyword'

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agotests: skip rbdmirror tests on non-secondary daemon
Guillaume Abrioux [Mon, 1 Aug 2022 21:12:13 +0000 (23:12 +0200)]
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>
3 years agotests: set no_log_on_ceph_key_tasks=false
Guillaume Abrioux [Mon, 1 Aug 2022 18:22:10 +0000 (20:22 +0200)]
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>
3 years agorbd-mirror: follow up on recent rbd-mirror refactor
Guillaume Abrioux [Mon, 1 Aug 2022 18:18:50 +0000 (20:18 +0200)]
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>
3 years agoSet ceph_rbd_mirror_pool default value
Teoman ONAY [Mon, 1 Aug 2022 14:28:23 +0000 (16:28 +0200)]
Set ceph_rbd_mirror_pool default value

Signed-off-by: Teoman ONAY <tonay@redhat.com>
3 years agoPlaybook fails when using --limit to install new MDS
Teoman ONAY [Mon, 1 Aug 2022 13:36:48 +0000 (15:36 +0200)]
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>
3 years agopurge-dashboard: check for legacy group name 'grafana-server'
Guillaume Abrioux [Fri, 29 Jul 2022 11:19:13 +0000 (13:19 +0200)]
purge-dashboard: check for legacy group name 'grafana-server'

When using the legacy group name 'grafana-server', this playbook will run but
won't remove properly all monitoring resources as expected.

Fixes: #7265
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agorbd-mirror: major refactor
Guillaume Abrioux [Thu, 12 May 2022 15:22:54 +0000 (17:22 +0200)]
rbd-mirror: major refactor

- Use config-key store to add cluster peer.
- Support multiple pools mirroring.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agodoc: update readthedoc settings
Guillaume Abrioux [Fri, 29 Jul 2022 14:50:03 +0000 (16:50 +0200)]
doc: update readthedoc settings

This is needed to enforce the python version.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agoconfig: followup on 8a5628b51
Guillaume Abrioux [Mon, 11 Jul 2022 14:07:13 +0000 (16:07 +0200)]
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>
3 years agoconfig/osd: various fixes
Guillaume Abrioux [Mon, 11 Jul 2022 08:23:56 +0000 (10:23 +0200)]
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>
3 years agoconfig: fix indentation in main.yml
Guillaume Abrioux [Mon, 11 Jul 2022 08:03:53 +0000 (10:03 +0200)]
config: fix indentation in main.yml

For consistency and readability.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agoRefresh /etc/ceph/osd json files content before zapping the disks
Teoman ONAY [Mon, 4 Jul 2022 09:54:41 +0000 (11:54 +0200)]
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>
3 years agobackup-and-restore: use archive/unarchive approach
Guillaume Abrioux [Thu, 7 Jul 2022 15:03:34 +0000 (17:03 +0200)]
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>
3 years agopytest: drop test against py <3.8
Guillaume Abrioux [Wed, 6 Jul 2022 01:31:14 +0000 (03:31 +0200)]
pytest: drop test against py <3.8

since the bump to ansible-core 2.12, we have to drop
testing against py36 and py37 given that ansible 2.12 requires python
>=3.8

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agofacts: follow up on f6b49f78
Guillaume Abrioux [Wed, 6 Jul 2022 01:01:14 +0000 (03:01 +0200)]
facts: follow up on f6b49f78

f6b49f78a9f14c37b2ca81fa6172beba8f43adc4 changed a call back to `ipwrap`
This fixes this.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agohandler: update ganesha.pid path
Guillaume Abrioux [Tue, 5 Jul 2022 14:00:59 +0000 (16:00 +0200)]
handler: update ganesha.pid path

Due to some changes [1] in nfs-ganesha-4, we now have to use `/var/run/ganesha/ganesha.pid`

[1] https://github.com/nfs-ganesha/nfs-ganesha/commit/52e15c30d0997c63b72a7187e4271d911609ec13

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agofacts: fix set_radosgw_address.yml
Guillaume Abrioux [Tue, 5 Jul 2022 08:27:39 +0000 (10:27 +0200)]
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>
3 years agobackup-and-restore: various fixes
Guillaume Abrioux [Tue, 5 Jul 2022 07:58:02 +0000 (09:58 +0200)]
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>
3 years agofacts: fix deployments with different net interface names
Guillaume Abrioux [Thu, 16 Jun 2022 14:53:14 +0000 (16:53 +0200)]
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>
3 years agotests: add yes_i_know=true in tox-shrink_osd.ini
Guillaume Abrioux [Mon, 4 Jul 2022 13:17:30 +0000 (15:17 +0200)]
tests: add yes_i_know=true in tox-shrink_osd.ini

main branch requires it. Otherwise the playbook won't run.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agotests: drop shrink_osd from tox.ini
Guillaume Abrioux [Mon, 4 Jul 2022 11:33:24 +0000 (13:33 +0200)]
tests: drop shrink_osd from tox.ini

shrink_osd has its own tox config file (tox-shrink_osd.ini)

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agocommon: fix a typo
Guillaume Abrioux [Sun, 3 Jul 2022 05:17:58 +0000 (07:17 +0200)]
common: fix a typo

s/of/or ..

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2099828#c25
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agobackup-and-restore: fix check on 'target_node' variable
Guillaume Abrioux [Wed, 29 Jun 2022 06:59:55 +0000 (08:59 +0200)]
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>
3 years agobackup-and-restore: fix check on 'mode' variable
Guillaume Abrioux [Wed, 29 Jun 2022 06:40:13 +0000 (08:40 +0200)]
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>
3 years agoRevert "upgrade: block upgrade when rgw multisite is active"
Guillaume Abrioux [Tue, 28 Jun 2022 11:34:12 +0000 (13:34 +0200)]
Revert "upgrade: block upgrade when rgw multisite is active"

This reverts commit 51bc8cb63642b5b1ca460e79adf4649d92773aa4.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agoRevert "tests: use build main/6f765e2"
Guillaume Abrioux [Wed, 22 Jun 2022 08:11:40 +0000 (10:11 +0200)]
Revert "tests: use build main/6f765e2"

This reverts commit a568314eda48f2e1864ddc1e7648542db3034e7f.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agonfs: use repo from SIG
Guillaume Abrioux [Wed, 15 Jun 2022 11:45:48 +0000 (13:45 +0200)]
nfs: use repo from SIG

RPMs for nfs-ganesha aren't hosted anymore at https://download.ceph.com

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agoRevert "tests: temporarily disable nfs-ganesha"
Guillaume Abrioux [Wed, 15 Jun 2022 11:45:11 +0000 (13:45 +0200)]
Revert "tests: temporarily disable nfs-ganesha"

This reverts commit 3f923d69acf6c26c4e49ee86f8dd96d2dd509f31.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agoadd better clarification on ceph-ansible current status
Guillaume Abrioux [Wed, 15 Jun 2022 07:16:26 +0000 (09:16 +0200)]
add better clarification on ceph-ansible current status

Given that the project is still maintained for the time being, let's add a better
comment about that.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agomergify: reindent file properly
Guillaume Abrioux [Wed, 15 Jun 2022 09:24:40 +0000 (11:24 +0200)]
mergify: reindent file properly

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agomergify: add backport configuration for stable-7.0
Guillaume Abrioux [Wed, 15 Jun 2022 09:23:51 +0000 (11:23 +0200)]
mergify: add backport configuration for stable-7.0

So we can ask mergify to do automatic backport in stable-7.0

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agobackup-and-restore: fix a typo
Guillaume Abrioux [Wed, 15 Jun 2022 08:46:52 +0000 (10:46 +0200)]
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>
3 years agotests: use build main/6f765e2
Guillaume Abrioux [Tue, 14 Jun 2022 20:57:30 +0000 (22:57 +0200)]
tests: use build main/6f765e2

shaman is broken at the moment, this is the last working build on 'main'

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agoansible: bump to ansible 2.12
Guillaume Abrioux [Tue, 14 Jun 2022 16:18:36 +0000 (18:18 +0200)]
ansible: bump to ansible 2.12

Add required changes to support ansible 2.12

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agofix(ceph-grafana): make dashboard download work again
Michael Wagner [Fri, 10 Jun 2022 15:10:23 +0000 (17:10 +0200)]
fix(ceph-grafana): make dashboard download work again

This fixes the dashboard download for pacific and later.

Signed-off-by: Michael Wagner <mitch.wagna@gmail.com>
3 years agomergify: add restriction on backport command
Guillaume Abrioux [Tue, 14 Jun 2022 07:54:10 +0000 (09:54 +0200)]
mergify: add restriction on backport command

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agodoc: update ansible version requirement
Guillaume Abrioux [Mon, 13 Jun 2022 07:22:10 +0000 (09:22 +0200)]
doc: update ansible version requirement

This updates the documentation regarding the Ansible version
requirement for `stable-6.0` branch.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agoceph_pool: set target size ratio on both 'on' and 'warn' mode
Seena Fallah [Mon, 25 Apr 2022 22:07:28 +0000 (00:07 +0200)]
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>
3 years agowhitelist->allowlist
David Galloway [Tue, 24 May 2022 18:43:05 +0000 (14:43 -0400)]
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>
3 years agomaster->root
David Galloway [Tue, 24 May 2022 18:40:41 +0000 (14:40 -0400)]
master->root

Signed-off-by: David Galloway <dgallowa@redhat.com>
3 years agomaster->main
David Galloway [Tue, 24 May 2022 18:40:00 +0000 (14:40 -0400)]
master->main

Signed-off-by: David Galloway <dgallowa@redhat.com>
3 years agocephadm_adopt: set autotune_memory_target_ratio
Guillaume Abrioux [Fri, 13 May 2022 11:28:55 +0000 (13:28 +0200)]
cephadm_adopt: set autotune_memory_target_ratio

This adds a task that sets `autotune_memory_target_ratio` depending on the
value of `is_hci`.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2028693
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agoAdd ceph_infra tag to rolling_update
Francesco Pantano [Wed, 25 May 2022 19:32:19 +0000 (21:32 +0200)]
Add ceph_infra tag to rolling_update

When the upgrade from Ceph 4 to 5 is performed in the OpenStack context,
ceph-ansible triggers the rolling_update playbook, which is supposed to
rollout new Ceph containers.  The ceph-infra role tries to take care
about firewall, ntp config and logrotate; however, TripleO manages them
through tripleo-heat-templates.  This patch just add an additional tag
to skip the ceph-infra role in the OpenStack context.

Closes: https://bugzilla.redhat.com/2090456
Signed-off-by: Francesco Pantano <fpantano@redhat.com>
3 years agopurge: reset-failed ceph-crash
Guillaume Abrioux [Mon, 23 May 2022 07:49:10 +0000 (09:49 +0200)]
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>
3 years agotests: use latest version for pytest
Guillaume Abrioux [Thu, 12 May 2022 19:17:51 +0000 (21:17 +0200)]
tests: use latest version for pytest

with the bump of py version, let's use newer version for pytest.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agotests: install ansible.utils collection
Guillaume Abrioux [Thu, 12 May 2022 19:16:46 +0000 (21:16 +0200)]
tests: install ansible.utils collection

otherwise, it's missing for external_clients and subset_update jobs

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agocollections: install ansible.utils
Guillaume Abrioux [Thu, 12 May 2022 19:01:44 +0000 (21:01 +0200)]
collections: install ansible.utils

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agocommon: move to `ansible.utils.ipwrap`
Guillaume Abrioux [Thu, 12 May 2022 18:49:04 +0000 (20:49 +0200)]
common: move to `ansible.utils.ipwrap`

ipwrap has moved to ansible.utils

see
https://github.com/ansible-collections/ansible.netcommon/commit/db4920ebf6bae6476ff8829e2cf475f19f83a990

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agocommon: config rhcs tools repo on all nodes
Guillaume Abrioux [Thu, 28 Apr 2022 08:46:35 +0000 (10:46 +0200)]
common: config rhcs tools repo on all nodes

Otherwise `cephadm` can't be installed during cephadm-adopt.yml
playbook execution.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2073480
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agocephadm-adopt: remove legacy directory after adoption
Guillaume Abrioux [Wed, 11 May 2022 11:47:46 +0000 (13:47 +0200)]
cephadm-adopt: remove legacy directory after adoption

When this directory is left after the osd adoption, it leads to the following error:

```
[WRN] CEPHADM_REFRESH_FAILED: failed to probe daemons or devices
    host axdesec2ocs1n002.ecommerce.inditex.grp `cephadm ceph-volume` failed: cephadm exited with an error code: 1, stderr:Inferring config /var/lib/ceph/41555360-e96b-4b16-a37c-873e0c940091/mon.axdesec2ocs1n002/config
ERROR: [Errno 2] No such file or directory: '/var/lib/ceph/41555360-e96b-4b16-a37c-873e0c940091/mon.axdesec2ocs1n002/config'.
```

this is because of an unexpected behavior regarding 'config inferring' when a legacy directory is present in /var/lib/ceph.

Note: this doesn't fix the root cause, this is a workaround.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2075510
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agocontrib: add a playbook
Guillaume Abrioux [Tue, 12 Apr 2022 17:48:18 +0000 (19:48 +0200)]
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>
3 years agoWarn about ceph-ansible deprecation
Guillaume Abrioux [Wed, 27 Apr 2022 15:00:56 +0000 (17:00 +0200)]
Warn about ceph-ansible deprecation

The official installer is now cephadm. stable-6.0 is the last
release of ceph-ansible such as we know it.

It will become a playbook intended for deploying minimal
Ceph cluster (mostly for development/testing purposes)

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 years agotests: update vagrant_box default value
Guillaume Abrioux [Tue, 26 Apr 2022 11:45:50 +0000 (13:45 +0200)]
tests: update vagrant_box default value

This updates the default value for the vagrant_box variable
in all vagrant_variables.yml files

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>