]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/log
ceph-ansible.git
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>
(cherry picked from commit 267cce9e8360fc8cb9c192fde2406e5dca724610)

4 years 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>
(cherry picked from commit a670982a38cf87cef87ebadf15d7e33fa7a6ff44)

4 years 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>
(cherry picked from commit e6d8b058ba92fecdc78ee55b0dd8ce12c5120df0)

4 years 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>
(cherry picked from commit bb7d37fb6aac091ba0e9d7f6b7ad468e177d16b3)

4 years 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>
(cherry picked from commit a9220654f568a763142deb77f81cfc9f2a80f233)

4 years 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>
(cherry picked from commit 0772b3d28d88ce49b0547e2afcdfd25cae084aea)

4 years 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>
(cherry picked from commit d3d3d015286012b171d424c4a9cfe73ca0d3bd09)

4 years 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>
(cherry picked from commit ee44d860723fb4e27cd0c186e518edd42aa8fd50)

4 years agovalidate: check virtual_ips variable
Guillaume Abrioux [Mon, 11 Jan 2021 09:06:08 +0000 (10:06 +0100)]
validate: check virtual_ips variable

This commit checks the length of `virtual_ips` doesn't exceed the length
of `groups[rgwloadbalancer_group_name]`.
It also ensure this variable is defined when
`groups[rgwloadbalancer_group_name]` contains at least one node.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit ae196bf94631bd31b8fa663305de90072766b7f6)

4 years agoceph-rgw-loadbalancer: Fix keepalived master selection
Benoît Knecht [Mon, 1 Jun 2020 15:09:18 +0000 (17:09 +0200)]
ceph-rgw-loadbalancer: Fix keepalived master selection

While 2ca33641 fixed a bug in the way the `keepalived.conf.j2` template matched
hostnames to set the VRRP `MASTER`/`BACKUP` states, it also introduced a
regression in the case where `virtual_ips` is a list of more than one IP
address.

The previous behavior would result in each host in the `rgwloadbalancers` group
to be `MASTER` for one of the `virtual_ips`, but the new behavior caused the
first host to be `MASTER` for all the IP address in `virtual_ips`.

This commit restores the original behavior.

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
(cherry picked from commit 3116f464226d676cae9603503c3f8a2d57bcf055)

4 years 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>
(cherry picked from commit 3db1ea7ec41475243559beff50b7011773c021e5)

4 years 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>
(cherry picked from commit 41295f0ef661511953be607d44d82a80f5656d2e)

4 years 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>
(cherry picked from commit 22c18e82f0340bcc63bba7f124cda8e04874b30b)

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>
(cherry picked from commit 2437f145811dfce0ffa83bcf35e8fd711b27d3dd)

4 years 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>
(cherry picked from commit 441651638d883b73c960363becae54096c8cee85)

4 years 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>
(cherry picked from commit c07851347521b09c39b556818378767fc23f05e5)

4 years 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>
(cherry picked from commit ddbc11c4a9c815ccc46fa52fd900f452c082612f)

4 years 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>
(cherry picked from commit bab403b603feb8b7534dde65924699b370f4bc0d)

4 years 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>
(cherry picked from commit 3d4267051f03c053dcd7d3f6f381988be0b2939d)

4 years 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>
(cherry picked from commit b1e7e1ad0f517c345ade159961d8bb2cb13b1c22)

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>
(cherry picked from commit 70f19be367390aeca43340711d380ce4825e02b5)

