]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/log
ceph-ansible.git
5 years agotests: change subnet in lvm_osds container scenario
Guillaume Abrioux [Tue, 4 Aug 2020 09:02:23 +0000 (11:02 +0200)]
tests: change subnet in lvm_osds container scenario

This commit changes the subnets in container-lvm_osds scenario.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agoRevert "tests: add more coverage for test_ceph_key"
Guillaume Abrioux [Tue, 4 Aug 2020 09:25:50 +0000 (11:25 +0200)]
Revert "tests: add more coverage for test_ceph_key"

This reverts commit 1e46264bc19161cdf2d2f4529fc6b42f0077af83.

5 years agoRevert "ceph_key: refact the code and minor fixes"
Guillaume Abrioux [Tue, 4 Aug 2020 09:25:41 +0000 (11:25 +0200)]
Revert "ceph_key: refact the code and minor fixes"

This reverts commit 9a950b8f0fe0e60fe658a518f8f4cf066edddf73.

5 years agoceph_key: refact the code and minor fixes
Guillaume Abrioux [Thu, 16 Jul 2020 13:57:14 +0000 (15:57 +0200)]
ceph_key: refact the code and minor fixes

wip

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agotests: add more coverage for test_ceph_key
Guillaume Abrioux [Wed, 15 Jul 2020 15:28:51 +0000 (17:28 +0200)]
tests: add more coverage for test_ceph_key

This commit adds more coverage regarding the testing of ceph_key module

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agoconfig: only add related rgw section
Guillaume Abrioux [Thu, 23 Jul 2020 19:12:46 +0000 (21:12 +0200)]
config: only add related rgw section

there's no need to add each rgw section on all rgw nodes.
With this commit, only related rgw section are rendered.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agoshrink_osd: remove osd data directory
Guillaume Abrioux [Wed, 22 Jul 2020 14:08:15 +0000 (16:08 +0200)]
shrink_osd: remove osd data directory

Otherwise it leaves an empty directory.
When shrinking and redeploying multiple OSDs you have no guarantee it
will reuse the same osd id.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agotox: split shrink_osd scenario
Guillaume Abrioux [Wed, 22 Jul 2020 09:38:55 +0000 (11:38 +0200)]
tox: split shrink_osd scenario

Let's split this scenario with a dedicated tox ini file.

This is for testing in two ways:

1/ shrinking OSDs one by one
2/ shrinking multiple OSDs with a single call of the playbook

ceph-build related PR: ceph/ceph-build#1629

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agotests: refact shrink_osd scenario
Guillaume Abrioux [Tue, 21 Jul 2020 07:27:10 +0000 (09:27 +0200)]
tests: refact shrink_osd scenario

This adds more coverage on the shrink_osd scenario.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agodashboard: allow remote TLS cert/key copy
Dimitri Savineau [Thu, 30 Jul 2020 16:04:18 +0000 (12:04 -0400)]
dashboard: allow remote TLS cert/key copy

When using TLS on the ceph dashboard or grafana services, we can provide
the TLS certificate and key.
Those files should be present on the ansible controller and they will be
copyied to the right node(s).
In some situation, the TLS certificate and key could be already present
on the target node and not on the ansible controller.
For this scenario, we just need to copy the files locally (on each remote
host).

This patch adds the dashboard_tls_external variable (with default to
false) to allow users to achieve this scenario when configuring this
variable to true.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1860815
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agorolling_update: restart mds after the upgrade
Dimitri Savineau [Wed, 29 Jul 2020 13:44:15 +0000 (09:44 -0400)]
rolling_update: restart mds after the upgrade

In addition of 155e2a2, the active mds daemons isn't stop/start
correctly as opposed as the other services so that daemon doesn't come
back after the upgrade.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1861688
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agotests: install pyyaml on osd nodes
Dimitri Savineau [Wed, 29 Jul 2020 16:23:06 +0000 (12:23 -0400)]
tests: install pyyaml on osd nodes

Due to [1], ceph-volume has now a dependency on pyyaml but it's not
installed by default via the package dependency.
This patch only add the required package on non containerized
deployment and as temporary workaround for the CI.

[1] https://tracker.ceph.com/issues/46759

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agorolling_update: refact dashboard workflow
Dimitri Savineau [Fri, 24 Jul 2020 15:21:54 +0000 (11:21 -0400)]
rolling_update: refact dashboard workflow

The dashboard upgrade workflow should do the same process than the ceph
upgrade otherwise any systemd unit modification won't be apply on the
monitoring/dashboard stack.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1859173
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agorolling_update: stop/start instead of restart
Dimitri Savineau [Tue, 21 Jul 2020 18:51:20 +0000 (14:51 -0400)]
rolling_update: stop/start instead of restart

