]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/log
ceph-ansible.git
6 years agoimprove coding style
Rishabh Dave [Mon, 1 Apr 2019 15:46:15 +0000 (21:16 +0530)]
improve coding style

Keywords requiring only one item shouldn't express it by creating a
list with single item.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
6 years agovalidate: fix notario error
Guillaume Abrioux [Tue, 23 Apr 2019 13:19:26 +0000 (15:19 +0200)]
validate: fix notario error

Typical error:

```
AttributeError: 'Invalid' object has no attribute 'message'
```

As of python 2.6, `BaseException.message` has been deprecated.
When using python3, it fails because it has been removed.

Let's use `str(error)` instead so we don't hit this error when using
python3.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agoAllow CephFS pool to be created with specific rule_name, erasure_profile just like...
Radu Toader [Thu, 18 Apr 2019 19:12:55 +0000 (22:12 +0300)]
Allow CephFS pool to be created with specific rule_name, erasure_profile just like rbd pools

Signed-off-by: Radu Toader <radu.m.toader@gmail.com>
6 years agoceph-container-common: modify requirement flow
Dimitri Savineau [Tue, 16 Apr 2019 13:33:02 +0000 (09:33 -0400)]
ceph-container-common: modify requirement flow

Until now it was not possible to install a specific container package
because it was somehow hardcoded.
This patch allows to override the container package name (docker.io
vs docker-ce) and refacts the package installation. This could be
achieve via the container_package_name variable.
Instead of using one task per distribution we can set the package and
service name in vars. This allows to have a unified package task.
Also refactorize the debian_prerequisites tasks because the content
was outdated.

https://docs.docker.com/install/linux/docker-ce/debian/
https://docs.docker.com/install/linux/docker-ce/ubuntu/

Resolves: #3609

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
6 years agodoc: update index.rst with current information for stable-4.0
Florian Haas [Thu, 18 Apr 2019 13:59:11 +0000 (15:59 +0200)]
doc: update index.rst with current information for stable-4.0

With the stable-4.0 branch nearing release, update
docs/source/index.rst with current information about which Ceph
releases are supported, and which Ansible versions are required, for
each branch.

Signed-off-by: Florian Haas <florian@citynetwork.eu>
6 years agomds: remove legacy task
Guillaume Abrioux [Thu, 18 Apr 2019 08:44:41 +0000 (10:44 +0200)]
mds: remove legacy task

this task has nothing to do in stable-4.0 and after.
Let's remove it since stable-4.0 and after aren't intended to deploy
luminous.

Closes: #3873
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agorgw: add cpuset support
Kyle Bader [Thu, 21 Mar 2019 18:54:34 +0000 (11:54 -0700)]
rgw: add cpuset support

1/ The OSD already supports cpuset to be used for containerized deployments
through the use of the ceph_osd_docker_cpuset_cpus variable. This adds similar
support to the RGW service for containerized deployments by setting a new
variable named ceph_rgw_docker_cpuset_cpus. Like the OSD, there are times where
using distinct cores has advantages over using the CFS in kernel scheduler.

ceph_rgw_docker_cpuset_cpus accepts a comma delimited set of CPU ids

2/ Add support for specifying --cpuset-mem variable to restrict the cgroup's memory
allocations to a particular numa node, which should typically correspond with
the cpu ids of that numa node that were provided with --cpuset-cpus. To ensure
the correct cpu ids are used one can run `numactl --hardware`  to list the nodes
and which cpu ids correspond to each.

Signed-off-by: Kyle Bader <kbader@redhat.com>
Co-authored-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agoceph-mgr: Add extra module packages
Dimitri Savineau [Mon, 15 Apr 2019 16:15:49 +0000 (12:15 -0400)]
ceph-mgr: Add extra module packages

Since Nautilus there's mgr extra modules not present in ceph-mgr
package but in dedicated packages.

Resolves: #3860

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
6 years agoupdate: ensure tasks are executed on an upgraded mon
Guillaume Abrioux [Wed, 17 Apr 2019 12:02:06 +0000 (14:02 +0200)]
update: ensure tasks are executed on an upgraded mon

These tasks must be run from a monitor which is upgraded otherwise it
might fail.
See: https://tracker.ceph.com/issues/39355

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agoupdate: ensure ceph command returns 0
Guillaume Abrioux [Wed, 17 Apr 2019 11:57:29 +0000 (13:57 +0200)]
update: ensure ceph command returns 0

these commands could return something else than 0.
Let's ensure all retries have been done before actually failing.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agoupdate: set osd flags before upgrading any mon
Guillaume Abrioux [Wed, 17 Apr 2019 06:47:25 +0000 (08:47 +0200)]
update: set osd flags before upgrading any mon

Typical error:

```
failed: [mon0 -> mon2] (item=noout) => changed=true
  cmd:
  - ceph
  - --cluster
  - ceph
  - osd
  - set
  - noout
  delta: '0:00:00.293756'
  end: '2019-04-17 06:31:57.552386'
  item: noout
  msg: non-zero return code
  rc: 1
  start: '2019-04-17 06:31:57.258630'
  stderr: |-
    Traceback (most recent call last):
      File "/bin/ceph", line 1222, in <module>
        retval = main()
      File "/bin/ceph", line 1146, in main
        sigdict = parse_json_funcsigs(outbuf.decode('utf-8'), 'cli')
      File "/usr/lib/python2.7/site-packages/ceph_argparse.py", line 788, in parse_json_funcsigs
        cmd['sig'] = parse_funcsig(cmd['sig'])
      File "/usr/lib/python2.7/site-packages/ceph_argparse.py", line 728, in parse_funcsig
        raise JsonFormat(s)
    ceph_argparse.JsonFormat: unknown type CephBool
  stderr_lines:
  - 'Traceback (most recent call last):'
  - '  File "/bin/ceph", line 1222, in <module>'
  - '    retval = main()'
  - '  File "/bin/ceph", line 1146, in main'
  - '    sigdict = parse_json_funcsigs(outbuf.decode(''utf-8''), ''cli'')'
  - '  File "/usr/lib/python2.7/site-packages/ceph_argparse.py", line 788, in parse_json_funcsigs'
  - '    cmd[''sig''] = parse_funcsig(cmd[''sig''])'
  - '  File "/usr/lib/python2.7/site-packages/ceph_argparse.py", line 728, in parse_funcsig'
  - '    raise JsonFormat(s)'
  - 'ceph_argparse.JsonFormat: unknown type CephBool'
  stdout: ''
  stdout_lines: <omitted>
```

Having mixed versions of monitors seems to cause this error.
Moving these tasks before any monitor gets upgraded seems to be enough
to get around this issue.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agoupdate: refact msgr2 migration
Guillaume Abrioux [Tue, 16 Apr 2019 08:31:44 +0000 (10:31 +0200)]
update: refact msgr2 migration

this commit refact the msgr2 protocol introduction.

If it's a fresh install, let's go with v2 only.
If we upgrade to nautilus, we should go with v2+v1 syntax to ensure
nothing breaks.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agorolling_update: ceph commands should use --cluster
Andrew Schoen [Thu, 28 Mar 2019 21:05:09 +0000 (16:05 -0500)]
rolling_update: ceph commands should use --cluster

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
6 years agorolling_update: set num_osds to the number of running osds
Andrew Schoen [Thu, 28 Mar 2019 19:34:48 +0000 (14:34 -0500)]
rolling_update: set num_osds to the number of running osds

We do this so that the ceph-config role can most accurately
report the number of osds for the generation of the ceph.conf
file.

We don't want to use ceph-volume to determine the number of
osds because in an upgrade to nautilus ceph-volume won't be able to
accurately count osds created by ceph-disk.

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
6 years agoceph-osd: do not run lvm batch tasks during update
Andrew Schoen [Thu, 28 Mar 2019 19:02:54 +0000 (14:02 -0500)]
ceph-osd: do not run lvm batch tasks during update

When performing a rolling update do not try to create
any new osds with `ceph-volume lvm batch`. This is troublesome
because when upgrading to nautilus the devices list might contain
devices that are currently being used by ceph-disk and have GPT
headers on them, which will cause ceph-volume to fail when
trying to use such a device. Any devices originally created
by ceph-disk will need to be removed from the devices list
before any new osds can be created.

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
6 years agotests: adds the migrate_ceph_disk_to_ceph_volume scenario
Andrew Schoen [Wed, 27 Mar 2019 19:36:51 +0000 (14:36 -0500)]
tests: adds the migrate_ceph_disk_to_ceph_volume scenario

This test deploys a luminous cluster with ceph-disk created osds
and then upgrades to nautilus and migrates those osds to ceph-volume.
The nodes are then rebooted and cluster state verified.

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
6 years agorolling_update: migrate ceph-disk osds to ceph-volume
Andrew Schoen [Tue, 19 Mar 2019 20:08:32 +0000 (15:08 -0500)]
rolling_update: migrate ceph-disk osds to ceph-volume

When upgrading to nautlius run ``ceph-volume simple scan`` and
``ceph-volume simple activate --all`` to migrate any running
ceph-disk osds to ceph-volume.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1656460
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
6 years agoceph-iscsi-gw: Remove library directory
Dimitri Savineau [Wed, 17 Apr 2019 15:37:03 +0000 (11:37 -0400)]
ceph-iscsi-gw: Remove library directory

The library directory that contain the custom ceph modules in present
in the ceph-ansible root directory.
All igw_* mocules are already present there so we don't need the one
present in roles/ceph-iscsi-gw/library.
Also remove the associated spec file.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
6 years agotest_osds: remove scenario leftover
Dimitri Savineau [Tue, 16 Apr 2019 20:23:51 +0000 (16:23 -0400)]
test_osds: remove scenario leftover