4 years 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>
(cherry picked from commit 36b4227dcd79c2525102f8c3102771cfab7fe693)

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>
(cherry picked from commit 2c74c2732113ca2ef3e98361c64e1748790828b0)

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>
(cherry picked from commit d0442d81b9e8087ae8ec086798c68382680a7d73)

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>
(cherry picked from commit 6bbb90198b600b460a34faf322a9e36646b3689e)

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>
(cherry picked from commit 9e7f22a071c0f7aecd98baeb73a1f90e290ef039)

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>
(cherry picked from commit a0e1a450d3cbdcd52a39bd11fd9b8287daabae1f)

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>
(cherry picked from commit 9f03a527ba1294a7e050f87d78f7457ccad28d98)

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>
(cherry picked from commit b60c61ce450db5b755744c491b4dfd1ce70fb124)

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>
(cherry picked from commit 2db2208e406df83806c264207e7df90623add154)

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>
(cherry picked from commit c5728bdc6351fe985e17b095cbd5871ef673dc29)

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>
(cherry picked from commit e9ddb972fef5ab73e3a6f4f95f451ae223dcf64c)

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>
(cherry picked from commit c33de174f1d8ec2d4b94a4322cdcdcf25262f1f6)

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>
(cherry picked from commit 006998e804f803f3d3a6767403803a9cad1ed9b0)

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>
(cherry picked from commit b445df047931e53b1fe047313333bd873673e982)

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>
(cherry picked from commit a59bc2da3b82fcc5d6ce413350c74654fecba381)

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>
(cherry picked from commit b01f16e8353ac261d8de34ef8b04e618c455492d)

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>
(cherry picked from commit 63a246db41195f842537473e1784f642ca6292cf)

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>
(cherry picked from commit 0163ecc924ccec3e5da9a9c4cfb8ac4558ec33ef)

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>
(cherry picked from commit a1125727345b55b9e0e6898dd58f3ea009e0eccd)

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>
(cherry picked from commit db031a4993480ca987011630fa716f7e2ccda976)
(cherry picked from commit 5fa4ff5ed36e9df3215e54cb55ddc6e9905f486c)

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>
(cherry picked from commit a7f2fa73e63e69dba2e41aaac9732397eec437c9)

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>
(cherry picked from commit c90b0985e50cd9a4a0160d0707af544f319a7fe8)

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>
(cherry picked from commit 5801171b37a3acd6d7d26b874c7d541d135b9f15)

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>
(cherry picked from commit b8080bac41f7604c3f37a2db214e4091f64720b4)

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>
(cherry picked from commit 7e1db0b59929b30b35c75968076b34685d0eac5b)

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>
(cherry picked from commit ed79bc7a4e38e257f37faac50a5a19c06711dd8d)

4 years agofix 'command -v' tasks v5.0.5
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>
(cherry picked from commit 14c472707c165f77def05826b22885480af3e8f9)

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>
(cherry picked from commit b445df047931e53b1fe047313333bd873673e982)

4 years agotests: remove sleep commands from tox ini files
Guillaume Abrioux [Wed, 30 Sep 2020 15:59:39 +0000 (17:59 +0200)]
tests: remove sleep commands from tox ini files

Since we use the rerun plugin in tox, we shouldn't need to add these
`sleep` commands.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit e835c77a0e705e69776362cd643acf9cb442ea0c)

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>
(cherry picked from commit ccd1cbb732e25fe364b68a548cbed11da2a91ceb)

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>
(cherry picked from commit 31a0f2653db0a1ff57adb1249107e2e8986ac34b)

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>
(cherry picked from commit e66b7b7449e04c8e1fde9ffd57c1c5ef5ba6b0fd)

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>
(cherry picked from commit 88d119e95a58b3963be7759ea08efe56131d37aa)

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>
(cherry picked from commit f7fd1c229896c3a6a482c92a64742f06bbed0a25)

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>
(cherry picked from commit f143b1a6478bffe0e7ff1c23810d0a5368cf3592)

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>
(cherry picked from commit 8b1474ab75bb5563bbdecaf965f8fbb240bd93bf)

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>
(cherry picked from commit 39649f0ce8dd1c7b911fb7442f16e141735685b0)

4 years agodebian/uca: remove the handler notification v5.0.4
Dimitri Savineau [Wed, 10 Jun 2020 14:32:53 +0000 (10:32 -0400)]
debian/uca: remove the handler notification

The "update apt cache" in the ceph-handler role was never called and the
handler trigger after adding the uca repository doesn't exist at all.
Instead of using a handler for that we can just set the update_cache
parameter to true like the other apt_repository tasks.