During the daemon upgrade we're
  - stopping the service when it's not containerized
  - running the daemon role
  - start the service when it's not containerized
  - restart the service when it's containerized

This implementation has multiple issue.

1/ We don't use the same service workflow when using containers
or baremetal.

2/ The explicity daemon start isn't required since we'are already
doing this in the daemon role.

3/ Any non backward changes in the systemd unit template (for
containerized deployment) won't work due to the restart usage.

This patch refacts the rolling_update playbook by using the same service
stop task for both containerized and baremetal deployment at the start
of the upgrade play.
It removes the explicit service start task because it's already included
in the dedicated role.
The service restart tasks for containerized deployment are also
removed.

Finally, this adds the missing service stop task for ceph crash upgrade
workflow.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1859173
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agoceph-facts: remove mds_name fact
Dimitri Savineau [Tue, 21 Jul 2020 19:27:59 +0000 (15:27 -0400)]
ceph-facts: remove mds_name fact

The mds_name fact always gets the ansible_hostname value so we don't
need to have a dedicated fact for this and use the ansible_hostname fact
instead.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agoceph-handler: remove iscsigws restart scripts
Dimitri Savineau [Tue, 21 Jul 2020 19:22:26 +0000 (15:22 -0400)]
ceph-handler: remove iscsigws restart scripts

The iscsigws restart scripts for tcmu-runner and rbd-target-{api,gw}
services only call the systemctl restart command.
We don't really need to copy a shell script to do it when we can use
the ansible service module instead.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agopodman: always remove container on start
Dimitri Savineau [Tue, 21 Jul 2020 13:32:50 +0000 (09:32 -0400)]
podman: always remove container on start

In case of failure, the systemd ExecStop isn't executed so the container
isn't removed. After a reboot of a failed node, the container doesn't
start because the old container is still present in created state.
We should always try to remove the container in ExecStartPre for this
situation.
A normal reboot doesn't trigger this issue and this also doesn't affect
nodes running containers via docker.
This behaviour was introduced by d43769d.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1858865
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agotox: remove ubuntu references
Guillaume Abrioux [Wed, 22 Jul 2020 14:29:55 +0000 (16:29 +0200)]
tox: remove ubuntu references

since we've dropped ubuntu testing on PRs and nightlies, we don't need
these references anymore in tox files.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agotests: lvm_setup.yml, add carriage return
Guillaume Abrioux [Wed, 22 Jul 2020 05:28:34 +0000 (07:28 +0200)]
tests: lvm_setup.yml, add carriage return

This commit adds crlf between each task.
It makes the playbook more readable.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agotests: (lvm_setup.yml), don't shrink lvol
Guillaume Abrioux [Tue, 21 Jul 2020 23:51:20 +0000 (01:51 +0200)]
tests: (lvm_setup.yml), don't shrink lvol

when rerunning lvm_setup.yml on existing cluster with OSDs already
deployed, it fails like following:

```
fatal: [osd0]: FAILED! => changed=false
  msg: Sorry, no shrinking of data-lv2 to 0 permitted.
```

because we are asking `lvol` module to create a volume on an empty VG
with size extents = `100%FREE`.

The default behavior of `lvol` is to shrink the volume if the LV's current
size is greater than the requested size.

Given the requested size is calculated like this:

`size_requested = size_percent * this_vg['free'] / 100`

in our case, it is similar to:

`size_requested = 100 * 0 / 100` which basically means `0`

So the current LV size is well greater than the requested size which
leads the module to attempt to shrink it to 0 which isn't obviously now
allowed.

Adding `shrink: false` to the module calls fixes this issue.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agoceph-handler: add missing condition on ceph-crash
Dimitri Savineau [Tue, 21 Jul 2020 19:14:30 +0000 (15:14 -0400)]
ceph-handler: add missing condition on ceph-crash

The ceph-crash tasks present in the ceph-handler role don't need to be
executed on all nodes.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agocrash: rm container in ExecPreStart even with docker
Guillaume Abrioux [Tue, 21 Jul 2020 18:27:28 +0000 (20:27 +0200)]
crash: rm container in ExecPreStart even with docker

We should ensure the container is removed in `ExecPreStart` even when
`{{ container_binary }}` is docker.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agoceph-crash: introduce new role ceph-crash
Guillaume Abrioux [Fri, 3 Jul 2020 08:21:49 +0000 (10:21 +0200)]
ceph-crash: introduce new role ceph-crash

