Add manifests to setup a radosgw node

Add functionality to setup a radosgw node in puppet-ceph. It is
possible to add radosgw users for S3 and swift. The apache2
configuration can be done with puppet-apache and won't be
a part of this patch.

Signed-off-by: Marc Koderer <m.koderer@telekom.de>
Add keyrings as parameters

Adapts to the new key handling and fixes problem with service startup.

Signed-off-by: Marc Koderer <m.koderer@telekom.de>
manifests/key.pp: make $secret mandatory

If $secret is not set the ceph-authtool call will produce and invalid
and simply empty keyring file.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
ceph::conf: add support for mkfs/mount options to support other FS than XFS

Added new options to ceph::conf:
- osd_mkfs_type (fstype)
- osd_mkfs_options
- osd_mount_options

Make use of the new options for mkfs and mount calls in ceph::osd::device:

Set default for XFS mount options to rw,noatime,inode64 since the default
packages are 64bit. The XFS mkfs options stay at '-f', if you need other
options, specifiy them in ceph::conf.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
key.pp: extend key handling with caps, keyfile fbits and injection

This extends the key handling. It adds optional support for:
- Ceph auth capabilities
- set the file mode bits for the keyfile
- support to inject a key into the cluster directly in one run

README.rst: change command to get a key via ceph-authtool.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
adapt mon.pp and osd.pp to changed keyhandling

Don't create keys on your own in mon.pp, use ceph::key for this.

Don't generate client.admin key in ceph::mon and distribute it later
via facter to the other nodes. Simplify the handling of the secret for
client.admin: generate it like the mon secret before in the site.pp
and pass the secret over to the nodes which may need the key to generate
a file containing the key.

With this change the client.admin key is injected in the cluster
in ceph::mon. Don't care which of the MONs inject, since they all
use the same secret. This way it would reduce the needed puppet runs
from at least 3 runs to simply one per MON node. It also make administration
much easier since the client.amin secret is known to the admin from
the site.pp and can easily be used to create new keys on other machines.

Due to this change the 'client_admin_secret' secret is mandatory for
ceph::mon and ceph::osd.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
.gitignore: add some common files to be ignored

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
device.pp: extend to work without partition and reduce needed runs

Changed ceph::osd::device to work also without partition the device
and adding a GPT table to the device. This way we can use e.g. /dev/sdc
directly since there is no need to use a partition in most cases.

Reduce the needed puppet agent runs from at least 3  to max. 2 runs
if the MONs are running. Get the blkid if not available in facter
directly from the system and pass the information to a file under
/var/lib/ceph/tmp/. Then create the OSD without waiting for facter
by getting the information needed from this file. This way we can
spare one puppet run.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
mds: allow to disable [mds] section in ceph.conf if not needed

Added new parameter to ceph::conf (mds_activate) to disable
the [mds] section of ceph.conf if not needed.

Added test for 'default param+mds_activate=false' to ceph.conf.erb.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
manifests/conf.pp: add support for 'mon osd (near)full ratio'

Added new optional parameter to ceph::conf:
- mon_osd_full_ratio
- mon_osd_nearfull_ratio

Added parameter documentation to the manifest.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
pool.pp: add new define ceph::pool

Added new ceph::pool to manage pools. Currently these actions are supported:
- create a new pool (via $create_pool, defaults to false)
- delete an existing pool from the cluster (via $delete_pool, defaults to
  false) -> BE VERY CAREFULLY WITH THIS PARAMETER!
- increase pg_num of a pool (via $increase_pg_num, defaults to false)
- increase pgp_num of a pool (via $increase_pgp_num, defaults to false)

fixed typo in 'describe' of ceph_key_spec.rb (s/wen/when/).

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
README.rst: add hint on how to run the rspec tests

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
ceph.conf-osd.erb: don't set the partition number in the config

This will be directly handled by ceph::osd::device to make sure the
correct device path/name was set.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
ceph_rgw_spec.rb: fix rspec for rgw class

Add some missing mandatory parameter.

Signed-off-by: Danny Al-Gaaf <d.al-gaaf@telekom.de>
fix problems with failures at boot time with OSDs on dmcrypt

We setup our OSDs on with dmcrypt encrypted disks for security reasons.
These devices are handled via our puppet-dmcrypt module for the nodes
directly in the same puppet agent run as the puppet-ceph run. This cause
trouble on boot since ceph::osd::device expect the blkid and osd id to
be available, otherwise a second agent run is needed to startup the OSDs.

To resolve this: added facter code to parse the needed information from
the ceph.conf (should have the state from before the boot) and
'ceph osd dump' and add some extra facts. We use these facts now as
fallback in ceph::osd::device to startup directly on boot.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix bug if swift key is empty
Fix bug if swift key is empty
Fix radosgw permissions

Radosgw couldn't create new buckets.
ceph::pool: add pool_name parameter to allow ordering

Add pool_name to allow ordering via the ressource name e.g. in
case where we set the PGs and then the PGPs up.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit 2083469a33cfd8881b863ca703802bdea2ae7537)
ceph::pool: fix conditions of exec calls to increase PGs/PGPs

Use onlyif and check also if the value of the current PGs/PGPs is the
same as the value we want to set.

Increase the time for the PGP increase command to 60 seconds and the
check interval from to every 5 seconds.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit cf1213ced42fba581b07117386295d925808eb0c)