Resolve merge conflict from cherry-picking this commit.

Signed-off-by: Dimitri Savineau <dsavinea@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>
(cherry picked from commit 847611048ef3c0aa0ae542623f35b23b9cbea8a6)

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>
(cherry picked from commit d49ea9818b162a4b8fc0f5099f45acff4d22fe14)

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>
(cherry picked from commit a16ae693d8e1d3502acf92004179d84c6b60c873)

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>
(cherry picked from commit fe6d6ba62248853dabf9ecbd5fe702b319b8f14a)

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>
(cherry picked from commit b9dd253a4fdd336684d107a5f2692dabc5fc1d36)

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>
(cherry picked from commit 980a5a7df4f6f286b5e6a16b786847920c269bdd)

4 years agotests: use V3.3-stable branch for nfs-ganesha
Guillaume Abrioux [Thu, 11 Feb 2021 21:32:33 +0000 (22:32 +0100)]
tests: use V3.3-stable branch for nfs-ganesha

This is the latest stable release available for octopus.
Let's use it instead of using master builds.

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>
(cherry picked from commit 4e95180c80c3da0c721c54b100e7698798b173cc)

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>
(cherry picked from commit d42d584085bd768d6a8f3ef57c862811b8ec67b5)

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>
(cherry picked from commit 48a456dc8c951d869c7745aa38fbe5327795eb65)

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>
(cherry picked from commit e4dd0067c6fbe824b895ebaedb805359e85f0374)

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>
(cherry picked from commit 2f1d287b1cf5ada3e4a8ebb889e6c07fa72558b9)

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>
(cherry picked from commit 54bae480d20b1066e20d1bfa530f987a8425535c)

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>
(cherry picked from commit 931b87e83044936648172c37ff961fee3d660c14)

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>
(cherry picked from commit 94af3c87d18fab6170c5b32f1431a0d49ccad321)

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>
(cherry picked from commit ed094ea07a5cdcb0a588f808b7f563ee16ebb228)

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>
(cherry picked from commit 984191ac7fc7c500de3a7a111564a537b937711b)

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>
(cherry picked from commit 3749d297c77e65406ddec08e7bae5cea097905d8)

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>
(cherry picked from commit 86170816649ccb1d0995ea3f0bd17275d4af2574)

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>
(cherry picked from commit 71a5e666e39b11cd7945afa28a9f6fbe7de8c2b7)

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>
(cherry picked from commit fedb36688dbf05521966ee22e831283f0967d17a)

4 years agoceph-defaults: change default ceph container tag
Dimitri Savineau [Fri, 22 Jan 2021 15:01:10 +0000 (10:01 -0500)]
ceph-defaults: change default ceph container tag

The "latest" ceph container tag references the latest stable release
(octopus at the moment). "latest" is an alias on "latest-octopus".
On the devel branch we should use "latest-master" tag instead.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit 7d567719756199f34d6cb05347435905a8c4aece)

4 years agomodule_utils: don't add newline to the data
Dimitri Savineau [Thu, 14 Jan 2021 02:11:39 +0000 (21:11 -0500)]
module_utils: don't add newline to the data

When executing a command via the run_command method and passing some
data with stdin then the default behavior is to add append a newline.
This breaks the value of password used by our modules.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit 661690857726de9a63abc3c9503f6bcae52cb975)

4 years agodashboard: manage password backward compatibility
Dimitri Savineau [Mon, 11 Jan 2021 16:48:53 +0000 (11:48 -0500)]
dashboard: manage password backward compatibility

The ceph dashboard changed the way the password are provided via the
CLI.
This breaks the backward compatibility when using a recent ceph-ansible
version with ceph release without that feature.
This patch adds tasks for legacy workflow (ceph release without that
feature) in both ceph-dashboard role and ceph_dashboard_user module.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
4 years agodashboard: configure passwords via stdin
Guillaume Abrioux [Thu, 7 Jan 2021 11:40:18 +0000 (12:40 +0100)]
dashboard: configure passwords via stdin