This commit introduces a new role `ceph-crash` in order to deploy
everything needed for the ceph-crash daemon.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agodefaults: remove legacy
Guillaume Abrioux [Thu, 9 Jul 2020 13:03:48 +0000 (15:03 +0200)]
defaults: remove legacy

These variables aren't consummed anywhere else than in ceph-nfs role so
there is no need to have them in `ceph-defaults`'s defaults

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agocephadm: set the command as a fact
Dimitri Savineau [Mon, 20 Jul 2020 14:41:53 +0000 (10:41 -0400)]
cephadm: set the command as a fact

Set the cephadm cmd as a fact instead of rewriting the same command
over and over.
This also fix an issue when using docker as container engine because
the --docker cephadm parameter should be use before the subcommand
not after.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agofacts: fix broken facts when using --limit
Guillaume Abrioux [Mon, 13 Jul 2020 07:42:25 +0000 (09:42 +0200)]
facts: fix broken facts when using --limit

This commit fixes these tasks when --limit is used.

It makes sure the fact is set on right nodes even when the playbook is
run with `--limit`

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agoceph-dashboard: copy TLS cert/key on monitor
Dimitri Savineau [Fri, 17 Jul 2020 14:38:02 +0000 (10:38 -0400)]
ceph-dashboard: copy TLS cert/key on monitor

The ceph-dashboard role is executed on the mgr nodes so the TLS cert/key
files are copied to those nodes.
But we are running importing the cert/key files into the ceph
configuration on the monitor.

Closes: #5557
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agocephadm: add playbook
Dimitri Savineau [Fri, 10 Jul 2020 21:52:38 +0000 (17:52 -0400)]
cephadm: add playbook

This adds a new playbook for deploying ceph via cephadm.

This also adds a new dedicated tox file for CI purpose.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agocephadm-adopt: delegate task for orch apply
Dimitri Savineau [Wed, 15 Jul 2020 22:25:57 +0000 (18:25 -0400)]
cephadm-adopt: delegate task for orch apply

This is a partial revert of b38019e because we don't want to execute
the whole play on the monitor otherwise if we have some empty group
like rgws or mdss then the orchestrator commands will still be
executed.
Instead we should keep the real target group name at play level and
delegate the orchestator commands to the monitor. The whole play
will be skipped is the group is empty.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agocephadm-adopt: inform users about cephadm
Dimitri Savineau [Wed, 15 Jul 2020 19:21:25 +0000 (15:21 -0400)]
cephadm-adopt: inform users about cephadm

Print a message at the end of the playbook to inform users that they
don't have to user ceph-ansible playbooks anymore as everything else
need to be done via cephadm (day 2 operation).

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agocephadm-adopt: refresh the service/daemon list
Dimitri Savineau [Wed, 15 Jul 2020 19:15:06 +0000 (15:15 -0400)]
cephadm-adopt: refresh the service/daemon list

When reporting the orchestrator service/daemon list at the end of the
playbook, we can use the --refresh option otherwise we could have
an outdated output.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agoRevert "cephadm-adopt: remove the cephadm script"
Dimitri Savineau [Wed, 15 Jul 2020 19:14:23 +0000 (15:14 -0400)]
Revert "cephadm-adopt: remove the cephadm script"

This reverts commit c3bbc6b13cee5e566b277f3146e9e6bc4cec2f52.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agoceph_key: fix bug in 'info' feature
Guillaume Abrioux [Thu, 9 Jul 2020 14:24:15 +0000 (16:24 +0200)]
ceph_key: fix bug in 'info' feature

Fix 'info' feature from ceph_key.py module

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agocephadm-adopt: wait for monitor in quorum
Dimitri Savineau [Fri, 10 Jul 2020 21:41:32 +0000 (17:41 -0400)]
cephadm-adopt: wait for monitor in quorum

After adopting a monitor we need to wait that monitor to join back
the quorum before moving to the next node.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agocephadm-adopt: add osd flags during adoption
Dimitri Savineau [Fri, 10 Jul 2020 19:24:24 +0000 (15:24 -0400)]
cephadm-adopt: add osd flags during adoption

Like rolling_update or switch2container playbooks, we need to set/unset
some osd flags before and after the OSD daemons adoption.
This also adds a task for waiting for clean pgs at then of an OSd node.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agocephadm-adopt: add iscsi support
Dimitri Savineau [Fri, 10 Jul 2020 18:59:06 +0000 (14:59 -0400)]
cephadm-adopt: add iscsi support

The iSCSI support has been added recently in cephadm.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agocephadm-adopt: remove the cephadm script
Dimitri Savineau [Fri, 10 Jul 2020 18:45:51 +0000 (14:45 -0400)]
cephadm-adopt: remove the cephadm script

