Commit Graph

62 Commits (6c742376fd2b4ac4cab3430430136a5bd5a1145d)

Author SHA1 Message Date
Guillaume Abrioux 70401f955b container: trigger handlers on systemd file change
When a systemd unit file is changed we should trigger handlers to
restart the services.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2018-01-10 16:46:42 +01:00
Guillaume Abrioux 591d77220e osd: always run disk_list test
there is no need to have a condition on this task, this test should be
always run since the result will be interpreted later.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2017-11-09 11:51:16 +01:00
Sébastien Han d4ed9a2064 osd: enhance backward compatibility
During the initial implementation of this 'old' thing we were falling
into this issue without noticing
https://github.com/moby/moby/issues/30341 and where blindly using --rm,
now this is fixed the prepare container disappears and thus activation
fail.
I'm fixing this for old jewel images.

Also this fixes the machine reboot case where the docker logs are
purgend. In the old scenario, we now store the log locally in the same
directory as the ceph-osd-run.sh script.

Signed-off-by: Sébastien Han <seb@redhat.com>
2017-11-03 11:15:23 +01:00
Sébastien Han 968ef04324 osd: bring backward compatibility with old Jewel images
There was a huge resync from luminous to jewel in ceph-docker:
https://github.com/ceph/ceph-docker/pull/797

This change brought a new handy function to discover partitions tight to
an OSD. This function doesn't exist in the old image so the
ceph-osd-run.sh script breaks when trying to deploy Jewel OSD with that
old Jewel image version.

Signed-off-by: Sébastien Han <seb@redhat.com>
2017-10-20 16:26:41 +02:00
Sébastien Han 3bd341f6c0 osd: container use id instead of dev name
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1494127
Signed-off-by: Sébastien Han <seb@redhat.com>
2017-10-03 14:44:00 +02:00
Guillaume Abrioux 466f6f35b7 Use systemd module instead of service.
Using systemd module allows us to do in one task what we did in three
tasks:

- enable unit file,
- issue a `daemon-reload`,
- start the service

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2017-09-29 14:54:00 +02:00
Sébastien Han d100b4e596 name includes and set_fact for clarity
When Ansible is not run with verbose options it's difficult to see which
include and/or set_fact does what. So adding a name for each clarifies.

Signed-off-by: Sébastien Han <seb@redhat.com>
2017-09-18 23:39:46 +02:00
Sébastien Han e0a264c7e9 osd: allow multi dedicated journals for containers
Fix: https://bugzilla.redhat.com/show_bug.cgi?id=1475820
Signed-off-by: Sébastien Han <seb@redhat.com>
2017-08-30 12:34:06 +02:00
Sébastien Han d2320e412e osd: docker, refactor ceph-osd-run.sh.j2
Easier to read and enhance.

Signed-off-by: Sébastien Han <seb@redhat.com>
2017-07-06 15:49:14 +02:00
Guillaume Abrioux ddfe019342 Refact code
`ceph-docker-common`:
  At the moment there is a lot of duplicated tasks in each
  `./roles/ceph-<role>/tasks/docker/main.yml` that could be refactored in
  `./roles/ceph-docker-common/tasks/main.yml`.

`*_containerized_deployment` variables:
  All `*_containerized_deployment` have been refactored to a single
  variable `containerized_deployment`