Due to recent changes in ceph, the few dashboard passwors
must be passed via `-i`

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit ef975ef5eacb14b66a8982ccb27a38ce552abcc4)

4 years agolibrary: refact ceph_dashboard_user
Guillaume Abrioux [Wed, 6 Jan 2021 13:07:38 +0000 (14:07 +0100)]
library: refact ceph_dashboard_user

refact this module due to recent changes in ceph pacific.
The password must be passed with `-i` option.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 2725db3e9f42472fdf63c81e5b0236bc6449cf4b)

4 years agomon: fix cephx disabled deployment
Guillaume Abrioux [Wed, 13 Jan 2021 10:07:50 +0000 (11:07 +0100)]
mon: fix cephx disabled deployment

Due to missing condition on `cephx` variable, cephx disabled deployments
are broken.
This commit fixes this.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1910151
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 4af084570274c2ffdc601c9113242df4808cb726)

4 years agofs2bs: skip migration when a mix of fs and bs is detected
Guillaume Abrioux [Tue, 15 Dec 2020 16:49:32 +0000 (17:49 +0100)]
fs2bs: skip migration when a mix of fs and bs is detected

Since the default of `osd_objectstore` has changed as of 3.2, some
deployments might have a mix of filestore and bluestore OSDs on a same
node. In some specific cases, there's a possibility that a filestore OSD
shares a journal/db device with a bluestore OSD. We shouldn't try to
redeploy in this context because ceph-volume will complain. (either
because in lvm batch you can't pass partition or about gpt header).
The safest option is to skip the migration on the node when such a mix
is detected or force all osds including those already using bluestore
(option `force_filestore_to_bluestore=True` has to be passed as an extra var).
If all OSDs are using filestore, then they will be migrated to
bluestore.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1875777
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit e66f12d1387e7fa86138ae18d3026a1f31328b6b)

4 years agoswitch2container: fix mon quorum check
Guillaume Abrioux [Fri, 18 Dec 2020 09:33:44 +0000 (10:33 +0100)]
switch2container: fix mon quorum check

The current check makes no sense because it checks any of other monitor
than the one being played (either a previous one already converted or a
next that isn't yet converted) is present on the quorum.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1909011
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 175ffa1b882960e8127ada7f6a4b1e6c9a9b8fba)

4 years agoPath for ceph config missing in crash template
Mike Currin [Thu, 24 Dec 2020 07:25:24 +0000 (09:25 +0200)]
Path for ceph config missing in crash template

The path where ceph.conf is located (/etc/ceph) missing in the Docker container bind mounts, this throws errors

Signed-off-by: Mike Currin <currin@gmail.com>
(cherry picked from commit 4cbc9a48c9cd025df7dcd438c5bcf975868638c0)

4 years agorgw: support switching from single-site to multisite
Guillaume Abrioux [Wed, 6 Jan 2021 09:37:12 +0000 (10:37 +0100)]
rgw: support switching from single-site to multisite

When collocating rgw with either a mon, mgr or osd, switching from
single site to a multisite rgw setup failed because of the handlers
triggered between the ansible play of the collocated daemon and the play
of the rgw. Since the multisite changes are not yet applied the handlers
fail.
The idea here is to ensure we run the multisite configuration from the
ceph-handler role before the restart happens, this way it won't complain
because of non existing multisite configuration.

(Note: this is also valid when simply changing a multisite configuration)

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1888630
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 513c8cfe551da78ea89d2513dffebd9649bfeb44)

4 years agolibrary: remove containerized parameter from cv
Dimitri Savineau [Fri, 18 Dec 2020 15:25:54 +0000 (10:25 -0500)]
library: remove containerized parameter from cv

The ceph-volume module relies on environment variables to determine if
the command should be executed within a container or not.
The containerized parameter isn't used anymore and we can remove it.

Fixes: #6153
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit 613ab11b9be8cfe2c9ef4f1e1ff12510d794c6c7)

