ceph-ansible.git
12 hours agocephadm-adopt: fix mgr placement hosts task master
Guillaume Abrioux [Thu, 10 Jun 2021 13:12:41 +0000 (15:12 +0200)]
cephadm-adopt: fix mgr placement hosts task

When no `[mgrs]` group is defined in the inventory, mgr daemon are
implicitly collocated with monitors.
This task currently relies on the length of the mgr group in order to
tell cephadm to deploy mgr daemons.
If there's no `[mgrs]` group defined in the inventory, it will ask
cephadm to deploy 0 mgr daemon which doesn't make sense and will throw
an error.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
13 hours agotests: allocate more memory for all_in_one job
Guillaume Abrioux [Fri, 11 Jun 2021 13:15:47 +0000 (15:15 +0200)]
tests: allocate more memory for all_in_one job

Since we fire up much less VMs than other job, we can affoard allocating
more memory here for this job.
Each VM hosts more daemon so 1024Mb can be too few.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 days agorolling_update: fix mon+rgw/multisite collocation
Guillaume Abrioux [Thu, 10 Jun 2021 18:09:55 +0000 (20:09 +0200)]
rolling_update: fix mon+rgw/multisite collocation

When monitors and rgw are collocated with multisite enabled, the
rolling_update playbook fails because during the workflow, we run some
radosgw-admin commands very early on the first mon even though this is
the monitor being upgraded, it means the container doesn't exist since
it was stopped.

This block is relevant only for scaling out rgw daemons or initial
deployment. In rolling_update workflow, it is not needed so let's skip
it.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 days agotests: use CentOS 8.4 image
Guillaume Abrioux [Tue, 8 Jun 2021 08:57:14 +0000 (10:57 +0200)]
tests: use CentOS 8.4 image

CentOS 8.4 vagrant image is available at https://cloud.centos.org
let's use it.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 days agoSensitive key data now hidden in output log
Neelaksh Singh [Thu, 20 May 2021 06:04:02 +0000 (02:04 -0400)]
Sensitive key data now hidden in output log

Fixes: #6529

Signed-off-by: Neelaksh Singh <neelaksh48@gmail.com>
6 days agoRevert "tests: disable test_mgr_dashboard_is_listening"
Guillaume Abrioux [Mon, 7 Jun 2021 07:39:37 +0000 (09:39 +0200)]
Revert "tests: disable test_mgr_dashboard_is_listening"

This reverts commit 2e19d1705efa8ef247eecb540357195d5142da77.

A new build of ceph@master including the fix is available so
this is not needed anymore.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
10 days agotests: disable test_mgr_dashboard_is_listening
Guillaume Abrioux [Fri, 4 Jun 2021 10:45:47 +0000 (12:45 +0200)]
tests: disable test_mgr_dashboard_is_listening

Due to a recent commit that has introduced a regression in ceph, this
test is failing.
Temporarily disabling it to unblock the CI.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
10 days agodashboard: set cookie_secure in grafana
Guillaume Abrioux [Wed, 2 Jun 2021 09:05:07 +0000 (11:05 +0200)]
dashboard: set cookie_secure in grafana

When using grafana behind https `cookie_secure` should be set to `true`.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2 weeks agofs2bs: use match filter in selectattr()
Guillaume Abrioux [Tue, 25 May 2021 19:40:45 +0000 (21:40 +0200)]
fs2bs: use match filter in selectattr()

0990ae41099d8b9d678f546fc8790033f421711f changed the filter in
selectattr() from 'match' to 'equalto' but due to an incompatibility with
the Jinja2 version for python 2.7 on el7 we must stick to using 'match'
filter.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2 weeks agofs2bs: fix wrong filter when setting osd_ids
Guillaume Abrioux [Tue, 25 May 2021 14:01:27 +0000 (16:01 +0200)]
fs2bs: fix wrong filter when setting osd_ids

using 'match' filter in that task will lead to bad behavior if I have
the following node names for instance:

- node1
- node11
- node111

with `selectattr('name', 'match', inventory_hostname)` it will match
'node1' along with 'node11' and 'node111'.

using 'equalto' filter will make sure we only match the target node.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2 weeks agoprometheus: enforce osd nodes in templates
Guillaume Abrioux [Tue, 25 May 2021 07:26:28 +0000 (09:26 +0200)]
prometheus: enforce osd nodes in templates

When osd nodes are collocated in the clients group (HCI context for
instance), the current logic will exclude osd nodes since they are
present in the client group.

The best fix would be to exclude clients node only when they are not
member of another group but for now, as a workaround, we can enforce
the addition of osd nodes to fix this specific case.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2 weeks agovagrant_up: fix bash legacy syntax
Guillaume Abrioux [Tue, 25 May 2021 08:08:55 +0000 (10:08 +0200)]
vagrant_up: fix bash legacy syntax

This commit rewrites the deprecated syntax used in vagrant_up.sh

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2 weeks agotests: pull images from cloud.centos.org
Guillaume Abrioux [Tue, 25 May 2021 08:02:23 +0000 (10:02 +0200)]
tests: pull images from cloud.centos.org

