]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/log
ceph-ansible.git
4 years agodocker2podman: skip some role imports from handler
Guillaume Abrioux [Fri, 9 Apr 2021 09:02:12 +0000 (11:02 +0200)]
docker2podman: skip some role imports from handler

when running docker-to-podman playbook, there's no need to call
`ceph-config` and `ceph-rgw` from the role `ceph-handler`.
It can even have side effects when coming from a baremetal cluster that
was previously migrated using the switch-to-containers playbook. Indeed
it might complain about missing .target systemd unit since they are
removed during that migration.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1944999
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agoswitch_to_containers: support iscsigws migration
Guillaume Abrioux [Wed, 7 Apr 2021 12:36:28 +0000 (14:36 +0200)]
switch_to_containers: support iscsigws migration

This adds the iscsigws migration to containers.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=<bz-number>
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agocommon: selinux tasks related refactor
Guillaume Abrioux [Thu, 1 Apr 2021 12:37:45 +0000 (14:37 +0200)]
common: selinux tasks related refactor

This moves some task from the `ceph-nfs` role in `ceph-common` since
some of them are needed in `ceph-rgwloadbalancer` role.
This avoids duplicated tasks.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agorgw-loadbalancers: add all rgw_ports to http_port_t type
Guillaume Abrioux [Thu, 1 Apr 2021 07:50:54 +0000 (09:50 +0200)]
rgw-loadbalancers: add all rgw_ports to http_port_t type

This adds all rgw ports to the http_port_t selinux type so it
allows haproxy to connect to those ports in order to avoid AVC.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1923890
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agorgw-loadbalancer: Update haproxy.cfg.j2
kalebskeithley [Tue, 9 Mar 2021 21:10:35 +0000 (16:10 -0500)]
rgw-loadbalancer: Update haproxy.cfg.j2

haproxy gets an AVC when configured to connect to port 8081

This commit adds a snippet regarding haproxy in a selinux environment

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1923890
Signed-off-by: Kaleb S KEITHLEY <kkeithle@redhat.com>
4 years agocontainer/registry: use password from stdin
Dimitri Savineau [Tue, 12 Jan 2021 19:29:58 +0000 (14:29 -0500)]
container/registry: use password from stdin

Pass the password variable via stdin for the registry login
authentication.
This allows to remove the no_log statement and see the task output
without displaying the password value.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
4 years agonfs: set idmap config for Ceph-NFS
Guillaume Abrioux [Fri, 12 Mar 2021 15:27:12 +0000 (16:27 +0100)]
nfs: set idmap config for Ceph-NFS

Currently NFS Ganesha (ceph-nfs) consumes /etc/idmapd.conf, which
controls mapping of user/owner identities under NFSv4+. With
containerized service deployment, this file is an immutable part of the
container image and cannot be modified.

Here we provide group variables, and a taskk and templates for the
ceph-nfs role, to set the path of the idmap configuration file and
to make the most common adjustment to the contents of that file --
namely to set the 'Domain'. We default the path to /etc/ganesha/idmap.conf
so that we will not conflict with /etc/idmapd.conf on the controller nodes
where ganesha runs. NFSv4 clients, as used for example by the Cinder NFS
driver, consume /etc/idmapd.conf and may require different settings than
what is wanted for NFS Ganesha. Additionally, because we already bind
/etc/ganesha from the host into the ceph-nfs container, the file NFS
Ganesha consumes will no longer be an immutable part of the container.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1925646
Signed-off-by: Tom Barron tpb@dyncloud.net
Co-Authored-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agodashboard: support prometheus storage.tsdb.retention.time parameter
Guillaume Abrioux [Tue, 30 Mar 2021 07:49:10 +0000 (09:49 +0200)]
dashboard: support prometheus storage.tsdb.retention.time parameter

This commit adds the parameter `--storage.tsdb.retention.time` to the
prometheus systemd unit template.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1928000
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agorgw: supports pg_autoscale_mode option for pool creation
Guillaume Abrioux [Fri, 26 Mar 2021 16:03:44 +0000 (17:03 +0100)]
rgw: supports pg_autoscale_mode option for pool creation

Support enabling/disabling the pg autoscaler for rgw pools.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agodefaults: add a comment about `igw_network`
Guillaume Abrioux [Fri, 26 Mar 2021 17:05:48 +0000 (18:05 +0100)]
defaults: add a comment about `igw_network`

This add a quick documentation in ceph-defaults about `igw_network`

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agocommon,iscsi: don't use the shaman search endpoint
Dimitri Savineau [Fri, 26 Mar 2021 19:14:15 +0000 (15:14 -0400)]
common,iscsi: don't use the shaman search endpoint

In commits 39649f0 and bf8cdad we switch from using the shaman /repos endpoint
to the /search endpoint for using the architecture filter.
In fact that filter is also available with the /repos endpoint, which requires
less ansible tasks.