At the end of the process when don't need the cephadm script.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agocephadm-adopt: show orchestrator status
Dimitri Savineau [Fri, 10 Jul 2020 18:13:15 +0000 (14:13 -0400)]
cephadm-adopt: show orchestrator status

At the end of the playbook we can show the orchestrator status like
we do with the ceph status in initial deployment.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agocephadm-adopt: use placement parameter
Dimitri Savineau [Fri, 10 Jul 2020 14:42:02 +0000 (10:42 -0400)]
cephadm-adopt: use placement parameter

It's better to use the --placement parameter when using ceph orch apply
commands to avoid confusion in the parameters.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agocephadm-adopt: use custom dashboard images
Dimitri Savineau [Thu, 9 Jul 2020 22:38:17 +0000 (18:38 -0400)]
cephadm-adopt: use custom dashboard images

cephadm uses default value for dashboard container images which need to
be customized by ansible for upstream or downstream purpose.
This feature wasn't present when cephadm-adopt.yml has been designed.
Also set the container_image_base variable for upgrade purpose.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agocephadm-adopt: run orch apply from monitors
Dimitri Savineau [Thu, 9 Jul 2020 22:28:49 +0000 (18:28 -0400)]
cephadm-adopt: run orch apply from monitors

It looks like we can't run the ceph orch apply commands on nodes other
than monitors even if it used to work in the past.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agocephadm-adopt: don't fail on systemd reset-failed
Dimitri Savineau [Thu, 9 Jul 2020 15:23:33 +0000 (11:23 -0400)]
cephadm-adopt: don't fail on systemd reset-failed

If the systemd service exists successfully then we don't need to reset
the failed state.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agocephadm-adopt: copy client.admin keyring
Dimitri Savineau [Thu, 9 Jul 2020 15:19:41 +0000 (11:19 -0400)]
cephadm-adopt: copy client.admin keyring

The ceph config assimilate-conf command requires the client.admin
keyring which isn't present on all nodes most of the time.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agotox: add cephadm_adopt scenario
Dimitri Savineau [Mon, 6 Jul 2020 18:27:50 +0000 (14:27 -0400)]
tox: add cephadm_adopt scenario

This adds an optional cephadm_adopt scenario which is based on
all_daemons.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agoplay: followup on cc0d969
Guillaume Abrioux [Thu, 9 Jul 2020 11:53:28 +0000 (13:53 +0200)]
play: followup on cc0d969

Remove two other pattern 'iscsigws' in main playbook that have been
missed in cc0d9697c554e459af11965fc2710e42abef4e13

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agorgw: set container memory limit to 4g
Guillaume Abrioux [Thu, 9 Jul 2020 11:07:32 +0000 (13:07 +0200)]
rgw: set container memory limit to 4g

This commit changes the container memory limit for rgw daemons.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1707488
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agofacts: refact `ceph_uid` fact
Guillaume Abrioux [Wed, 8 Jul 2020 13:49:47 +0000 (15:49 +0200)]
facts: refact `ceph_uid` fact

There's no need to set this fact with a `set_fact`
We can achieve this in `ceph-defaults`

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agoceph_volume: fix regression
Guillaume Abrioux [Tue, 7 Jul 2020 23:04:10 +0000 (01:04 +0200)]
ceph_volume: fix regression

do not skip zapping if osd_fsid is passed

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agotests: add docker hub authentication in jobs
Guillaume Abrioux [Tue, 7 Jul 2020 15:11:27 +0000 (17:11 +0200)]
tests: add docker hub authentication in jobs

This commit makes all jobs authenticating to docker hub in order to
avoid the rate limit.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agoplay: remove backward compatibility group name
Guillaume Abrioux [Wed, 8 Jul 2020 11:51:14 +0000 (13:51 +0200)]
play: remove backward compatibility group name

It's time to remove this old group name.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agoceph-nfs: change ganesha devel source
Dimitri Savineau [Thu, 2 Jul 2020 19:23:09 +0000 (15:23 -0400)]
ceph-nfs: change ganesha devel source

The download.nfs-ganesha.org source for nfs-ganesha on CentOS isn't
available anymore.
Let's switch back to shaman since we have builds available now.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agotests: remove nfs_ganesha_stable_branch variable
Dimitri Savineau [Mon, 6 Jul 2020 14:45:21 +0000 (10:45 -0400)]
tests: remove nfs_ganesha_stable_branch variable

We don't need to override this variable in the group_vars but use the
default value instead.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agotests: update nfs-ganesha to V3.3-stable
Guillaume Abrioux [Sun, 5 Jul 2020 14:54:36 +0000 (16:54 +0200)]
tests: update nfs-ganesha to V3.3-stable

