ceph::key : make shell verbose for clarity

So that the output contains the actual shell lines being run, otherwise
it is most difficult to figure out what went wrong and why.

Change-Id: I655ef1b87ecede02c5a76f04c9b3075456a622ab
Signed-off-by: Loic Dachary <loic@dachary.org>
ceph::key : add keyring and id key injection arguments

The id and keyring used when injecting a key do not necessarily match
the ceph default. The inject_as_id and inject_keyring arguments are
added to change them independently of each other.

The argument documentation is updated and the integration tests upgraded
to demonstrated the intended side effect.

Change-Id: I9b19a66558bc11e16da9fde4f11d23b850154186
Signed-off-by: Loic Dachary <loic@dachary.org>
ceph::key : add the cluster argument

So that ceph::key can be used on a cluster that is not named after the
default (ceph).

Change-Id: I7b7626ceb83ff387b4c8d100534dea637f91a798
Signed-off-by: Loic Dachary <loic@dachary.org>
ceph::key : fix cap_{mon,osd,mds} prototype to match the documentation

Set cap_{mon,osd,mds} to undef by default instead of '' and fix the
integration tests accordingly.

Change-Id: I520c3b4f1f983c8503fc7bac0a5bb05c90da0bbc
Signed-off-by: Loic Dachary <loic@dachary.org>
ceph::key : exec touch is redundant with file

Change-Id: Iec58d37324a1b8c79c02247ab1b3956332314789
Signed-off-by: Loic Dachary <loic@dachary.org>
ceph::key : update copyright notice

To reflect the latest contributions.

Change-Id: If21277baa0e7baa4534e7498cd38da9982023e77
Signed-off-by: Loic Dachary <loic@dachary.org>
ceph::key : remove redundant Exec blocks

They were probably introduced back when touch was used to create the
keyring file.

Change-Id: I059fd56b73896a7262ff21b5c0b43131150a053b
Signed-off-by: Loic Dachary <loic@dachary.org>
ceph::key : remove the client.admin keyring for tests

To avoid unintended side effects between integration tests.

Change-Id: I3f084244291d4608b9090ecaad915f5543430d1d
Signed-off-by: Loic Dachary <loic@dachary.org>
ceph::key : reduce literal duplication in tests

Set keys in variables instead of duplicating them in the tests to avoid
spelling mistakes.

Change-Id: Iebbab700da62e8c99869a5cb5fd1ee1730318979
Signed-off-by: Loic Dachary <loic@dachary.org>
ceph::key : proofread documentation strings

Change-Id: Ice6c57375a6ba28e134fa8c9bb87fa55b6974fc1
Signed-off-by: Loic Dachary <loic@dachary.org>
update the first use case to reflect that it works

The first use case works with the current implementation. It is updated
to remove the warning and the syntax is adapted to match the
reality. Instead of a laptop, it is suggested that the test is done on a
virtual machine because it is much more likely.

Change-Id: I7fafb2a6d06eb146b6a2407fb20fdfc4846889f9
Signed-off-by: Loic Dachary <loic@dachary.org>
ceph::mon : remove useless comments from tests

Change-Id: I2cc5c3a1d2e3d130fb66f4a8adcd00786434391c
Signed-off-by: Loic Dachary <loic@dachary.org>
ceph::mon : tag cephx spec test

And add a comment to be interpreted by emacs and used as a reminder at
the end of the mon test file.

Change-Id: I665b233d89de964db9f84c308ab31beba1bb7fba
Signed-off-by: Loic Dachary <loic@dachary.org>
ceph::mon : control client.admin key generation

Creating an empty /etc/ceph/ceph.client.admin.keyring file disables the
automatic creation of the client.admin credentials when the first
monitor is created.

The creation of the key must be done via ceph::key, using the
mon. keyring, in the same way ceph-create-keys does.

Modify the client.volumes test to actually use cephx instead of
injecting a key in a non cephx cluster. It makes the client.something
test redundant and also demonstrates that the client.admin key can be
created by puppet instead of being automatically created by
ceph-create-keys.

Change-Id: I7060e418c27ea3f6f4e53604044f21865438382e
Signed-off-by: Loic Dachary <loic@dachary.org>
ceph::osd : do not hardcode the cluster name

And cleanup the content of the OSD when it is removed, before umounting it.

Change-Id: Ie255d4ae4012b995fd2fc0e6f643ed32a03ce165
Signed-off-by: Loic Dachary <loic@dachary.org>
ceph::osd : add support for mon data directories

The creation of the OSD is separated in two stages, ceph-disk prepare
and ceph-disk activate. When dealing with a device this is not
necessary. But it is necessary when mon data is a directory.

The mon data directory is created if it does not exist. Although this is
not necessary for versions >= dumpling, it is for cuttlefish.

The tests are unmodified : they are run once with the /dev/sdb device
and again with the /srv/data directory.

The filestore_xattr_use_omap = true is added because cuttlefish does not
set it by default and will fail if trying to OSD::mount a directory from
a file system with limited xattr capacity such as ext4.

Note: the indentation in the tests is intentionally incorrect to not
introduce white space changes and make a clean diff.

Change-Id: Ie40eea0908b0f2e14420e2b0df2ba26e1465d23e
Signed-off-by: Loic Dachary <loic@dachary.org>
ceph::osd : indent tests

Change-Id: I5cc8f9711b02a39e7a3dc6da47ff37bd551f75e9
Signed-off-by: Loic Dachary <loic@dachary.org>
ceph::osd : add tests for osd data on an existing partition

Specifying an existing partition as osd data is supported when the
partition is properly set with the Ceph type uuid (
4fbd7e29-9d25-41b8-afd0-062c0ceff05d ). Add a test that shows it is.

Change-Id: I186647e331157a5ea8df025c0074e38a25cb238a
Signed-off-by: Loic Dachary <loic@dachary.org>
Create rspec-system tests for RedHat family

Provides the necessary nodset configurations and examples
on how to run the tests on RedHat family systems.

Using CentOS 6.4 as a representative for RedHat family systems,
as there is a box available from the puppetlabs Vagrant boxes
repository with the same Virtualbox version requirements as the
existing Ubuntu Precise one:

http://puppet-vagrant-boxes.puppetlabs.com

This is needed to test solutions for bugs 1264959 and 1264916.

There is a circular dependency issue between those bugs and this:
Cannot test the solutions to those bugs without this patch, but without
solutions to those tests the rspec-system tests for RedHat family
systems won't run. To have only running code committed, this should
only be merged together with the other patches.

Change-Id: I2093635034ca78b7fb6dbfd950cf35af8a03bc6f
Closes-Bug: 1253211
Related-Bug: 1264959
Related-Bug: 1264916
define ceph::pool.

Provides pool management.

Handles ceph pools, including creation and the basic pool attributes
(pg_num, pgp_num, size/replica), as well as deletion of existing pools.

Includes rspec system puppet for validation.

Change-Id: Ia5aa832fc286f0eb5ad0932dcc2fb0796c21187b