This also adds back a condition remove in 5801171 on the ceph-iscsi
repository and that repository doesn't need to filter on the architecture
because the ceph-iscsi project is noarch.
Both ceph-iscsi and tcmu-runner shaman URLs were using the ceph_dev_branch
and ceph_dev_sha1 variables which doesn't make sense. Those variables are
only useful for the ceph core repository.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
4 years agoupdate: followup on 07029e1
Guillaume Abrioux [Fri, 26 Mar 2021 15:12:42 +0000 (16:12 +0100)]
update: followup on 07029e1

Playbook must fail anyway, the `rescue` block has been introduced for
unmasking the unit after the playbook has failed.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agodashboard: support igw nodes with dedicated subnet
Guillaume Abrioux [Tue, 2 Mar 2021 08:51:26 +0000 (09:51 +0100)]
dashboard: support igw nodes with dedicated subnet

This adds the possibility to deploy the dashboard with igw nodes using
a dedicated subnet.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1926170
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agoPeer addition won't be skipped if remote is not in peer
VasishtaShastry [Wed, 24 Mar 2021 15:47:56 +0000 (21:17 +0530)]
Peer addition won't be skipped if remote is not in peer
rbd-mirroring is not configured as adding peer is getting skipped.
Peer addition should not get skipped if its not added already

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

Signed-off-by: VasishtaShastry <vipin.indiasmg@gmail.com>
4 years agodocs: rgw multisite docs with new rgw_instances config
Ali Maredia [Mon, 25 Jan 2021 06:33:54 +0000 (01:33 -0500)]
docs: rgw multisite docs with new rgw_instances config

Docs reflect that each instance of `rgw_instances`
can now take rgw_zonemaster, rgw_zonesecondary,
rgw_zonegroupmaster, rgw_multisite_proto.

Signed-off-by: Ali Maredia <amaredia@redhat.com>
4 years agoREADME-MULTISITE: fix typos
Ken Dreyer [Wed, 24 Mar 2021 20:44:52 +0000 (14:44 -0600)]
README-MULTISITE: fix typos

This commit fixes some typos in MULTISITE documentation.

Signed-off-by: Ken Dreyer <ktdreyer@redhat.com>
4 years agoconvert some missed `ansible_*`` calls to `ansible_facts['*']`
Guillaume Abrioux [Thu, 25 Mar 2021 02:47:40 +0000 (03:47 +0100)]
convert some missed `ansible_*`` calls to `ansible_facts['*']`

This converts some missed calls to `ansible_*` that were missed in
initial PR #6312

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agocore: refactor code quality issues
Aksh Gupta [Fri, 19 Mar 2021 18:45:26 +0000 (18:45 +0000)]
core: refactor code quality issues

The following commit fixes a few code quality issues detected by DeepSource:
- Use literals instead of function calls to create data structure.
- Refactor unnecessary list comprehension.
- Simplify if statement.
- Refactor useless else block in the loop.

Signed-off-by: Aksh Gupta <akshgpt7@gmail.com>
4 years agolibrary: drop ceph_facts
Guillaume Abrioux [Thu, 25 Mar 2021 02:49:11 +0000 (03:49 +0100)]
library: drop ceph_facts

This is never called in the playbook and seems unmaintained.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agoDisable facts by default in ansible.cfg
Alex Schultz [Thu, 11 Mar 2021 15:43:53 +0000 (08:43 -0700)]
Disable facts by default in ansible.cfg

As a continuation of a7f2fa73e63e69dba2e41aaac9732397eec437c9, this
change switches fact injection to off by default in the provided
ansible.cfg.

Signed-off-by: Alex Schultz <aschultz@redhat.com>
4 years agomain: use `ansible_facts` for `architecture`
Guillaume Abrioux [Wed, 24 Mar 2021 08:29:28 +0000 (09:29 +0100)]
main: use `ansible_facts` for `architecture`

commit f6a0e95e51798316fce5e82b2463ff62396a681a reverted the change made
by a7f2fa73e63e69dba2e41aaac9732397eec437c9.

This commit bring back this change.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agotests: switch to quay.ceph.io for dashboard images
Guillaume Abrioux [Tue, 23 Mar 2021 13:49:30 +0000 (14:49 +0100)]
tests: switch to quay.ceph.io for dashboard images

for some reason, `quay.io/app-sre/grafana` no longer exist.
as a workaround, all dashboard related images have been mirrored on
quay.ceph.io.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agoiscsi: fetch right repo from shaman
Guillaume Abrioux [Tue, 23 Mar 2021 10:25:51 +0000 (11:25 +0100)]
iscsi: fetch right repo from shaman

due to recent changes in shaman, we must fetch the right repo by
filtering on the desired architecture.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agotests: fix `test_rgw_is_up` test
Guillaume Abrioux [Tue, 23 Mar 2021 08:04:51 +0000 (09:04 +0100)]
tests: fix `test_rgw_is_up` test

The data structure seems to have been modified in ceph@master (quincy).

This commit update the test accordingly.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agotests: fix `test_nfs_is_up` test
Guillaume Abrioux [Mon, 22 Mar 2021 16:54:27 +0000 (17:54 +0100)]
tests: fix `test_nfs_is_up` test