temporary work around vagrant cloud issue which seems broken at the time
of pushing this commit.
Let's pull images from cloud.centos.org for now since vagrant cloud
hosted images return a 403 error.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
3 weeks agoupdate: do not gather facts on each play
Guillaume Abrioux [Fri, 14 May 2021 14:24:55 +0000 (16:24 +0200)]
update: do not gather facts on each play

There's no benefit to gather facts again on each play in
rolling_update.yml

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 weeks agonfs: get org.ganesha.nfsd.conf from container
Guillaume Abrioux [Thu, 6 May 2021 08:10:56 +0000 (10:10 +0200)]
nfs: get org.ganesha.nfsd.conf from container

Since we need to revert 33bfb10, this is an alternative to initial approach.
We can avoid maintaining this file since it is present in container
image. The idea is to simply get it from the image container and write
it to the host.

Fixes: #6501

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 weeks agoceph-rgw: fix pg_autoscale_mode for pool
Dimitri Savineau [Wed, 5 May 2021 14:39:02 +0000 (10:39 -0400)]
ceph-rgw: fix pg_autoscale_mode for pool

The pg_autoscale_mode for rgw pools introduced in 9f03a52 was wrong
and was missing a `value` keyword because `rgw_create_pools` is a
dict.

Fixes: #6516

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 weeks agoupdate: fix ceph-crash stop task
Guillaume Abrioux [Tue, 4 May 2021 09:42:15 +0000 (11:42 +0200)]
update: fix ceph-crash stop task

This is a workaround for an issue in ansible.
When trying to stop/mask/disable this service in one task, the stop
didn't actually happen, the task doesn't fail but for some reason the
container is still present and running.
Then the task starting the service in the role ceph-crash fails because
it can't start the container since it's already running with the same
name.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 weeks agoceph-nfs: fix dev repo task
Guillaume Abrioux [Thu, 29 Apr 2021 07:01:13 +0000 (09:01 +0200)]
ceph-nfs: fix dev repo task

We need to filter with the OS architecture in order to fetch the right
dev repository in shaman

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 weeks agoceph-osd: allow to use ceph_tcmalloc_max_total_thread_cache for bluestore
Seena Fallah [Wed, 14 Oct 2020 13:00:57 +0000 (16:30 +0330)]
ceph-osd: allow to use ceph_tcmalloc_max_total_thread_cache for bluestore

TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES is for both bluestore and filestore

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
6 weeks agocephadm_adopt: fix ceph-crash migration
Guillaume Abrioux [Wed, 28 Apr 2021 13:11:25 +0000 (15:11 +0200)]
cephadm_adopt: fix ceph-crash migration

ceph-ansible leaves a ceph-crash container in containerized deployment.
It means we end up with 2 ceph-crash containers running after the
migration playbook is complete.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 weeks agocephadm_adopt: fix rgw placement task
Guillaume Abrioux [Mon, 26 Apr 2021 14:01:53 +0000 (16:01 +0200)]
cephadm_adopt: fix rgw placement task

Due to a recent breaking change in ceph, this command must be modified
to add the <svc_id> parameter.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 weeks agocephadm_adopt: create a 'nfs-ganesha' pool
Guillaume Abrioux [Mon, 26 Apr 2021 07:16:40 +0000 (09:16 +0200)]
cephadm_adopt: create a 'nfs-ganesha' pool

When migrating from a cluster with no MDS nodes deployed,
`{{ cephfs_data_pool.name }}` doesn't exist so we need to create a pool
for storing nfs export objects.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
8 weeks agogroup_vars: fix default values
Dimitri Savineau [Thu, 15 Apr 2021 14:24:22 +0000 (10:24 -0400)]
group_vars: fix default values

It looks like the generate_group_vars_sample.sh script wasn't executed
during previous PRs that were modifying the default values.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
8 weeks agoceph-defaults: update multisite readme reference
Dimitri Savineau [Thu, 15 Apr 2021 14:20:39 +0000 (10:20 -0400)]
ceph-defaults: update multisite readme reference

The multisite README file has been merged into a single file.

Closes: #6411

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
8 weeks agodocs: update ansible version for master
Dimitri Savineau [Thu, 15 Apr 2021 14:16:31 +0000 (10:16 -0400)]
docs: update ansible version for master

Since 839fac8 we now use ansible 2.10 on the master branch.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
8 weeks agoConfig the monitoring stack components api urls using a VIP
Francesco Pantano [Fri, 9 Apr 2021 15:16:03 +0000 (17:16 +0200)]
Config the monitoring stack components api urls using a VIP

When dashboard_frontend_vip is provided, all the services should be
configured using the related VIP. A new VIP variable is added for
both prometheus and alertmanager: we're already able to properly
config the grafana vip using dashboard_frontend_vip variable.
This change adds the same variable for both prometheus and
alertmanager.