Since there's only only scenario available we don't need lvm_scenario
and no_lvm_scenario.
Also add missing assert for ceph-volume tests.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
6 years agoallow using ansible 2.8
Dimitri Savineau [Wed, 17 Apr 2019 14:22:59 +0000 (10:22 -0400)]
allow using ansible 2.8

Currently we only support ansible 2.7
We plan to use 2.8 when it will be release so we have to support both
2.7 and 2.8.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1700548
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
6 years agotests/functional/setup: change mount options
Dimitri Savineau [Fri, 12 Apr 2019 14:46:20 +0000 (10:46 -0400)]
tests/functional/setup: change mount options

In the CI jobs we can change the mount options of the main partition
to avoid extra operations on disk.
Adding jmespath to tests/requirements.txt due to the json_query
filter usage.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
6 years agotest_mons: test mon listening on port 3300
Dimitri Savineau [Tue, 16 Apr 2019 20:52:42 +0000 (16:52 -0400)]
test_mons: test mon listening on port 3300

Since nautilus and msgr2 the monitors also bind on port 3300 in
addition of 6789.
This patch updates test_mons to reflect that change.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
6 years agodefaults: refact package dependencies installation.
Guillaume Abrioux [Tue, 16 Apr 2019 07:58:52 +0000 (09:58 +0200)]
defaults: refact package dependencies installation.

Because 5c98e361df5241fbfa5bd0a2ae1317219b7e1244 could be seen as a non
backward compatible change this commit reverts it and bring back package
dependencies installation support.
Let's just modify the default value instead.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agodefaults: remove some package dependencies
Guillaume Abrioux [Mon, 15 Apr 2019 14:38:50 +0000 (16:38 +0200)]
defaults: remove some package dependencies

These packages aren't needed anymore.
They were needed for ceph-init-detect buti as of ceph-init-detect doesn't exist
anymore.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1683885
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agoallow adding a monitor to a deployed cluster
Rishabh Dave [Thu, 8 Nov 2018 13:47:51 +0000 (08:47 -0500)]
allow adding a monitor to a deployed cluster

Add a playbook that deploys a new monitor on a new node, adds that node
to the Ceph cluster and the monitor to the quorum and updates the ceph
configuration file on OSD nodes.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
6 years agocheck if mon daemon is installed before restarting it
Rishabh Dave [Sat, 6 Apr 2019 06:15:31 +0000 (02:15 -0400)]
check if mon daemon is installed before restarting it

Signed-off-by: Rishabh Dave <ridave@redhat.com>
6 years agomon: check if an initial monitor keyring already exists
Guillaume Abrioux [Wed, 30 Jan 2019 09:11:26 +0000 (10:11 +0100)]
mon: check if an initial monitor keyring already exists

When adding a new monitor, we must reuse the existing initial monitor
keyring. Otherwise, the new monitor will issue its 'mkfs' with a new
monitor keyring and it will result with a mismatch between them. The
new monitor will be unable to join the quorum in the end.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
Co-authored-by: Rishabh Dave <ridave@redhat.com>
6 years agopurge-cluster: remove python-ceph-argparse package
Dimitri Savineau [Fri, 12 Apr 2019 19:30:35 +0000 (15:30 -0400)]
purge-cluster: remove python-ceph-argparse package

When using purge-cluster playbook with nautilus, there's still the
python-ceph-argparse package installed on the host preventing to
reinstall a ceph cluster with a different version (like luminous or
mimic)

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
6 years agodocs: Update ceph.conf supported section
Dimitri Savineau [Thu, 11 Apr 2019 21:09:04 +0000 (17:09 -0400)]
docs: Update ceph.conf supported section