not really needed in master, commit intended to be backported in octopus
branch.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agodoc: add a note about deprecated branches
Guillaume Abrioux [Fri, 3 Jul 2020 05:14:57 +0000 (07:14 +0200)]
doc: add a note about deprecated branches

This commit adds a note about `stable-3.0` `stable-3.1` branches which
are deprecated and not maintained anymore.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agodoc: add a note about containerized deployments
Guillaume Abrioux [Fri, 3 Jul 2020 04:58:49 +0000 (06:58 +0200)]
doc: add a note about containerized deployments

This commit updates the documentation to add a note about containerized
deployments.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agodoc: fix warning treated as an error
Guillaume Abrioux [Fri, 3 Jul 2020 07:14:13 +0000 (09:14 +0200)]
doc: fix warning treated as an error

Typical error:

```
Warning, treated as error:
/home/jenkins-build/build/workspace/ceph-ansible-docs-pull-requests/docs/source/day-2/upgrade.rst:2:Title underline too short.
```

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agoceph-defaults: update nfs-ganesha to 3.3
Dimitri Savineau [Thu, 2 Jul 2020 18:29:22 +0000 (14:29 -0400)]
ceph-defaults: update nfs-ganesha to 3.3

nfs-ganesha 3.3 is the latest 3.x release available for octopus so we
should update to this version.

https://download.ceph.com/nfs-ganesha/rpm-V3.3-stable/octopus

This will also match the version used in RHCS 5.

Ceph container already uses that version too.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agofacts: explicitly disable facter and ohai
Dimitri Savineau [Tue, 30 Jun 2020 14:13:42 +0000 (10:13 -0400)]
facts: explicitly disable facter and ohai

By default, ansible gathers facts from facter and ohai if installed on
the remote nodes, given we don't need them, let's exclude these facts
from our facts gathering

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agoradosgw: remove INST_PORT environment variable
Dimitri Savineau [Thu, 2 Jul 2020 14:47:45 +0000 (10:47 -0400)]
radosgw: remove INST_PORT environment variable

This variable isn't consumed by the container so we can remove it.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agorgw: fix multi instances scaleout
Guillaume Abrioux [Wed, 1 Jul 2020 08:47:45 +0000 (10:47 +0200)]
rgw: fix multi instances scaleout

When rgw and osd are collocated, the current workflow prevents from
scaling out the radosgw_num_instances parameter when rerunning the
playbook.

The environment file used in the rgw systemd template is rendered when
executing the `ceph-rgw` role but during a new run of the playbook (in
order to scale out rgw instances), handlers are triggered from `ceph-osd`
role which is run before `ceph-rgw`, therefore it tries to start the new
rgw daemon whereas its corresponding environment file hasn't been
rendered yet and fails like following:

```
ceph-radosgw@rgw.ceph4osd3.rgw1.service failed to run 'start-pre' task: No such file or directory
```

This commit moves the tasks generating this file in `ceph-config` role
so it is generated early.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1851906
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agotests: enforce pytest-rerunfailures version
Guillaume Abrioux [Wed, 1 Jul 2020 16:22:00 +0000 (18:22 +0200)]
tests: enforce pytest-rerunfailures version

This commit enforces the pytest-rerunfailures installed so it's <9.0

This is to avoid the following error:

```
ERROR: pytest-rerunfailures 9.0 has requirement pytest>=5.0, but you'll have pytest 4.6.11 which is incompatible.
```

latest version of pytest-rerunfailures isn't compatible with the version
of pytest we are using.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agovagrant: update centos image to 8.2
Dimitri Savineau [Tue, 16 Jun 2020 19:31:08 +0000 (15:31 -0400)]
vagrant: update centos image to 8.2

CentOS 8.2 (2004) has been relesed so we should switch to this image
when using vagrant.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agoceph-volume.py: add support for batch refactored code
Jan Fajerski [Fri, 26 Jun 2020 08:29:24 +0000 (10:29 +0200)]
ceph-volume.py: add support for batch refactored code

See https://github.com/ceph/ceph/pull/34740 for the batch changes.

Signed-off-by: Jan Fajerski <jfajerski@suse.com>
5 years agoceph-common: remove copr and sepia repositories
Dimitri Savineau [Wed, 17 Jun 2020 18:15:32 +0000 (14:15 -0400)]
ceph-common: remove copr and sepia repositories

All EL8 dependencies are now present on EPEL 8 so we don't need the
additional repositories that were only a temporary solution.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agorolling_update: add any_errors_fatal
Guillaume Abrioux [Mon, 29 Jun 2020 14:52:28 +0000 (16:52 +0200)]
rolling_update: add any_errors_fatal