Signed-off-by: Francesco Pantano <fpantano@redhat.com>
8 weeks agotests: run dev_setup.yml on non_container job only
Guillaume Abrioux [Thu, 15 Apr 2021 08:34:39 +0000 (10:34 +0200)]
tests: run dev_setup.yml on non_container job only

There's no need to run this playbook on container jobs.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
8 weeks agocore: bump ansible version
Guillaume Abrioux [Thu, 15 Apr 2021 07:32:26 +0000 (09:32 +0200)]
core: bump ansible version

We should consider bumping ansible version for future releases, so let's
start testing against ansible 2.10

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
8 weeks agoceph-rgw-loadbalancer: Fix rgw_ports fact
Benoît Knecht [Tue, 13 Apr 2021 11:57:44 +0000 (13:57 +0200)]
ceph-rgw-loadbalancer: Fix rgw_ports fact

The `set_fact rgw_ports` task was failing due to a templating error, because
`hostvars[item].rgw_instances` is a list, but it was treated as if it was a
dictionary.

Another issue was the fact that the `unique` filter only applied to the list
being appended to `rgw_ports` instead of the entire list, which means it was
possible to have duplicate items.

Lastly, `rgw_ports` would have been a list of integers, but the `seport` module
expects a list of strings.

This commit fixes all of the issues above, allowing the `ceph-rgw-loadbalancer`
role to work on systems with SELinux enabled.

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
2 months agoswitch-to-containers: only chown corresponding files
Guillaume Abrioux [Fri, 9 Apr 2021 07:24:05 +0000 (09:24 +0200)]
switch-to-containers: only chown corresponding files

When collocating daemons, if we chown all files under `/var/lib/ceph` it
can cause issues for the collocated daemons that wouldn't have been
migrated yet.

This commit makes the playbook chown only the files corresponding to the
daemon being migrated.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2 months agocontainer/systemd: ensure /var/log/ceph exists
Guillaume Abrioux [Wed, 14 Apr 2021 11:41:59 +0000 (13:41 +0200)]
container/systemd: ensure /var/log/ceph exists

This adds a `ExecStartPre=-/usr/bin/mkdir -p /var/log/ceph` in all
systemd service templates for all ceph daemon.
This is specific to RHCS after a Leapp upgrade is done. Indeed, the
`/var/log/ceph` seems to be removed after the upgrade.
In order to work around this issue let's ensure the directory is present
before trying to start the containers with podman.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2 months agofs2bs: add a final play
Guillaume Abrioux [Tue, 13 Apr 2021 12:40:48 +0000 (14:40 +0200)]
fs2bs: add a final play

This removes the fact `skipped_nodes` which is useless when we run with
`--limit` since it gets reset when a new iteration is made.

Instead, let's print within a final play which node has been skipped
reusing the `skip_this_node` fact.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2 months agorbdmirror: add retries/until when configuring mirroring
Guillaume Abrioux [Mon, 12 Apr 2021 20:29:50 +0000 (22:29 +0200)]
rbdmirror: add retries/until when configuring mirroring

`configure_mirroring.yml` is called right after the daemon is started.
Sometimes, it can happen the first task in `configure_mirroring.yml` is
run while the daemon isn't yet ready, adding a retries/until on that
task should help to avoid causing the playbook to fail.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2 months agocephadm_adopt: support nfs-ganesha adoption
Guillaume Abrioux [Tue, 6 Apr 2021 13:07:26 +0000 (15:07 +0200)]
cephadm_adopt: support nfs-ganesha adoption

This commit adds the nfs-ganesha adoption support in the
`cephadm-adopt.yml` playbook.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2 months agonfs: remove legacy task
Guillaume Abrioux [Fri, 9 Apr 2021 08:02:16 +0000 (10:02 +0200)]
nfs: remove legacy task

This fact is never used, let's remove the task.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2 months agonfs: rename two tasks
Guillaume Abrioux [Fri, 9 Apr 2021 08:01:13 +0000 (10:01 +0200)]
nfs: rename two tasks

set the name of those tasks accordingly with the fact name being set.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2 months agocephadm_adopt: modify placement policy for rgw
Guillaume Abrioux [Tue, 6 Apr 2021 13:43:03 +0000 (15:43 +0200)]
cephadm_adopt: modify placement policy for rgw

the adoption playbook should use `radosgw_num_instances` in order to
determine how much rgw instance it should set recreate.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2 months agocephadm_adopt: fix a typo
Guillaume Abrioux [Tue, 30 Mar 2021 12:30:29 +0000 (14:30 +0200)]
cephadm_adopt: fix a typo

This play doesn't nothing else than stopping/removing rgw daemons.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2 months agodocker2podman: add documentation/header
Guillaume Abrioux [Mon, 12 Apr 2021 07:25:25 +0000 (09:25 +0200)]
docker2podman: add documentation/header

this adds a small documentation in the header of the playbook in order
to explain what is the goal of this playbook.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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 months 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 months 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 months 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 months 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 months 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 months 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>