the data structure seems to have been modified in ceph@master (quincy).

This commit update the test accordingly.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agoceph_volume: fix bug in `is_lv()`
Guillaume Abrioux [Mon, 22 Mar 2021 13:46:55 +0000 (14:46 +0100)]
ceph_volume: fix bug in `is_lv()`

This function makes the `ceph_volume` module be not idempotent in
containerized context because it tries to run a container and bindmount
directories that no longer exist.

In that case, the `lvs` command being executed returns something
different than `0` so we can't call `json.loads(out)['report'][0]['lv']`
since it might throw an python error.

The idea is to return `True` only if `rc` is equal to `0` and
`len(result)` is greater than `0`, which means the command matched an
LV.

Fixes: #6284
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agoMake sure the repo url contains the correct arch
Brad Hubbard [Fri, 19 Mar 2021 04:11:42 +0000 (14:11 +1000)]
Make sure the repo url contains the correct arch

We can end up with an arm only repo unless we are specific about the
architecture we require. Brings the deb code in line with the rpm
equivalent.

Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
4 years agogithub: use actions/stale
Guillaume Abrioux [Mon, 22 Mar 2021 08:29:53 +0000 (09:29 +0100)]
github: use actions/stale

This commit replaces the current stale bot which seems to be broken with
the github actions/stale one.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agofix 'command -v' tasks
Guillaume Abrioux [Thu, 18 Mar 2021 10:36:59 +0000 (11:36 +0100)]
fix 'command -v' tasks

`command -v` is a bash script which needs a shell to run.

Fixes: #6325
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agorolling_update: unmask monitor service after a failure
Guillaume Abrioux [Thu, 18 Mar 2021 08:08:51 +0000 (09:08 +0100)]
rolling_update: unmask monitor service after a failure

if for some reason the playbook fails after the service was
stopped, disabled and masked and before it got restarted, enabled and
unmasked, the playbook leaves the service masked and which can make users
confused and forces them to unmask the unit manually.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1917680
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agocephadm_adopt: fetch and write ceph minimal config
Guillaume Abrioux [Wed, 17 Mar 2021 09:07:27 +0000 (10:07 +0100)]
cephadm_adopt: fetch and write ceph minimal config

This commit makes the playbook fetch the minimal current ceph
configuration and write it later on monitoring nodes so `cephadm` can
proceed with the adoption.
When a monitoring stack was deployed on a dedicated node, it means no
`ceph.conf` file was written, `cephadm` requires a `ceph.conf` in order
to adopt the daemon present on the node.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1939887
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agofacts: fix nfs/external cluster scenario
Guillaume Abrioux [Tue, 16 Mar 2021 13:13:13 +0000 (14:13 +0100)]
facts: fix nfs/external cluster scenario

These tasks shouldn't be run when at least 1 monitor isn't present in
the inventory.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1937997
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agoadopt: convert legacy grafana-server groupname early
Guillaume Abrioux [Tue, 16 Mar 2021 15:33:27 +0000 (16:33 +0100)]
adopt: convert legacy grafana-server groupname early

This is a follow up on PR #6332

cephadm-adopt.yml playbook is affected by the same bug

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1938658
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agoRevert "tests: disable nfs testing on master"
Guillaume Abrioux [Wed, 17 Mar 2021 10:45:54 +0000 (11:45 +0100)]
Revert "tests: disable nfs testing on master"

This reverts commit 8372b6792fb94bd7e333ac8017ffca0f139702c7.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agovalidate: followup on 98e32b9
Guillaume Abrioux [Wed, 17 Mar 2021 08:39:54 +0000 (09:39 +0100)]
validate: followup on 98e32b9

update the message accordingly to the check updated in
commit 98e32b92f30c4e234f51f8f3d29e932764405e25

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agoclients: build filtered clients group early
Guillaume Abrioux [Tue, 16 Mar 2021 13:51:06 +0000 (14:51 +0100)]
clients: build filtered clients group early

when the group `_filtered_clients` is built, the order can change from
the original `clients` group which can cause issues since we run
`ceph-container-engine` on the first client only. It means later in the
playbook we can make call to the container CLI on a node where the
container engine wasn't installed.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agotests: remove 1 client VM in external_clients job
Guillaume Abrioux [Tue, 16 Mar 2021 14:39:10 +0000 (15:39 +0100)]
tests: remove 1 client VM in external_clients job

We only use 2 client in this scenario, there's no need to fire up a
third VM.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agotests: disable nfs testing on master
Guillaume Abrioux [Tue, 16 Mar 2021 09:37:37 +0000 (10:37 +0100)]
tests: disable nfs testing on master

nfs-ganesha builds in shaman are broken.
This commit disables nfs-ganesha testing in order to unlock the CI.

This is a temporary commit intented to be reverted.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agovalidate: update `ceph_repository_community` check
Guillaume Abrioux [Mon, 15 Mar 2021 18:53:21 +0000 (19:53 +0100)]
validate: update `ceph_repository_community` check