If a failure occurs in ceph-validate, the upgrade playbook keeps running
where we expect it to fail.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agoAdd container settings for Ubuntu 20 (the same as Ubuntu 18)
George Shuklin [Mon, 29 Jun 2020 13:01:07 +0000 (16:01 +0300)]
Add container settings for Ubuntu 20 (the same as Ubuntu 18)

Signed-off-by: George Shuklin <george.shuklin@gmail.com>
5 years agoAdd playbook for converting cluster to cephadm 5475/head
Dimitri Savineau [Thu, 9 Apr 2020 21:50:54 +0000 (17:50 -0400)]
Add playbook for converting cluster to cephadm

The commit adds a new playbook for converting an existing ceph cluster
deployed by ceph-ansible to the cephadm orchestrator.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agodashboard: configure mgr backend before restart
Dimitri Savineau [Fri, 26 Jun 2020 17:28:04 +0000 (13:28 -0400)]
dashboard: configure mgr backend before restart

We need to set the mgr dashboard server ip address before restarting the
dashboard module otherwise we can try to bind the dashboard module on an
already used address.
We already do this configuration for the dashboard port value and ssl
setup so we should do the same for server address too.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1851455
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agoAnsible tests are not filters
Jonathan Rosser [Thu, 18 Jun 2020 12:39:26 +0000 (13:39 +0100)]
Ansible tests are not filters

The use of "| success" and "| changed" are not valid syntax for modern
ansible releases.

Signed-off-by: Jonathan Rosser <jonathan.rosser@rd.bbc.co.uk>
5 years agoInstall python routes package as a dependancy rather than directly
Jonathan Rosser [Thu, 18 Jun 2020 15:40:52 +0000 (16:40 +0100)]
Install python routes package as a dependancy rather than directly

This is now a dependancy of ceph-mgr so will be installed automatically
and does not need a specific task.

This change means that ceph-mgr installs correctly on Ubuntu Focal where
the python3-routes package is necessary.

Signed-off-by: Jonathan Rosser <jonathan.rosser@rd.bbc.co.uk>
5 years agodashboard: copy self-signed generated crt to mons
Guillaume Abrioux [Tue, 23 Jun 2020 09:11:06 +0000 (11:11 +0200)]
dashboard: copy self-signed generated crt to mons

This commit makes the playbook copying self-signed generated certificate
to monitors.
When mons and mgrs are deployed on dedicated nodes the playbook will
fail when trying to import certificate and key files since they are
generated on mgrs whereas we try to import them from a monitor.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1846995
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agopodman: Add Type and PIDFile value to unit files
Dimitri Savineau [Mon, 22 Jun 2020 16:58:56 +0000 (12:58 -0400)]
podman: Add Type and PIDFile value to unit files

This changes the way we are running the podman containers via systemd.
They are now in dettached mode and Type/PIDFile set.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1834974
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agoceph_volume: make zap function idempotent
Guillaume Abrioux [Fri, 19 Jun 2020 13:09:04 +0000 (15:09 +0200)]
ceph_volume: make zap function idempotent

This commit makes the zap function idempotent, especially when using
lvm_volumes variable.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1845668
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agodocker: Add Requires on docker service
Dimitri Savineau [Mon, 22 Jun 2020 17:58:10 +0000 (13:58 -0400)]
docker: Add Requires on docker service

When using docker container engine then the systemd unit scripts only
use a dependency on the docker daemon via the After parameter.
But if docker is restarted on a live system then the ceph systemd units
should wait for the docker daemon to be fully restarted.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1846830
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agodocker2podman: make images pulling optional
Guillaume Abrioux [Mon, 22 Jun 2020 12:35:16 +0000 (14:35 +0200)]
docker2podman: make images pulling optional

This commit makes the images pulling skipped if podman isn't installed
on the machine.

In OSP context, the podman installation is done later in the workflow,
it means all `podman pull` commands will fail.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1849559
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agotravis: use tests/requirements.txt 5967/head
Dimitri Savineau [Fri, 19 Jun 2020 22:04:55 +0000 (18:04 -0400)]
travis: use tests/requirements.txt

Explicitly install ansible-lint pytest pytest-cov via pip results of a
specific pytest version (4.3.1) which is not supported for pytest-cov
(2.10).
Because we are already defining a specific pytest version in the tests
requirements then we can install all the python dependencies from that
file and remove this from the pip install command.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agorequirements: exclude ansible 2.9.10
Guillaume Abrioux [Fri, 19 Jun 2020 17:29:13 +0000 (19:29 +0200)]
requirements: exclude ansible 2.9.10

ansible 2.9.10 seems to have introduced a bug.