4 years agocephadm: remove loop on host add tasks
Dimitri Savineau [Wed, 9 Dec 2020 22:05:25 +0000 (17:05 -0500)]
cephadm: remove loop on host add tasks

Instead of iterate over the host list for adding the node/label to the
host orchestrator configuration then we can do it parallelly.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit 5b6f907a72e78e2d5424f0a59e336efc2f36fffc)

4 years agolibrary: add cephadm_bootstrap module
Dimitri Savineau [Fri, 16 Oct 2020 00:42:00 +0000 (20:42 -0400)]
library: add cephadm_bootstrap module

This adds cephadm_bootstrap ansible module for replacing the command module
usage with the cephadm bootstrap command.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit c3ed124d310298d894ed340730c5d4dd265629ed)

4 years agolibrary: add cephadm_adopt module
Dimitri Savineau [Mon, 30 Nov 2020 19:32:54 +0000 (14:32 -0500)]
library: add cephadm_adopt module

This adds cephadm_adopt ansible module for replacing the command module
usage with the cephadm adopt command.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit 08f118077fde6706c31a1a953ea1b0d5812f7201)

4 years agolibrary: add missing `target_size_ratio` parameter support in ceph_pool module
Fabien Brachere [Wed, 16 Dec 2020 06:33:36 +0000 (07:33 +0100)]
library: add missing `target_size_ratio` parameter support in ceph_pool module

When creating a new pool, target_size_ratio was ignored by ansible module ceph_pool.py.
target_size_ratio is now used when pg_autoscale_mode is on.
Tests added to library tests.
This adds too the use in the role ceph-rgw.

Signed-off-by: Fabien Brachere <fabien.brachere@celeste.fr>
(cherry picked from commit 4026ba9da136fef03d0070a02bed066e021d362a)

4 years agoceph-config: fix ceph-volume lvm batch report
Dimitri Savineau [Tue, 15 Dec 2020 18:52:43 +0000 (13:52 -0500)]
ceph-config: fix ceph-volume lvm batch report

Since the major ceph-volume lvm batch refactoring, the report value
is different.
Before the refact, the report was a dict with the OSDs list to be created
under the "osds" key.
After the refact, the report is a list of dict.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit 827b23353ff389660f393cb36fb36540c362e8cf)

4 years agolibrary: add ceph_osd_flag module
Dimitri Savineau [Tue, 3 Nov 2020 21:44:58 +0000 (16:44 -0500)]
library: add ceph_osd_flag module

This adds ceph_osd_flag ansible module for replacing the command module
usage with the ceph osd set/unset commands.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit 5da593604a50605b228107752588a907169eb381)

4 years agomonitoring: use config_template module for config
Dimitri Savineau [Fri, 11 Dec 2020 18:07:04 +0000 (13:07 -0500)]
monitoring: use config_template module for config

The alertmanager, grafana and prometheus configuration file are
generated with the template module which doesn't allow for using
config overrides.
Instead we could use the config_template plugin action and add a
new variable for overrides (one for each component).

With this patch, one should be able to add configuration to
prometheus with the following:

---
alertmanager_conf_overrides:
  global:
    smtp_smarthost: 'localhost:25'
...

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1902999
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit 5a410263470932f2f1a22572e0f2c42939591402)

4 years agoceph-osd: use global crush_device_class in lvm_volumes
Seena Fallah [Sat, 5 Dec 2020 21:55:46 +0000 (01:25 +0330)]
ceph-osd: use global crush_device_class in lvm_volumes

Use global crush_device_class variable if it's not set per OSD

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
(cherry picked from commit 5e9444fa5c283587d38e823012c5bfdb434a8f2c)

4 years agotests: force box removal
Guillaume Abrioux [Mon, 14 Dec 2020 09:03:33 +0000 (10:03 +0100)]
tests: force box removal

This avoids interactive mode for `vagrant box remove`.
This can happen for some reason when there's leftover from previous
deployment (VMs not destroyed as expected)

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 011c97786bc08e306267b6cc4374e0f9df6cb416)