this updates the `ceph_repository_community` check in `ceph-validate`
with the right ceph release expected.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agonfs: bump nfs-ganesha version
Guillaume Abrioux [Mon, 15 Mar 2021 17:18:43 +0000 (18:18 +0100)]
nfs: bump nfs-ganesha version

This commit updates the default version of nfs-ganesha to V3.5 which is the
latest version available upstream.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agoupdate: convert legacy grafana-server groupname early
Guillaume Abrioux [Fri, 12 Mar 2021 08:26:16 +0000 (09:26 +0100)]
update: convert legacy grafana-server groupname early

If the legacy name `grafana-server` is still being used when upgrading
from Nautilus to Pacific, the task that sets the fact `rolling_update`
to `true` doesn't run on the node(s) included in that group. Indeed the
play where we set this fact (`rolling_update`) only runs on the group
`monitoring_group_name | default('monitoring')`.
As a workaround, we can run earlier the task which converts the
`grafana-server` group name to `monitoring`.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1935554
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agoconfig: reset num_osds
Guillaume Abrioux [Fri, 12 Mar 2021 14:49:15 +0000 (15:49 +0100)]
config: reset num_osds

When collocating OSDs with other daemon, `num_osds` is incorrectly calculated
because `ceph-config` is called multiple times.

Indeed, the following code:
```
num_osds: "{{ lvm_list.stdout | default('{}') | from_json | length | int + num_osds | default(0) | int }}"
```

makes `num_osds` be incremented each time `ceph-config` is called.

We have to reset it in order to get the correct number of expected OSDs.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agolibrary: add realm pull to radosgw_realm module
Dimitri Savineau [Mon, 25 Jan 2021 23:06:03 +0000 (18:06 -0500)]
library: add realm pull to radosgw_realm module

This adds the realm pull operation to the current radosgw_realm module.
The pull operation requires the url, access/secret key variables.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
4 years agoceph-mon: Fix check mode for deploy monitor tasks
Benoît Knecht [Mon, 19 Oct 2020 09:23:59 +0000 (11:23 +0200)]
ceph-mon: Fix check mode for deploy monitor tasks

Skip the `get initial keyring when it already exists` task when both commands
whose `stdout` output it requires have been skipped (e.g. when running in check
mode).

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
4 years agostalebot: update config
Guillaume Abrioux [Fri, 12 Mar 2021 08:42:25 +0000 (09:42 +0100)]
stalebot: update config

This decreases the number of days of inactivity before an issue becomes
sstale.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agodocs: Update URL to LVM batch
Kai Stian Olstad [Wed, 10 Mar 2021 08:39:33 +0000 (09:39 +0100)]
docs: Update URL to LVM batch

Signed-off-by: Kai Stian Olstad <kai.stian.olstad@gmail.com>
4 years agodocs: Document the prepare_osd tag
Matthew Vernon [Wed, 10 Mar 2021 16:39:03 +0000 (16:39 +0000)]
docs: Document the prepare_osd tag