See https://github.com/ansible/ansible/issues/70168

This commit excludes this version from ceph-ansible requirements.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agodocs: Add upgrade operation.
Dimitri Savineau [Mon, 25 May 2020 13:44:12 +0000 (09:44 -0400)]
docs: Add upgrade operation.

This commit adds a chapter about the ceph upgrade process.

Closes: #5393
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agoceph-osd: remove ceph-osd-run.sh script
Dimitri Savineau [Tue, 9 Jun 2020 19:19:57 +0000 (15:19 -0400)]
ceph-osd: remove ceph-osd-run.sh script

Since we only have one scenario since nautilus then we can just move
the container start command from ceph-osd-run.sh to the systemd unit
service.
As a result, the ceph-osd-run.sh.j2 template and the
ceph_osd_docker_run_script_path variable are removed.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agolibrary/ceph_pool: set name parameter as required
Dimitri Savineau [Fri, 22 May 2020 20:11:20 +0000 (16:11 -0400)]
library/ceph_pool: set name parameter as required

The name parameter is required.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agodebian/uca: remove the handler notification
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.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agoswitch_to_containers: don't set noup flag
Guillaume Abrioux [Tue, 16 Jun 2020 15:43:13 +0000 (17:43 +0200)]
switch_to_containers: don't set noup flag

We shouldn't set this flag when running switch_to_containers playbook.
Otherwise the playbook fails waiting for pgs to be clean.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1843569
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agolvm_setup: lookup device from inventory, default to /dev/sd* names
Jan Fajerski [Mon, 10 Feb 2020 09:09:14 +0000 (10:09 +0100)]
lvm_setup: lookup device from inventory, default to /dev/sd* names

This fixes a long standing fail in ceph-volumes lvm test suite.
Otherwise the default behaviour should not change.

Signed-off-by: Jan Fajerski <jfajerski@suse.com>
5 years agocontainer: inspect Id field instead of RepoDigests
Dimitri Savineau [Fri, 5 Jun 2020 20:42:20 +0000 (16:42 -0400)]
container: inspect Id field instead of RepoDigests

When a container image managed by podman isn't tag anymore then the
RepoDigests field when inspecting the image doesn't return any value.
This is different from docker workflow and it breaks the ceph-ansible
container upgrade when collocated multiple services and using a non
fix container tag (like latest or 4).

$ podman images
REPOSITORY              TAG      IMAGE ID       CREATED        SIZE
docker.io/ceph/daemon   latest   680c9c0d38c3   8 days ago     957 MB
<none>                  <none>   011ee108bfc9   2 months ago   1.01 GB

$ podman inspect 680c9c0d38c3 | jq .[0].RepoDigests[0]
"docker.io/ceph/daemon@sha256:20cf789235e23ddaf38e109b391d1496bb88011239d16862c4c106d0e05fea9e"
$ podman inspect 011ee108bfc9 | jq .[0].RepoDigests[0]
null

Because this field returns "null" then the ansible task trying to
determine this value is failing

-----------------------------
fatal: [foo]: FAILED! =>
  msg: |-
    The task includes an option with an undefined variable. The error
    was: None has no element 0

    The error appears to be in
    'roles/ceph-container-common/tasks/fetch_image.yml': line 137,
    column 3, but may be elsewhere in the file depending on the exact
    syntax problem.

    The offending line appears to be:

    - name: set_fact ceph_osd_image_repodigest_before_pulling
      ^ here
-----------------------------

We don't have this behaviour with docker.

$ docker images
REPOSITORY              TAG      IMAGE ID       CREATED        SIZE
docker.io/ceph/daemon   latest   680c9c0d38c3   8 days ago     928 MB
docker.io/ceph/daemon   <none>   011ee108bfc9   2 months ago   986 MB

$ docker inspect 680c9c0d38c3 | jq .[0].RepoDigests[0]
"docker.io/ceph/daemon@sha256:45e6f28bb67c81b826acb64fad5c0da1cac3dffb41a88992fe4ca2be79575fa6"
$ docker inspect 011ee108bfc9 | jq .[0].RepoDigests[0]
"docker.io/ceph/daemon@sha256:b393a73309d72e43ca7d65cd3519036007947671e373eb59aa75a46185c52231"

Instead we should just get the Id field.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1844496
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agoswitch_to_container: fix osd systemd regex
Dimitri Savineau [Thu, 4 Jun 2020 20:57:17 +0000 (16:57 -0400)]
switch_to_container: fix osd systemd regex