[rgw] isn't a valide section.
[client.rgw.{instance_name] should be used instead.

Resolves: #3841

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
6 years agoswitch-from-non-containerized: stop all osds
Dimitri Savineau [Thu, 11 Apr 2019 20:20:41 +0000 (16:20 -0400)]
switch-from-non-containerized: stop all osds

e6bfb84 introduced a regression in the switch from non containerized
to container deployment.
We need to stop all previous OSDs services. We just don't need the
ceph-disk pattern in the regex.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
6 years agopurge: remove references to ceph-disk
Guillaume Abrioux [Thu, 11 Apr 2019 15:03:44 +0000 (17:03 +0200)]
purge: remove references to ceph-disk

as of stable-4.0, ceph-disk is no longer supported.
These tasks aren't needed anymore.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agoshrink-osd: remove legacy playbook
Guillaume Abrioux [Thu, 11 Apr 2019 15:01:39 +0000 (17:01 +0200)]
shrink-osd: remove legacy playbook

as of stable-4.0, ceph-disk is no longer supported.
Let's remove this legacy version of the playbook.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agoswitch_to_containers: remove ceph-disk references
Guillaume Abrioux [Thu, 11 Apr 2019 15:00:58 +0000 (17:00 +0200)]
switch_to_containers: remove ceph-disk references

as of stable-4.0, ceph-disk is no longer supported.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agoosd: remove legacy file
Guillaume Abrioux [Thu, 11 Apr 2019 14:51:03 +0000 (16:51 +0200)]
osd: remove legacy file

this file is not used anymore, let's remove it.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agotests: pass osd_scenario value to lvm_setup.yml
Guillaume Abrioux [Thu, 11 Apr 2019 15:18:02 +0000 (17:18 +0200)]
tests: pass osd_scenario value to lvm_setup.yml

we must pass the value of osd_scenario from the stable-3.2 branch which
is used for the initial deployment.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agotests: remove test_journal_collocation.py in OSD testing
Guillaume Abrioux [Thu, 11 Apr 2019 12:57:56 +0000 (14:57 +0200)]
tests: remove test_journal_collocation.py in OSD testing

this test is related to ceph-disk which is dropped as of stable-4.0

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agoresync sample file
Guillaume Abrioux [Thu, 11 Apr 2019 08:13:17 +0000 (10:13 +0200)]
resync sample file

d17b1b48b6 introduced a change that hasn't been reported in sample files

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agoosd: remove ceph-disk scenarios files
Guillaume Abrioux [Thu, 11 Apr 2019 08:09:31 +0000 (10:09 +0200)]
osd: remove ceph-disk scenarios files

these files aren't needed anymore since we only use lvm scenario.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agoosd: remove dedicated_devices variable
Guillaume Abrioux [Thu, 11 Apr 2019 08:08:22 +0000 (10:08 +0200)]
osd: remove dedicated_devices variable

This variable was related to ceph-disk scenarios.
Since we are entirely dropping ceph-disk support as of stable-4.0, let's
remove this variable.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agoosd: remove variable osd_scenario
Guillaume Abrioux [Thu, 11 Apr 2019 08:01:15 +0000 (10:01 +0200)]
osd: remove variable osd_scenario

As of stable-4.0, the only valid scenario is `lvm`.
Thus, this makes this variable useless.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agoosd: remove legacy file
Guillaume Abrioux [Wed, 10 Apr 2019 11:33:57 +0000 (13:33 +0200)]
osd: remove legacy file

ceph_disk_cli_options_facts.yml is not used anymore, let's remove it.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agovalidate: only check device when they are devices
Sébastien Han [Fri, 12 Oct 2018 16:32:40 +0000 (18:32 +0200)]
validate: only check device when they are devices

We only validate the devices that are passed if there is a list of
devices to validate.

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agoplugin: validate.py do not check osd_scenario
Sébastien Han [Thu, 11 Oct 2018 16:01:10 +0000 (18:01 +0200)]
plugin: validate.py do not check osd_scenario

osd_scenario now defaults to lvm and should not be changed. So we don't
need to test it.

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agoplugin: validate lint
Sébastien Han [Thu, 11 Oct 2018 15:59:31 +0000 (17:59 +0200)]
plugin: validate lint

Make python linter happy.

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agodoc: update osd scenario
Sébastien Han [Wed, 10 Oct 2018 19:38:27 +0000 (15:38 -0400)]
doc: update osd scenario

This commits adds documentation for the lvm scenario and the deprecation
of collocated and non-collocated scenario.

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agoosd: default osd_scenario to lvm
Sébastien Han [Wed, 10 Oct 2018 19:17:38 +0000 (15:17 -0400)]
osd: default osd_scenario to lvm

osd_scenario has become obsolete and defaults to lvm. With lvm there is
no such things has collocated and non-collocated.

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agovalidate: print a message for old scenarios
Sébastien Han [Wed, 10 Oct 2018 19:16:43 +0000 (15:16 -0400)]
validate: print a message for old scenarios

ceph-disk is not supported anymore, so all the newly created OSDs will
be configured using ceph-volume.

Signed-off-by: Sébastien Han <seb@redhat.com>
6 years agoosd: remove ceph-disk support
Sébastien Han [Tue, 2 Oct 2018 21:54:57 +0000 (23:54 +0200)]
osd: remove ceph-disk support

We don't support the preparation of OSD with ceph-disk. ceph-volume is
only supported. However, the start operation of OSD is still supported.
So let's say you change a config option, the handlers will be able to
restart all the OSDs via their respective systemd unit files.

Signed-off-by: Sébastien Han <seb@redhat.com>
Co-authored-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agotests: Add debug to ceph-override.json
Dimitri Savineau [Tue, 9 Apr 2019 16:20:35 +0000 (12:20 -0400)]
tests: Add debug to ceph-override.json

It's usefull to have logs in debug mode enabled in order to have
more information for developpers.
Also reindent to json file.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
6 years agotests/functional: use ceph-override.json symlink
Dimitri Savineau [Tue, 9 Apr 2019 16:18:43 +0000 (12:18 -0400)]
tests/functional: use ceph-override.json symlink

We don't need to have multiple ceph-override.json copies. We
currently already have symlink to all_daemons/ceph-override.json so
we can do it for all scenarios.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
6 years agoceph-mds: Set application pool to cephfs
Dimitri Savineau [Thu, 4 Apr 2019 13:33:05 +0000 (09:33 -0400)]
ceph-mds: Set application pool to cephfs

We don't need to use the cephfs variable for the application pool
name because it's always cephfs.
If the cephfs variable is set to something else than the default
value it will break the appplication pool task.

Resolves: #3790

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
6 years agoupdate: fix undefined error when no mgr group is declared
Guillaume Abrioux [Thu, 11 Apr 2019 07:16:28 +0000 (09:16 +0200)]
update: fix undefined error when no mgr group is declared

if mgr group isn't defined in inventory, that task will fail with
undefined error.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agoosds: allow passing devices by path
Guillaume Abrioux [Wed, 10 Apr 2019 15:16:21 +0000 (17:16 +0200)]
osds: allow passing devices by path

ceph-volume didn't work when the devices where passed by path.
Since it now support it, let's allow this feature in ceph-ansible

Closes: #3812
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agomon: remove useless delegate_to
Guillaume Abrioux [Tue, 9 Apr 2019 15:38:01 +0000 (17:38 +0200)]
mon: remove useless delegate_to

Let's use a condition to run this task only on the first mon.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agorgw: change default frontend on nautilus
Dimitri Savineau [Tue, 26 Feb 2019 14:16:37 +0000 (09:16 -0500)]
rgw: change default frontend on nautilus

As discussed in ceph/ceph#26599, beast is now the default frontend
for rados gateway with nautilus release.
Add rgw_thread_pool_size variable with 512 as default value and keep
backward compatibility with num_threads option when using civetweb.
Update radosgw_civetweb_num_threads to reflect rgw_thread_pool_size
change.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
6 years agocontainer-common: Enable docker on boot for ubuntu
Dimitri Savineau [Mon, 1 Apr 2019 16:12:52 +0000 (12:12 -0400)]
container-common: Enable docker on boot for ubuntu

docker daemon is automatically started during package installation
but the service isn't enabled on boot.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
6 years agorolling_update: Remove ceph aliases
Dimitri Savineau [Fri, 15 Mar 2019 14:18:48 +0000 (10:18 -0400)]
rolling_update: Remove ceph aliases

ceph aliases have been introduced in stable-3.2 during the ceph
deployment. On master this has been removed but we don't handle
this removal in the upgrade from stable-3.2 to master via the
rolling_update playbook.
Also remove the task from purge-docker-cluster missing from
d9e7835

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
6 years agoUCA: Uncomment UCA variables in defaults, fix consequent breakage
Matthew Vernon [Wed, 27 Mar 2019 13:34:47 +0000 (13:34 +0000)]
UCA: Uncomment UCA variables in defaults, fix consequent breakage

The Ubuntu Cloud Archive-related (UCA) defaults in
roles/ceph-defaults/defaults/main.yml were commented out, which means
if you set `ceph_repository` to "uca", you get undefined variable
errors, e.g.

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

The error appears to have been in '/nfs/users/nfs_m/mv3/software/ceph-ansible/roles/ceph-common/tasks/installs/debian_uca_repository.yml': line 6, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: add ubuntu cloud archive repository
  ^ here

```

Unfortunately, uncommenting these results in some other breakage,
because further roles were written that use the fact of
`ceph_stable_release_uca` being defined as a proxy for "we're using
UCA", so try and install packages from the bionic-updates/queens
release, for example, which doesn't work. So there are a few `apt` tasks
that need modifying to not use `ceph_stable_release_uca` unless
`ceph_origin` is `repository` and `ceph_repository` is `uca`.

Closes: #3475
Signed-off-by: Matthew Vernon <mv3@sanger.ac.uk>
6 years agoadd_mdss: change number of processes for testing to 8
Rishabh Dave [Tue, 9 Apr 2019 09:15:57 +0000 (14:45 +0530)]
add_mdss: change number of processes for testing to 8

Run tests with 8 processes/cores since other scenarios do the same.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
6 years agotests: update ceph_release_num in conftest.py
Guillaume Abrioux [Tue, 9 Apr 2019 07:49:03 +0000 (09:49 +0200)]
tests: update ceph_release_num in conftest.py

add nautilus and octopus releases.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agoceph-facts: use last ipv6 address for mon/rgw
Dimitri Savineau [Fri, 5 Apr 2019 19:04:45 +0000 (15:04 -0400)]
ceph-facts: use last ipv6 address for mon/rgw

When using monitor_address_block or radosgw_address_block variables
to configure the mon/rgw address we're getting the first ip address
from the ansible facts present in that cidr.
When there's VIP on that network the first filter could return the
wrong value.
This seems to affect only IPv6 setup because the VIP addresses are
added to the ansible facts at the beginning of the list. This is the
opposite (at the end) when using IPv4.
This causes the mon/rgw processes to bind on the VIP address.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1680155
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
6 years agoceph-rgw: Fix bad paths which depend on the clustername
François Lafont [Sat, 6 Apr 2019 09:44:03 +0000 (11:44 +0200)]
ceph-rgw: Fix bad paths which depend on the clustername

The path of the RGW environment file (in the /var/lib/ceph/radosgw/
directory) depends on the Ceph clustername. It was not taken into
account in the Ansible role `ceph-rgw`.

Signed-off-by: flaf <francois.lafont.1978@gmail.com>
6 years agomgr: manage mgr modules when mgr and mon are collocated
Guillaume Abrioux [Mon, 8 Apr 2019 11:56:01 +0000 (13:56 +0200)]
mgr: manage mgr modules when mgr and mon are collocated

When mgrs are implicitly collocated on monitors (no mgrs in mgrs group).
That include was skipped because of this condition :

`inventory_hostname == groups[mgr_group_name][0]`

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agomgr: wait for all mgr to be available
Guillaume Abrioux [Mon, 8 Apr 2019 11:34:59 +0000 (13:34 +0200)]
mgr: wait for all mgr to be available

before managing mgr modules, we must ensure all mgr are available
otherwise we can hit failure like following:

```
stdout:Error ENOENT: all mgr daemons do not support module 'restful', pass --force to force enablement
```

It happens because all mgr are not yet available when trying to manage
with mgr modules.

Closes: #3100
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agotests: run switch_to_containers against nautilus
Guillaume Abrioux [Thu, 4 Apr 2019 12:41:46 +0000 (14:41 +0200)]
tests: run switch_to_containers against nautilus

even on master, force the release to be nautilus.
this scenarios is failing because at multiple times this scenario is
actually downgrading the ceph version.
It might happen that the latest-master image is older than what was
deployed in the first step of the scenario (the RPM deployment).

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

6 years agoallow adding a MDS to already deployed cluster
Rishabh Dave [Tue, 12 Feb 2019 03:15:44 +0000 (08:45 +0530)]
allow adding a MDS to already deployed cluster

Add a tox scenario that adds an new MDS node as a part of already
deployed Ceph cluster and deploys MDS there.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
6 years agoadd-osds: don't hardcode group names
Rishabh Dave [Thu, 28 Mar 2019 07:45:53 +0000 (13:15 +0530)]
add-osds: don't hardcode group names

Instead of hardcoding group names, import ceph-defaults earlier. Also,
rectify a minor mistake in vagrant_varaibles.yml for containerized
version of add_osds.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
6 years agorgw multisite: add more than 1 rgw to the master or secondary zone
Ali Maredia [Thu, 31 Jan 2019 20:43:21 +0000 (20:43 +0000)]
rgw multisite: add more than 1 rgw to the master or secondary zone

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1664869
Signed-off-by: Ali Maredia <amaredia@redhat.com>
6 years agoradosgw: Raise cpu limit to 8
Dimitri Savineau [Tue, 2 Apr 2019 14:39:42 +0000 (10:39 -0400)]
radosgw: Raise cpu limit to 8

In containerized deployment the default radosgw quota is too low
for production environment.
This is causing performance degradation compared to bare-metal.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1680171
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
6 years agotests: add back testinfra testing
Guillaume Abrioux [Thu, 4 Apr 2019 02:09:12 +0000 (04:09 +0200)]
tests: add back testinfra testing

136bfe0 removed testinfra testing on all scenario excepted all_daemons

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agotests: pin pytest-xdist to 1.27.0
Guillaume Abrioux [Thu, 4 Apr 2019 02:01:01 +0000 (04:01 +0200)]
tests: pin pytest-xdist to 1.27.0

looks like newer version of pytest-xdist requires pytest>=4.4.0

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agoCheck ceph_health_raw.stdout value as string during mon bootstrap
fpantano [Wed, 3 Apr 2019 16:35:10 +0000 (18:35 +0200)]
Check ceph_health_raw.stdout value as string during mon bootstrap

According to rdo testing https://review.rdoproject.org/r/#/c/18721
a check on the output of the ceph_health value is added to
allow the playbook to make several attempts (according to the
retry/delay variables) when waiting the cluster quorum or
when the container bootstrap is not ended.
It avoids the failure of the command execution when it doesn't
receive a valid json object to decode (because cluster is too
slow to boostrap compared to ceph-ansible task execution).

Signed-off-by: fpantano <fpantano@redhat.com>
6 years agotests: retry to fire up VMs on vagrant failure
Guillaume Abrioux [Tue, 2 Apr 2019 12:53:19 +0000 (14:53 +0200)]
tests: retry to fire up VMs on vagrant failure

Add a script to retry several times to fire up VMs to avoid vagrant
failures.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
Co-authored-by: Andrew Schoen <aschoen@redhat.com>
6 years agopurge: fix lvm-batch purge osd
Guillaume Abrioux [Tue, 2 Apr 2019 08:43:01 +0000 (10:43 +0200)]
purge: fix lvm-batch purge osd

`lvm_volumes` and/or `devices` variable(s) can be undefined depending on
the scenario chosen.

These tasks should be run only if these variable are defined, otherwise
it ends up with undefined variable errors.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1653307
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agoceph-volume: Add PYTHONIOENCODING env variable
Dimitri Savineau [Mon, 1 Apr 2019 20:02:28 +0000 (16:02 -0400)]
ceph-volume: Add PYTHONIOENCODING env variable

Since https://github.com/ceph/ceph/commit/77912c0 ceph-volume uses
stdout encoding based on LC_CTYPE and PYTHONIOENCODING environment
variables.
Thoses variables aren't set when using ansible.
Currently this commit breaks non containerized deployment on Ubuntu.

TASK [use ceph-volume to create bluestore osds] ********************
  cmd:
  - ceph-volume
  - --cluster
  - ceph
  - lvm
  - create
  - --bluestore
  - --data
  - /dev/sdb
  rc: 1
  stderr: |-
    Traceback (most recent call last):
    (...)
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in
    position 132: ordinal not in range(128)

Note that the task is failing on ansible side due to the stdout
decoding but the osd creation is successful.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
6 years agotests: test idempotency only on all_daemons job
Guillaume Abrioux [Mon, 1 Apr 2019 15:22:50 +0000 (17:22 +0200)]
tests: test idempotency only on all_daemons job

there's no need to test this on all scenarios.
testing idempotency on all_daemons should be enough and allow us to save
precious resources for the CI.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agomerge task blocks if their execution is based on same conditions
Rishabh Dave [Thu, 28 Mar 2019 08:47:26 +0000 (14:17 +0530)]
merge task blocks if their execution is based on same conditions

Signed-off-by: Rishabh Dave <ridave@redhat.com>
6 years ago"when" keyword should precede "block" keyword
Rishabh Dave [Thu, 28 Mar 2019 08:13:30 +0000 (13:43 +0530)]
"when" keyword should precede "block" keyword

Otherwise the reader is forced to search for "when" when blocks are too
long.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
6 years agomergify: Update with stable-4.0 branch
Dimitri Savineau [Thu, 28 Mar 2019 13:49:46 +0000 (09:49 -0400)]
mergify: Update with stable-4.0 branch

Add action to backport commits to stable-4.0.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
6 years agopurge-docker-cluster: Remove ceph-osd service
Dimitri Savineau [Wed, 20 Mar 2019 17:40:33 +0000 (13:40 -0400)]
purge-docker-cluster: Remove ceph-osd service

The systemd ceph-osd@.service file used for starting the ceph osd
containers is used in all osd_scenarios.
Currently purging a containerized deployment using the lvm scenario
didn't remove the ceph-osd systemd service.
If the next deployment is a non-containerized deployment, the OSDs
won't be online because the file is still present and override the
one from the package.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
6 years agotests: clean tox.ini
Guillaume Abrioux [Thu, 28 Mar 2019 08:32:32 +0000 (09:32 +0100)]
tests: clean tox.ini

update scenario has been moved to a dedicated tox ini file.
We shouldn't have any references to this scenario in the main tox ini
file.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agoremove all NBSPs on master branch v4.0.0rc1
Guillaume Abrioux [Tue, 5 Mar 2019 07:44:25 +0000 (08:44 +0100)]
remove all NBSPs on master branch

Similar to #3658

Since there's too many changes between master and stable branches let's
commit directly in each branches instead of trying to backport this
commit.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agocontainer: Add python3-docker on Ubuntu bionic
Dimitri Savineau [Wed, 27 Mar 2019 18:11:20 +0000 (14:11 -0400)]
container: Add python3-docker on Ubuntu bionic

When installing python-minimal on Ubuntu bionic, this will add the
/usr/bin/python symlink to the default python interpreter.
On bionic, this isn't python2 but python3.

$ /usr/bin/python --version
Python 3.6.7

The python docker library is only installed for python2 which causes
issues when running the purge-docker-cluster playbook. This playbook
uses the ansible docker modules and requires to have python bindings
installed on the remote host.
Without the bindings we can see python error reported by the docker
module.

msg: Failed to import docker or docker-py - No module named 'docker'.
Try `pip install docker` or `pip install docker-py` (Python 2.6)

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
6 years agotests/functional: Use the ansible reboot module
Dimitri Savineau [Tue, 26 Mar 2019 18:57:54 +0000 (14:57 -0400)]
tests/functional: Use the ansible reboot module

Ansible 2.7 introduces the reboot module so we don't need to use the
shell/reboot + wait_for tasks.

https://docs.ansible.com/ansible/latest/modules/reboot_module.html

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
6 years agotox: Fix container purge jobs
Dimitri Savineau [Tue, 26 Mar 2019 19:22:41 +0000 (15:22 -0400)]
tox: Fix container purge jobs

On containerized CI jobs the playbook executed is purge-cluster.yml
but it should be set to purge-docker-cluster.yml

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
6 years agorolling_update: Update systemd unit regex for nvme
Dimitri Savineau [Tue, 12 Mar 2019 15:22:03 +0000 (11:22 -0400)]
rolling_update: Update systemd unit regex for nvme

The systemd unit regex doesn't handle nvme devices (/dev/nvmeXn1).

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1687828
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
6 years agotravis: Remove galaxy lint rules repository
Dimitri Savineau [Fri, 22 Mar 2019 19:51:35 +0000 (15:51 -0400)]
travis: Remove galaxy lint rules repository

The galaxy-lint-rules github repository isn't used anymore and has
been archived.
All the rules are now part of the ansible-lint project.

https://github.com/ansible/galaxy-lint-rules
https://github.com/ansible/ansible-lint

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
6 years agoAdd uca to ceph_repository choices validation
Dimitri Savineau [Fri, 22 Mar 2019 19:03:15 +0000 (15:03 -0400)]
Add uca to ceph_repository choices validation

Ubuntu cloud archive is configurable via ceph_repository variable but
the uca choice isn't accepted.
This commit fixes this issue and also validates the associated uca
repository variables.

Resolves: #3739

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
6 years agorgw: fix a typo
Guillaume Abrioux [Mon, 25 Mar 2019 14:10:23 +0000 (15:10 +0100)]
rgw: fix a typo

ee2d52d33df2a311cdf0ff62abd353fccb3affbc introduced a typo.
This commit fixes it.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agorgw: cleanup legacy task
Guillaume Abrioux [Mon, 25 Mar 2019 14:08:22 +0000 (15:08 +0100)]
rgw: cleanup legacy task

this task was here for backward compatibility.
It's time to remove it in the next release.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agorgw: add a retry on pool related tasks
Guillaume Abrioux [Mon, 25 Mar 2019 14:04:50 +0000 (15:04 +0100)]
rgw: add a retry on pool related tasks

sometimes those tasks might fail because of a timeout.
I've been facing this several times in the CI, adding this retry might
help and won't hurt in any case.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agoupdate: followup on edfdc49
Guillaume Abrioux [Mon, 25 Mar 2019 13:50:09 +0000 (14:50 +0100)]
update: followup on edfdc49

all rgw instances should be stopped according to the multiple rgw
instances support added in rolling_update.yml

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agoupdate: add containerized deployment upgrade support (L->N)
Guillaume Abrioux [Mon, 25 Mar 2019 08:48:48 +0000 (09:48 +0100)]
update: add containerized deployment upgrade support (L->N)

Add a couple of fixes to allow containerized deployments upgrade support
to upgrade from luminous/mimic to nautilus.

- pass CEPH_CONTAINER_IMAGE and CEPH_CONTAINER_BINARY environment
variable to the ceph_key module,
- fix the docker exec command in 'waiting for the containerized monitor
to join the quorum' task according to the `delegate_to` parameter,
- override `docker_exec_cmd` in `ceph-facts` with `mon_host` when
rolling_update is `True`,
- do not run unnecessarily `create_mds_filesystems.yml` when performing an
upgrade.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agoupdate: add missing hosts in facts gathering
Guillaume Abrioux [Thu, 21 Mar 2019 12:28:33 +0000 (13:28 +0100)]
update: add missing hosts in facts gathering

iscsigws were missing.
The 'complete upgrade' couldn't complete because rolling_update was set
to False for iscsigw nodes.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agoupdate: remove rbdmirror legacy task
Guillaume Abrioux [Thu, 21 Mar 2019 08:00:02 +0000 (09:00 +0100)]
update: remove rbdmirror legacy task

This task is no longer needed for next release.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agoupdate: show all daemons version at the end
Guillaume Abrioux [Wed, 20 Mar 2019 18:11:32 +0000 (19:11 +0100)]
update: show all daemons version at the end

Let's display all daemons version at the end of the playbook.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agofacts: retrieve fsid during rolling_update playbook
Guillaume Abrioux [Wed, 20 Mar 2019 17:34:47 +0000 (18:34 +0100)]
facts: retrieve fsid during rolling_update playbook

otherwise it generates a new cluster fsid and makes the upgrade failing

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agomon: fetch initial keyring even when running rolling_update
Guillaume Abrioux [Wed, 20 Mar 2019 16:53:22 +0000 (17:53 +0100)]
mon: fetch initial keyring even when running rolling_update

otherwise, the task to copy mgr keyring fails during the rolling_update.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agotests: split tox configuration into multiple pieces
Guillaume Abrioux [Wed, 20 Mar 2019 12:42:00 +0000 (13:42 +0100)]
tests: split tox configuration into multiple pieces

This file is becoming too big, let's isolate the update related code in
a dedicated tox configuration file.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
6 years agoupdate: enable new nautilus-only functionality
Guillaume Abrioux [Wed, 20 Mar 2019 12:25:26 +0000 (13:25 +0100)]
update: enable new nautilus-only functionality

once the cluster is upgraded to nautilus, we can complete the process by
disallowing pre-nautilus OSDs and enabling all new nautilus-only functionality

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