There are times where being able to skip OSD creation is useful to the
admin (see #1777 for example), and skipping the prepare_osd tag is a
way to achieve this. Document this fact.

Signed-off-by: Matthew Vernon <mv3@sanger.ac.uk>
4 years agoceph-osd: add prepare_osd tag to lvm-batch scenario
Matthew Vernon [Wed, 10 Mar 2021 16:36:52 +0000 (16:36 +0000)]
ceph-osd: add prepare_osd tag to lvm-batch scenario

Sometimes it's useful to be able to skip the OSD creation step when
running ceph-ansible (cf #1777). The lvm scenario has a prepare_osd
tag on the relevant play. This commit adds the same tag to the
lvm-batch scenario.

Signed-off-by: Matthew Vernon <mv3@sanger.ac.uk>
4 years agoDocs: fix some typos
Matthew Vernon [Wed, 10 Mar 2021 16:53:45 +0000 (16:53 +0000)]
Docs: fix some typos

While working on the previous PR, I found a couple of typos in the
docs. This fixes those.

Signed-off-by: Matthew Vernon <mv3@sanger.ac.uk>
4 years agoUse ansible_facts
Alex Schultz [Wed, 3 Mar 2021 14:43:50 +0000 (07:43 -0700)]
Use ansible_facts

It has come to our attention that using ansible_* vars that are
populated with INJECT_FACTS_AS_VARS=True is not very performant.  In
order to be able to support setting that to off, we need to update the
references to use ansible_facts[<thing>] instead of ansible_<thing>.

Related: ansible#73654
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1935406
Signed-off-by: Alex Schultz <aschultz@redhat.com>
4 years agotests: increase nb of rerun in pytest
Guillaume Abrioux [Wed, 3 Mar 2021 07:51:25 +0000 (08:51 +0100)]
tests: increase nb of rerun in pytest

In order to avoid false positive in the CI that I've been unable to
reproduce.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agoFix typo and broken link for documenting RGW frontends
Matthew Vernon [Mon, 22 Feb 2021 14:26:10 +0000 (14:26 +0000)]
Fix typo and broken link for documenting RGW frontends

http://docs.ceph.com/docs/nautilus/radosgw/frontends/ 404s so replace
it with a working "latest" docs link, and correct the spelling of
"additional" while I'm at it.

Signed-off-by: Matthew Vernon <mv3@sanger.ac.uk>
4 years agodashboard: add missing parameter in `ceph_cmd`
Guillaume Abrioux [Mon, 1 Mar 2021 14:22:22 +0000 (15:22 +0100)]
dashboard: add missing parameter in `ceph_cmd`

the `ceph_cmd` fact is missing the `--net=host` parameter.

Some tasks consuming this fact can fail like following:

```
Error: error configuring network namespace for container b8ec913db1fb694ae683faf202680de7a59c714a004e533aba87e8503d29261f: Missing CNI default network
```

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1931365
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agodefaults: update rhcs dashboard images versions
Guillaume Abrioux [Wed, 17 Feb 2021 03:22:34 +0000 (04:22 +0100)]
defaults: update rhcs dashboard images versions

The current dashboard images deployed have a bad health index.
Updating to a newer version fixes this issue.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1925350
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agorequirements.txt: Move the six dependency into the general requirements
Florian Haas [Fri, 12 Feb 2021 08:29:00 +0000 (09:29 +0100)]
requirements.txt: Move the six dependency into the general requirements

config_template.py depends on six, which isn't listed in the default
requirements.txt. This previously frequently wasn't a problem, because
six used to be a standard package being installed into a venv, and
lots of other projects depended on it.

It also does get installed for unit and integration tests via
tests/requirements.txt, so any broken dependency on six wouldn't be
detected by tox runs.

However, as other projects and distributions have phased out Python
2.7 support the dependency on six becomes less common. Thus, as long
as ceph-ansible does require it for config_template.py, add it to the
base requirements.

Signed-off-by: Florian Haas <florian@citynetwork.eu>
4 years agolibrary: do not always add --yes in batch mode
Guillaume Abrioux [Tue, 9 Feb 2021 14:28:08 +0000 (15:28 +0100)]
library: do not always add --yes in batch mode

When asking `ceph-volume` to report only in `lvm batch` context, there's
a bug described in bz1896803 [1] when `--yes` is passed (which by the
way isn't necessary with `--report`).
This commit ensure `--yes` isn't passed to `ceph-volume` when `--report`
is used.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1896803

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1896803
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agoAdd quincy release
Dimitri Savineau [Mon, 1 Feb 2021 22:39:07 +0000 (17:39 -0500)]
Add quincy release

Add the 17th ceph release: quincy.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
4 years agopurge: rm service-cid files
Guillaume Abrioux [Tue, 2 Feb 2021 20:22:50 +0000 (21:22 +0100)]
purge: rm service-cid files

This commit makes sure purge playbooks remove those file if for any reason they
have been left.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1920900
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agoswitch2container: do not serialize the ceph-crash migration
Guillaume Abrioux [Thu, 11 Feb 2021 15:28:31 +0000 (16:28 +0100)]
switch2container: do not serialize the ceph-crash migration

There's no need to slow down the playbook execution time by migrating
all the `ceph-crash` instances in a serial way. Let's remove the
`serial: 1` so the migration is achieved in a parallel way.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agotests: increase `mon_max_pg_per_osd`
Guillaume Abrioux [Wed, 10 Feb 2021 14:49:38 +0000 (15:49 +0100)]
tests: increase `mon_max_pg_per_osd`

we aren't deploying enough OSD daemon, so it fails like following:

```
  stderr: 'Error ERANGE: pool id 10 pg_num 256 size 2 would mean 1536 total pgs, which exceeds max 1500 (mon_max_pg_per_osd 250 * num_in_osds 6)'
```

Let's increase the value of `mon_max_pg_per_osd` in order to get around
this issue in the CI.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agodoc: add a note about "latest" tags
Guillaume Abrioux [Thu, 11 Feb 2021 12:58:27 +0000 (13:58 +0100)]
doc: add a note about "latest" tags

See the change for details.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agomergify: add stable-6.0 backport configuration v7.0.0alpha1
Guillaume Abrioux [Wed, 10 Feb 2021 13:53:47 +0000 (14:53 +0100)]
mergify: add stable-6.0 backport configuration

This adds the stable-6.0 backport configuration in mergify.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agocephadm-adopt: remove prometheus workaround v6.0.0
Dimitri Savineau [Thu, 21 Jan 2021 20:26:09 +0000 (15:26 -0500)]
cephadm-adopt: remove prometheus workaround

This was fixed by [1][2]

[1] https://tracker.ceph.com/issues/45120
[2] https://github.com/ceph/ceph/commit/252d4b30

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
4 years agodoc: update containerized deployment
Dimitri Savineau [Tue, 26 Jan 2021 19:03:27 +0000 (14:03 -0500)]
doc: update containerized deployment

This adds more documentation to the configuration and usage of
containerizerd deployment.

Closes: #6198
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
4 years agodoc: update the documentation
Guillaume Abrioux [Wed, 10 Feb 2021 12:47:21 +0000 (13:47 +0100)]
doc: update the documentation

- mention `stable-6.0` requirements.
- update some patterns.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agorolling_update: enforce ceph-container-engine
Dimitri Savineau [Wed, 3 Feb 2021 22:39:49 +0000 (17:39 -0500)]
rolling_update: enforce ceph-container-engine

When running the rolling_update.yml playbook and adding the dashboard
component in the same time then the requirement (like container packages)
aren't installed.
This could lead to a failure in case of using authentication on the
container registry because the playbook will try to login on the registry
but podman/docker aren't yet installed.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1903504
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1918650
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
4 years agoceph-common: enable rhcs tools repo for monitoring
Dimitri Savineau [Wed, 3 Feb 2021 15:28:24 +0000 (10:28 -0500)]
ceph-common: enable rhcs tools repo for monitoring

The monitoring node running grafana needs the rhcs tools repostory
enabled in non containerized deployment to be able to install the
ceph-grafana-dashboards rpm package.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1918650
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
4 years agotests: pin ansible-lint version
Guillaume Abrioux [Wed, 10 Feb 2021 06:41:43 +0000 (07:41 +0100)]
tests: pin ansible-lint version

This commit pins the ansible-lint version to 4.3.7 as ceph-ansible isn't
compatible with recent changes in 5.0.0

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agotests: set `mon_max_pg_per_osd` in rgw_multisite
Guillaume Abrioux [Tue, 9 Feb 2021 14:50:43 +0000 (15:50 +0100)]
tests: set `mon_max_pg_per_osd` in rgw_multisite

Otherwise, the job fails when it tries to create a bucket with `s3cmd mb`
command because we have too many PGs per OSD.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agorgw: fix a typo in multisite
Guillaume Abrioux [Thu, 4 Feb 2021 16:45:05 +0000 (17:45 +0100)]
rgw: fix a typo in multisite

if `rgw_zonegroupmaster` is not defined at the rgw instance level in
`rgw_instances` it will fallback to a wrong variable (`rgw_zonemaster`).

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1925247
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agorolling_update: exclude clients from node-exporter
Dimitri Savineau [Wed, 3 Feb 2021 18:07:24 +0000 (13:07 -0500)]
rolling_update: exclude clients from node-exporter

Since b105549 we don't install node-exporter on client nodes so we should
also exclude the client node from the node-exporter upgrade.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
4 years agodocs: nautilus uses ansible 2.9
Dimitri Savineau [Thu, 28 Jan 2021 20:28:14 +0000 (15:28 -0500)]
docs: nautilus uses ansible 2.9

This updates the ansible release required to deploy nautilus with the
stable-4.0 branch.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
4 years agodashboard: update with the new monitoring group
Dimitri Savineau [Wed, 3 Feb 2021 17:59:14 +0000 (12:59 -0500)]
dashboard: update with the new monitoring group

Since eefe11d the grafana-server group has been renamed to monitoring
but the dashboard playbook wasn't updated.
This was still working due to the backward compatibility added in the
ceph-facts role.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
4 years agovagrant: remove centos/8 workaround
Dimitri Savineau [Thu, 4 Feb 2021 22:10:20 +0000 (17:10 -0500)]
vagrant: remove centos/8 workaround

The CentOS 8 vagrant box has finally been updated [1] with a recent
version (the latest one 2011 which means CentOS 8.3).
We don't need to download the vagrant libvirt box with a direct url
anymore from the CentOS infrastructure.

[1] https://app.vagrantup.com/centos/boxes/8

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
4 years agoupdate: update ceph release pattern in complete upgrade play
Guillaume Abrioux [Fri, 5 Feb 2021 21:27:38 +0000 (22:27 +0100)]
update: update ceph release pattern in complete upgrade play

since master is now deploying quincy, we must update this.
Otherwise, it will fail like following:

```
Error EPERM: require_osd_release cannot be lowered once it has been set
```

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agocommon: ensure shaman returns right repo
Guillaume Abrioux [Fri, 5 Feb 2021 19:41:21 +0000 (20:41 +0100)]
common: ensure shaman returns right repo

Due to recent changes in shaman, there's a chance it returns the wrong
repository from architecture point of view.
We can query shaman and ask for the correct architecture to get around
this.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agorolling_update: pg check refactor
Guillaume Abrioux [Thu, 4 Feb 2021 15:24:03 +0000 (16:24 +0100)]
rolling_update: pg check refactor

There's no need to achieve this in two tasks.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agovalidate: fix a typo
Guillaume Abrioux [Thu, 4 Feb 2021 16:05:19 +0000 (17:05 +0100)]
validate: fix a typo

fixes a typo

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agotests: remove legacy
Guillaume Abrioux [Thu, 4 Feb 2021 15:42:10 +0000 (16:42 +0100)]
tests: remove legacy

remove a legacy in tox environment definition

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agotests: follow up on 7c9063b
Guillaume Abrioux [Wed, 3 Feb 2021 08:33:14 +0000 (09:33 +0100)]
tests: follow up on 7c9063b

7c9063b1d2b1af22feb65e70cd8c4dd2de179fb9 broke some scenarios.
This commit fixes them.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agolibrary: fix idempotency in ceph_mgr_module
Dimitri Savineau [Thu, 21 Jan 2021 02:02:17 +0000 (21:02 -0500)]
library: fix idempotency in ceph_mgr_module

The ceph mgr command output is printed on stderr instead of stdout which
prevent to set the changed flag to false if the module is already enabled.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
4 years agocephadm-adopt: use ceph_osd_flag module
Dimitri Savineau [Thu, 21 Jan 2021 17:12:17 +0000 (12:12 -0500)]
cephadm-adopt: use ceph_osd_flag module

There's no reason to not use the ceph_osd_flag module to set/unset osd
flags.
Also if there's no OSD nodes in the inventory then we don't need to
execute the set/unset play.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
4 years agopurge-cluster: use parted ansible module
Dimitri Savineau [Tue, 12 Jan 2021 20:47:42 +0000 (15:47 -0500)]
purge-cluster: use parted ansible module

Instead of doing some scripting via the shell module, we can use the
parted ansible module to check the boot flag on partitions.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
4 years agolibrary/cephadm_bootstrap: add registry support
Dimitri Savineau [Wed, 6 Jan 2021 19:06:48 +0000 (14:06 -0500)]
library/cephadm_bootstrap: add registry support

This adds the custom registry auth support when using a registry with
authentication.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
4 years agoceph-defaults: use https for download.ceph.com
Dimitri Savineau [Mon, 1 Feb 2021 16:47:10 +0000 (11:47 -0500)]
ceph-defaults: use https for download.ceph.com

There's no reason to still use http on download.ceph.com instead of
https.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
4 years agotests: use lvm batch on osd2 (all_daemons)
Guillaume Abrioux [Mon, 1 Feb 2021 19:32:37 +0000 (20:32 +0100)]
tests: use lvm batch on osd2 (all_daemons)

in order to test lvm batch in purge scenario.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agopurge: zap and destroy db and wal devices for lvm batch
Guillaume Abrioux [Mon, 1 Feb 2021 15:51:07 +0000 (16:51 +0100)]
purge: zap and destroy db and wal devices for lvm batch

Those devices (db/wal) are never zapped in lvm batch deployment.
Iterating over `dedicated_devices` and `bluestore_wal_devices` fixes
this issue.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1922926
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agoceph-facts: set rgw_instances_all fact once
Dimitri Savineau [Mon, 25 Jan 2021 19:40:00 +0000 (14:40 -0500)]
ceph-facts: set rgw_instances_all fact once

There's no need to set the rgw_instances_all fact for each node. We can
rely on run_once for that one.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
4 years agolibrary: retrieve realm id for zone/zonegroup v6.0.0alpha7
Dimitri Savineau [Fri, 22 Jan 2021 17:45:32 +0000 (12:45 -0500)]
library: retrieve realm id for zone/zonegroup

When the zonegroup or the zone doesn't have a realm associated then
it's not possible to modify that ressource.
This patch allows to retrieve the current realm id and compare it to
the realm id from the realm in parameter.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
4 years agocephadm-adopt: use radosgw modules for idempotency
Dimitri Savineau [Thu, 21 Jan 2021 22:42:33 +0000 (17:42 -0500)]
cephadm-adopt: use radosgw modules for idempotency

When rerunning the cephadm-adopt.yml playbook the radosgw realm,
zonegroup and zone tasks will fail because the task isn't
idempotent.
Using the radosgw ansible modules solves that problem.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
4 years agotox: test cephadm-adopt.yml playbook idempotency
Dimitri Savineau [Thu, 21 Jan 2021 16:27:10 +0000 (11:27 -0500)]
tox: test cephadm-adopt.yml playbook idempotency

Rerun the cephadm-adopt.yml playbook a second time for idempotency
purpose.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
4 years agolibrary: make cephadm_adopt module idempotent
Dimitri Savineau [Thu, 21 Jan 2021 16:19:44 +0000 (11:19 -0500)]
library: make cephadm_adopt module idempotent

Rerunning the cephadm_adopt module on an already adopted daemon will
fail because the cephadm adopt command isn't idempotent.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1918424
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
4 years agocephadm-adopt: make the playbook idempotent
Dimitri Savineau [Wed, 20 Jan 2021 22:39:44 +0000 (17:39 -0500)]
cephadm-adopt: make the playbook idempotent

If the cephadm-adopt.yml fails during the first execution and some
daemons have already been adopted by cephadm then we can't rerun
the playbook because the old container won't exist anymore.

Error: no container with name or ID ceph-mon-xxx found: no such container

If the daemons are adopted then the old systemd unit doesn't exist anymore
so any call to that unit with systemd will fail.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1918424
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
4 years agoceph-mon: add ExecStartPre docker stop to systemd
Dimitri Savineau [Wed, 13 Jan 2021 15:17:56 +0000 (10:17 -0500)]
ceph-mon: add ExecStartPre docker stop to systemd

We already do that in the other systemd templates (mgr, mds, etc..)
and would present to add workaround in other orchestration tool.
This change is for containerized deployment only.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1882724
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
4 years agorgw: avoid useless call to ceph-rgw
Guillaume Abrioux [Wed, 27 Jan 2021 17:36:13 +0000 (18:36 +0100)]
rgw: avoid useless call to ceph-rgw

since `ceph-rgw` may be called from `ceph-handler` in some contexts we
should avoid rerunning it unnecessarily.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agofs2bs: remove a legacy fact
Guillaume Abrioux [Mon, 11 Jan 2021 15:55:40 +0000 (16:55 +0100)]
fs2bs: remove a legacy fact

since cf7345f143148a6be2d71954f829a8f7fe11ab22, we don't need to set
this fact anymore.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agorgw: multisite refact
Guillaume Abrioux [Thu, 14 Jan 2021 16:52:39 +0000 (17:52 +0100)]
rgw: multisite refact

Add the possibility to deploy rgw multisite configuration with a mix of
secondary and primary zones on a same rgw node.
Before that, on a same node, all instances were either primary
zones *OR* secondary.

Now you can define a rgw instance like following:

```
rgw_instances:
  - instance_name: 'rgw0'
    rgw_zonemaster: false
    rgw_zonesecondary: true
    rgw_zonegroupmaster: false
    rgw_realm: 'france'
    rgw_zonegroup: 'zonegroup-france'
    rgw_zone: paris-00
    radosgw_address: "{{ _radosgw_address }}"
    radosgw_frontend_port: 8080
    rgw_zone_user: jacques.chirac
    rgw_zone_user_display_name: "Jacques Chirac"
    system_access_key: P9Eb6S8XNyo4dtZZUUMy
    system_secret_key: qqHCUtfdNnpHq3PZRHW5un9l0bEBM812Uhow0XfB
    endpoint: http://192.168.101.12:8080
```

Basically it's now possible to define `rgw_zonemaster`,
`rgw_zonesecondary` and `rgw_zonegroupmaster` at the intsance
level instead of the whole node level.

Also, this commit adds an option `deploy_secondary_zones` (default True)
which can be set to `False` in order to explicitly ask the playbook to
not deploy secondary zones in case where the corresponding endpoint are
not deployed yet.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1915478
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agolibrary: fix bug in radosgw_zone.py
Guillaume Abrioux [Sun, 17 Jan 2021 19:46:31 +0000 (20:46 +0100)]
library: fix bug in radosgw_zone.py

If for some reason `get_zonegroup()` returns a failure, we must handle
and make the module exit properly instead of failing with the following
python trace:

```
Traceback (most recent call last):
  File "./AnsiballZ_radosgw_zone.py", line 247, in <module>
    _ansiballz_main()
  File "./AnsiballZ_radosgw_zone.py", line 234, in _ansiballz_main
    exitcode = debug(sys.argv[1], zipped_mod, ANSIBALLZ_PARAMS)
  File "./AnsiballZ_radosgw_zone.py", line 202, in debug
    runpy.run_module(mod_name='ansible.modules.radosgw_zone', init_globals=None, run_name='__main__', alter_sys=True)
  File "/usr/lib64/python3.6/runpy.py", line 205, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib64/python3.6/runpy.py", line 96, in _run_module_code
    mod_name, mod_spec, pkg_name, script_name)
  File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/vagrant/.ansible/tmp/ansible-tmp-1610728441.41-685133-218973990589597/debug_dir/ansible/modules/radosgw_zone.py", line 467, in <module>
    main()
  File "/home/vagrant/.ansible/tmp/ansible-tmp-1610728441.41-685133-218973990589597/debug_dir/ansible/modules/radosgw_zone.py", line 463, in main
    run_module()
  File "/home/vagrant/.ansible/tmp/ansible-tmp-1610728441.41-685133-218973990589597/debug_dir/ansible/modules/radosgw_zone.py", line 425, in run_module
    zonegroup = json.loads(_out)
  File "/usr/lib64/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/lib64/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib64/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

```

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agolibrary: move `fatal()` into ca_common.py
Guillaume Abrioux [Sun, 17 Jan 2021 19:17:30 +0000 (20:17 +0100)]
library: move `fatal()` into ca_common.py

this function is defined in various modules, let's move it to
`ca_common.py`

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
4 years agografana: update container tag to 6.7.4
Dimitri Savineau [Tue, 19 Jan 2021 19:24:22 +0000 (14:24 -0500)]
grafana: update container tag to 6.7.4

This update the grafana container tag to 6.7.4.
The RHCS version is now based on the RHCS 5 container image which is
also based on 6.7.4.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>