duplicate `cephx` variables in `group_vars/* have been removed.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2017-05-24 15:55:41 +02:00
Sébastien Han 6bdadc4363 Revert "docker: Retry OSD disk prepare to workaround race condition" 2017-05-18 16:03:16 +02:00
Guillaume Abrioux 1e7010de7f Docker: rm container before retry of ceph osd prepare
In addition to `196fa7e` this commit check if a container has been
already launched and delete it before retrying the ceph osd prepare
process.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2017-05-17 10:10:49 +02:00
David Galloway 196fa7ef39 docker: Retry osd disk prep to workaround race condition
Fixes: https://github.com/ceph/ceph-ansible/issues/1495

Signed-off-by: David Galloway <dgallowa@redhat.com>
2017-05-11 16:19:11 -04:00
Tobias Florek 931027e6f7 harmonize docker names
Created containers now are named more or less in the form of

    <ansible role>-<ansible_hostname>
2017-02-23 09:15:05 +01:00
Sébastien Han b91d227b99 docker: make ceph docker osd script path
Since distro will not allow /usr/share to be writable (e.g: atomic) so
we let the operator decide where to put that script.

Signed-off-by: Sébastien Han <seb@redhat.com>
2017-02-21 15:56:09 -05:00
Sébastien Han 73cf0378c2 docker: osd, do not use priviledged container anymore
Oh yeah! This patch adds more fine grained control on how we run the
activation osd container. We now use --device to give a read, write and
mknodaccess to a specific device to be consumed by Ceph. We also use
SYS_ADMIN cap to allow mount operations, ceph-disk needs to temporary
mount the osd data directory during the activation sequence.

This patch also enables the support of dedicated journal devices when
deploying ceph-docker with ceph-ansible.

Depends on https://github.com/ceph/ceph-docker/pull/478

Signed-off-by: Sébastien Han <seb@redhat.com>
2017-02-21 15:54:36 -05:00
Sébastien Han dd548c6034 docker: osd, do not skip on failure
If the systemd unit file can not be generated we should fail, same for
systemd enable and reload.

Signed-off-by: Sébastien Han <seb@redhat.com>
2017-02-21 15:54:36 -05:00
Sébastien Han c2f1dca823 docker: use a better method to pull images
We changed the way we declare image.
Prior to this patch we must have a "user/image:tag"
format, which is incompatible with non docker-hub registry where you
usually don't have a "user". On the docker hub a "user" is also
identified as a namespace, so for Ceph the user was "ceph".

Variables have been simplified with only:

* ceph_docker_image
* ceph_docker_image_tag

1. For docker hub images: ceph_docker_name: "ceph/daemon" will give
you the 'daemon' image of the 'ceph' user.

2. For non docker hub images: ceph_docker_name: "daemon" will simply
give you the "daemon" image.

Infrastructure playbooks have been modified as well.
The file group_vars/all.docker.yml.sample has been removed as well.
It is hard to maintain since we have to generate it manually. If
you want to configure specific variables for a specific daemon simply
edit group_vars/$DAEMON.yml

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1420207
Signed-off-by: Sébastien Han <seb@redhat.com>
2017-02-09 17:57:18 +01:00
Sébastien Han 40709c8336 docker: use systemd to manage container
Since we now only support systemd has an init system we can finally
treat containers as processes using systemd and this for all the
distros.

Signed-off-by: Sébastien Han <seb@redhat.com>
2017-02-01 17:12:46 +01:00
Andrew Schoen 0c55a35963 ceph-osd: use ceph_docker_registry when preparing OSDs
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
2017-01-16 11:39:13 -06:00
Sébastien Han 2d8ac4a586 docker: only use systemd to manage containers
Prior to this patch we had several ways to runs containers, we could use
ansible's docker module on some distro and on containers distros we were
using systemd. We strongly believe threating containers as services with
systemd is the right approach so this patch generalizes to all the
distros. These days most of the distros are running systemd so it's fair
assumption.

Signed-off-by: Sébastien Han <seb@redhat.com>
2016-12-16 19:37:05 +01:00
Sébastien Han ce7431a227 docker: add support for cluster name
We need to honour the cluster name that was chosen by ceph-ansible and
pass it to ceph-docker.

Signed-off-by: Sébastien Han <seb@redhat.com>
2016-12-16 14:31:21 +01:00
Daniel Marks ba0f16f485 Better --check compatibility for ceph-osd role
Carefully chosen "always_run: true" parameters for read-only tasks that
register variables. This enables --check runs (at least on deployed
clusters).
2016-11-27 15:00:10 +01:00
Sébastien Han a2fcd222d2 moving to ansible v2.2 compatibility
Signed-off-by: Sébastien Han <seb@redhat.com>
Co-Authored-By: Julien Francoz julien@francoz.net
2016-11-04 10:09:38 +01:00
Sébastien Han 708c43a04e docker: fix osd configuration
use the activation scenario instead of the full ceph_disk one, we
already have a task to prepare osds so we just need to activate the
device.

working for me using vagrant :)

Signed-off-by: Sébastien Han <seb@redhat.com>
2016-08-24 09:05:14 +02:00
Daniel Gryniewicz 2fd9bbbe09 NFS for FSAL_RGW
Add support for FSAL_RGW to the NFS gateway.  Both standard and
containerized versions are supported.
2016-08-12 11:49:16 -04:00
Ivan Font 8c67689d08 Add option to enable ntp
This fixes #845 for containerized deployments. We now also mount the
/etc/localtime volume in the containers in order to synchronize the host
timezone with the container timezone.

Signed-off-by: Ivan Font <ivan.font@redhat.com>
2016-08-08 10:16:48 -07:00
pprokop a11eb03aae Fixing typos 2016-07-13 10:25:05 +02:00
pprokop 69cce9c135 Removing --rm flag from prepare osd 2016-07-13 10:22:17 +02:00
pprokop 41386c7bde Adding missing tag 2016-07-13 10:22:17 +02:00
pprokop 09d104f297 Fixing typos 2016-07-13 10:22:17 +02:00
pprokop 26688d10dc Removing creating symbolic links and fixing systemctl enable not working on CoreOS and migrating form docker module to shell in prepare image 2016-07-13 10:22:15 +02:00
Ivan Font 6f5f6610a8 Support for docker image tags
Signed-off-by: Ivan Font <ivan.font@redhat.com>
2016-07-12 15:49:07 -07:00
Erik Hollensbe 6b218a36d9 ceph-osd: fix an item propagation error while partitioning disks
Signed-off-by: Erik Hollensbe <github@hollensbe.org>
2016-07-12 03:57:11 -07:00
Sébastien Han a83e5d6b10 remove withspaces
Signed-off-by: Sébastien Han <seb@redhat.com>
2016-07-07 16:17:49 +02:00
Leseb d9d1d7856e Merge pull request #812 from rootfs/fix
some fixes for container deployment
2016-06-09 15:33:32 +02:00
Huamin Chen 6b84f5475b fix containerized deployment on centos
Signed-off-by: Huamin Chen <hchen@redhat.com>
2016-06-03 15:24:00 +00:00
Sébastien Han c6232bed21 ceph-common: uniformize template path calls
In order to align all Ansible versions, we now use the full path for the
template. We rely on `role_path` variable. Now all the tasks using
the template module have a uniform syntax.

Might fix issue raised in #483

Signed-off-by: Sébastien Han <seb@redhat.com>
2016-06-02 18:19:03 +02:00
Huamin Chen a124078612 in containerized deployment, use the right interface name variable in mon; remove one line inline files
cleanup on docker osd tasks

Signed-off-by: Huamin Chen <hchen@redhat.com>
2016-05-25 18:17:37 +00:00
Sam Yaple 069c93a238 Unify formatting of when conditional
This is purely a refactor. Converts when 'and' conditionals into lists
rather than multiline strings. This does not work for nested
conditionals, but those can be formated with indents.

Moves one line when statements onto the same line as the when command
itself.

A small logic bug was found in ceph-osd/tasks/check_devices.yml which
which was also fixed.

Signed-off-by: Sam Yaple <sam@yaple.net>
2016-05-09 14:08:33 +00:00
Ivo Jimenez 216ab2d776 Mounts /run when executing osd container 2016-05-03 15:47:01 -07:00
Ivo Jimenez 9ac9103e0d bind-mounts /dev in osd containers
This is needed in order to make ceph-disk work
2016-04-25 11:45:23 -05:00
Huamin Chen 9d81f32538 set path to find mon and osd systemd unit file templates
Signed-off-by: Huamin Chen <hchen@redhat.com>
2016-04-14 21:57:27 +00:00
Sébastien Han 4b93fc9dbd ceph-osd: docker fix typo again...
Signed-off-by: Sébastien Han <seb@redhat.com>
2016-04-01 17:33:11 +02:00
Sébastien Han fbf36716c5 ceph-osd: docker start typo...
Signed-off-by: Sébastien Han <seb@redhat.com>
2016-04-01 17:31:34 +02:00
Sébastien Han 00819ab7b8 ceph-docker: osd fix container prep and start
We now check if the device has already been prepared, if we detect a
ceph partition we do not prepare the device.
Also fixed some issues while running on Atomic or CoreOS.

Signed-off-by: Sébastien Han <seb@redhat.com>
2016-04-01 15:40:19 +02:00
Sébastien Han df6c3f4f72 ceph-docker: fix permissions on directories
fixing the can't open /var/lib/ceph/bootstrap-osd/ceph.keyring: can't
open /var/lib/ceph/bootstrap-osd/ceph.keyring: (13) Permission denied

Signed-off-by: Sébastien Han <seb@redhat.com>
2016-04-01 14:43:33 +02:00
pprokop 604ea77ecc Changes due to review 2016-04-01 12:57:58 +02:00
pprokop 5705cc71a3 Changing when statements 2016-03-30 12:40:57 +02:00
pprokop d7d83273e7 Adding support for non atomic and non CoreOS machines for deploying containerized osds with kv backend 2016-03-30 12:22:15 +02:00