The systemd LOAD and ACTIVE fileds could have more than one space between
both values.
This update the systemd regex the same way we're using it in different
part of the code.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1843500
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agorgw multisite: add master zone endpoints to zonegroup
Ali Maredia [Fri, 5 Jun 2020 21:21:27 +0000 (21:21 +0000)]
rgw multisite: add master zone endpoints to zonegroup

We were only adding the endpoints to the master zone but not to the
zonegroup.
This patch fixes the issue.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1839228
Signed-off-by: Ali Maredia <amaredia@redhat.com>
5 years agomergify: remove merge on skip ci
Dimitri Savineau [Tue, 9 Jun 2020 13:23:04 +0000 (09:23 -0400)]
mergify: remove merge on skip ci

This rule will probably never be applyied and at the moment this is
creating a cancelled job in the CI status.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agorgwloadbalancer undefined index variable
Ansible Deployment User [Tue, 26 May 2020 11:18:03 +0000 (13:18 +0200)]
rgwloadbalancer undefined index variable

The vrrp_instances variable is using a loop with index but the index_var
wasn't defined.
As a result, the fact task was failing on this undefined index variable.

The task includes an option with an undefined variable. The error was:
'index' is undefined

Closes: #5395
Signed-off-by: Florian Faltermeier <florian.faltermeier@uibk.ac.at>
5 years agoceph-nfs: add stable noarch repository
Dimitri Savineau [Fri, 15 May 2020 15:20:08 +0000 (11:20 -0400)]
ceph-nfs: add stable noarch repository

When using the stable nfs ganesha repository, we need have both arch
and noarch repositories enabled.
Currently the noarch repository is missing which cause the non
containerized deployment to fail.

Closes: #5375
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
5 years agoswitch_to_container: refact wait for pg check
Guillaume Abrioux [Fri, 15 May 2020 08:58:40 +0000 (10:58 +0200)]
switch_to_container: refact wait for pg check

There is no need to make this check with several steps.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agotests: report coverage status for unittests
Guillaume Abrioux [Tue, 12 May 2020 18:13:35 +0000 (20:13 +0200)]
tests: report coverage status for unittests

This commit adds pytest-cov usage in unittests

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agoceph_pool: add tests
Guillaume Abrioux [Tue, 12 May 2020 12:39:20 +0000 (14:39 +0200)]
ceph_pool: add tests

Add unit tests for ceph_pool module

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agoceph_pool: support setting application at pool creation
Guillaume Abrioux [Tue, 12 May 2020 12:33:36 +0000 (14:33 +0200)]
ceph_pool: support setting application at pool creation

This commit adds the required changes in order to support
setting application pool at initial pool creation.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agoceph_pool: refact exec_commands()
Guillaume Abrioux [Tue, 12 May 2020 11:54:29 +0000 (13:54 +0200)]
ceph_pool: refact exec_commands()

We never multiple ceph command at a time, so there's no need to have this design.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agotests: update pools definitions
Guillaume Abrioux [Wed, 29 Apr 2020 23:23:20 +0000 (01:23 +0200)]
tests: update pools definitions

setting attributes with empty string is a bad user input.
Also, removing `rule_name` attribute when creating a code erasure pool.
(this rule isnt intended for code erasure pool type).

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agocommon: introduce ceph_pool module calls
Guillaume Abrioux [Tue, 28 Apr 2020 16:08:59 +0000 (18:08 +0200)]
common: introduce ceph_pool module calls

This commits calls the `ceph_pool` module for creating ceph pools
everywhere it's needed in the playbook.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agolibrary: add ceph_pool module
Guillaume Abrioux [Sat, 4 Apr 2020 01:44:05 +0000 (03:44 +0200)]
library: add ceph_pool module

This commit adds a new module `ceph_pool`

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agocommon: fix target_size_ratio task enablement
Guillaume Abrioux [Thu, 14 May 2020 09:00:12 +0000 (11:00 +0200)]
common: fix target_size_ratio task enablement

The condition on this task is wrong, we have to check whether
`target_size_ratio` is set in the pool definition instead.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agofacts: always set ceph_run_cmd and ceph_admin_command
Guillaume Abrioux [Thu, 14 May 2020 09:06:41 +0000 (11:06 +0200)]
facts: always set ceph_run_cmd and ceph_admin_command

always set these facts on monitor nodes whatever we run with `--limit`.
Otherwise, playbook will fail when using `--limit` on nodes where these
facts are used on a delegated task to monitor.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
5 years agotests/library: parametrize ceph_volume objecstore
Dimitri Savineau [Tue, 31 Mar 2020 20:51:55 +0000 (16:51 -0400)]
tests/library: parametrize ceph_volume objecstore

This adds the objectstore testing for both filestore and bluestore on
the ceph_volume module.

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