Check and lint documentation parameters

This puppet-lint plugin checks if all parameters are documented. This commit
also fix lint issues (due to puppet-lint upgrade) and puppet strings errors.

Change-Id: If2e2be0e0c28649b0293f2988faf59b2a0e73437
This commit is contained in:
Sebastien Badia 2015-02-16 15:59:15 +01:00
parent cbf70f6008
commit 63cbbda8f2
20 changed files with 202 additions and 32 deletions

View File

@ -2,9 +2,9 @@ source 'https://rubygems.org'
group :development, :test do
gem 'puppetlabs_spec_helper', :require => false
gem 'puppet-lint', '~> 0.3.2'
gem 'rspec-puppet', '~> 1.0.1', :require => false
gem 'beaker-rspec', '~> 2.2.4', :require => false
gem 'puppet-lint-param-docs'
gem 'rake', '10.1.1'
gem 'rspec', '< 2.99'
gem 'json'

View File

@ -3,7 +3,7 @@ source 'https://rubygems.org'
group :development, :test do
gem 'puppetlabs_spec_helper', :require => false
gem 'puppet-lint', '~> 0.3.2'
gem 'puppet-lint-param-docs'
gem 'rspec-system', :git => 'https://github.com/aldavud/rspec-system.git', :branch => 'master'
gem 'rspec-system-puppet', :git => 'https://github.com/aldavud/rspec-system-puppet.git', :branch => 'master'
gem 'rspec', '< 2.99'

View File

@ -15,8 +15,18 @@
#
# Author: Loic Dachary <loic@dachary.org>
#
# == Class: ceph::conf
#
# Class wrapper for the benefit of scenario_node_terminus
#
# === Parameters:
#
# [*args*] A Ceph config hash.
# Mandatory.
#
# [*defaults*] A config hash
# Optional. Defaults to a empty hash
#
class ceph::conf($args, $defaults = {}) {
create_resources(ceph_config, $args, $defaults)
}

View File

@ -15,10 +15,14 @@
#
# Author: David Moreau Simard <dmsimard@iweb.com>
# Author: David Gurtner <aldavud@crimson.ch>
#
# == Class: ceph
#
# init takes care of installing/configuring the common dependencies across classes
# it also takes care of the global configuration values
### == Parameters
#
# === Parameters:
#
# [*fsid*] The cluster's fsid.
# Mandatory. Get one with `uuidgen -r`.
#
@ -37,7 +41,7 @@
# [*osd_pool_default_pgp_num*] The default flags for new pools.
# Optional. Integer. Default provided by Ceph.
#
# [*$osd_pool_size*] Number of replicas for objects in the pool
# [*osd_pool_default_size*] Number of replicas for objects in the pool
# Optional. Integer. Default provided by Ceph.
#
# [*osd_pool_default_min_size*] The default minimum num of replicas.

View File

@ -19,11 +19,11 @@
# keys into or delete keys from the cluster/keyring via ceph and ceph-authtool
# tools.
#
### == Name
# == Define: ceph::key
#
# The full ceph ID name, e.g. 'client.admin' or 'mon.'.
#
### == Parameters
# === Parameters:
#
# [*secret*] Key secret.
# Mandatory. Can be created with ceph-authtool --gen-print-key.

View File

@ -15,8 +15,18 @@
#
# Author: David Gurtner <aldavud@crimson.ch>
#
# == Class: ceph::keys
#
# Class wrapper for the benefit of scenario_node_terminus
#
# === Parameters:
#
# [*args*] A Ceph keys config hash
# Mandatory.
#
# [*defaults*] A keys config hash
# Optional. Defaults to a empty hash.
#
class ceph::keys($args, $defaults = {}) {
create_resources(ceph::key, $args, $defaults)
}

View File

@ -13,9 +13,13 @@
# limitations under the License.
#
# Author: David Moreau Simard <dmsimard@iweb.com>
#
# == Class: ceph::mds
#
# Installs and configures MDSs (ceph metadata servers)
### == Parameters
#
# === Parameters:
#
# [*mds_activate*] Switch to activate the '[mds]' section in the config.
# Optional. Defaults to 'true'.
#
@ -24,7 +28,7 @@
#
# [*keyring*] The location of the keyring used by MDSs
# Optional. Defaults to /var/lib/ceph/mds/$cluster-$id/keyring.
#
class ceph::mds (
$mds_activate = true,
$mds_data = '/var/lib/ceph/mds/$cluster-$id',
@ -43,4 +47,4 @@ class ceph::mds (
'mds/keyring': ensure => absent;
}
}
}
}

View File

@ -19,8 +19,12 @@
# Author: David Moreau Simard <dmsimard@iweb.com>
# Author: David Gurtner <aldavud@crimson.ch>
#
# == Class: ceph::mon
#
# Installs and configures MONs (ceph monitors)
### == Parameters
#
# === Parameters:
#
# [*title*] The MON id.
# Mandatory. An alphanumeric string uniquely identifying the MON.
#
@ -105,8 +109,8 @@ define ceph::mon (
$keyring_path = "/tmp/ceph-mon-keyring-${id}"
file { $keyring_path:
mode => '0444',
content => "[mon.]\n\tkey = ${key}\n\tcaps mon = \"allow *\"\n",
mode => '0444',
content => "[mon.]\n\tkey = ${key}\n\tcaps mon = \"allow *\"\n",
}
File[$keyring_path] -> Exec[$ceph_mkfs]

View File

@ -15,8 +15,18 @@
#
# Author: Loic Dachary <loic@dachary.org>
#
# == Class: ceph::mons
#
# Class wrapper for the benefit of scenario_node_terminus
#
# === Parameters:
#
# [*args*] A Ceph mons config hash
# Mandatory.
#
# [*defaults*] A config hash
# Optional. Defaults to a empty hash
#
class ceph::mons($args, $defaults = {}) {
create_resources(ceph::mon, $args, $defaults)
}

View File

@ -17,7 +17,12 @@
# Author: Loic Dachary <loic@dachary.org>
# Author: David Gurtner <aldavud@crimson.ch>
#
### == Parameters
# == Define: ceph::osd
#
# Install and configure a ceph OSD
#
# === Parameters:
#
# [*title*] The OSD data path.
# Mandatory. A path in which the OSD data is to be stored.
#

View File

@ -15,8 +15,18 @@
#
# Author: David Gurtner <aldavud@crimson.ch>
#
# == Class: ceph::osds
#
# Class wrapper for the benefit of scenario_node_terminus
#
# === Parameters:
#
# [*args*] A Ceph osds config hash
# Mandatory.
#
# [*defaults*] A config hash
# Optional. Defaults to a empty hash
#
class ceph::osds($args, $defaults = {}) {
create_resources(ceph::osd, $args, $defaults)
}

View File

@ -15,10 +15,23 @@
#
# Author: David Moreau Simard <dmsimard@iweb.com>
# Author: David Gurtner <aldavud@crimson.ch>
#
# == Class: ceph::params
#
# these parameters need to be accessed from several locations and
# should be considered to be constant
#
# === Parameters:
#
# [*packages*] The ceph package name
# Optional. Defaults to 'ceph'
#
# [*rgw_port*] The TCP port for the rados gateway
# Optional. Defaults to '80'
#
# [*rgw_socket_path*] The socket path of the rados gateway
# Optional. Defaults to '/tmp/radosgw.sock'
#
class ceph::params (
$packages = 'ceph', # just provide the minimum per default
$rgw_port = 80,

View File

@ -20,11 +20,11 @@
# Manages operations on the pools in the cluster, such as creating or deleting
# pools, setting PG/PGP numbers, number of replicas, ...
#
### == Name
# == Define: ceph::pool
#
# The name of the pool.
#
### == Parameters
# === Parameters:
#
# [*ensure*] Creates ( present ) or removes ( absent ) a pool.
# Optional. Defaults to present.

View File

@ -15,6 +15,8 @@
#
# Author: David Gurtner <aldavud@crimson.ch>
#
# == Class: ceph::profile::base
#
# Base profile to install ceph and configure /etc/ceph/ceph.conf
#
class ceph::profile::base {

View File

@ -15,6 +15,8 @@
#
# Author: David Gurtner <aldavud@crimson.ch>
#
# Class: ceph::profile::client
#
# Profile for a Ceph client
#
class ceph::profile::client {

View File

@ -15,6 +15,8 @@
#
# Author: David Gurtner <aldavud@crimson.ch>
#
# == Class: ceph::profile::mon
#
# Profile for a Ceph mon
#
class ceph::profile::mon {
@ -36,27 +38,27 @@ class ceph::profile::mon {
# this supports providing the key manually
if $ceph::profile::params::admin_key {
ceph::key { 'client.admin':
secret => $ceph::profile::params::admin_key,
cap_mon => 'allow *',
cap_osd => 'allow *',
cap_mds => 'allow',
mode => $ceph::profile::params::admin_key_mode,
secret => $ceph::profile::params::admin_key,
cap_mon => 'allow *',
cap_osd => 'allow *',
cap_mds => 'allow',
mode => $ceph::profile::params::admin_key_mode,
}
}
if $ceph::profile::params::bootstrap_osd_key {
ceph::key { 'client.bootstrap-osd':
secret => $ceph::profile::params::bootstrap_osd_key,
keyring_path => '/var/lib/ceph/bootstrap-osd/ceph.keyring',
cap_mon => 'allow profile bootstrap-osd',
secret => $ceph::profile::params::bootstrap_osd_key,
keyring_path => '/var/lib/ceph/bootstrap-osd/ceph.keyring',
cap_mon => 'allow profile bootstrap-osd',
}
}
if $ceph::profile::params::bootstrap_mds_key {
ceph::key { 'client.bootstrap-mds':
secret => $ceph::profile::params::bootstrap_mds_key,
keyring_path => '/var/lib/ceph/bootstrap-mds/ceph.keyring',
cap_mon => 'allow profile bootstrap-mds',
secret => $ceph::profile::params::bootstrap_mds_key,
keyring_path => '/var/lib/ceph/bootstrap-mds/ceph.keyring',
cap_mon => 'allow profile bootstrap-mds',
}
}
}

View File

@ -15,6 +15,8 @@
#
# Author: David Gurtner <aldavud@crimson.ch>
#
# Class: ceph::profle::osd
#
# Profile for a Ceph osd
#
class ceph::profile::osd {

View File

@ -15,12 +15,86 @@
#
# Author: David Gurtner <aldavud@crimson.ch>
#
# == Class: ceph::profile::params
#
# Extract the data from hiera where available
#
# === Parameters:
#
# [*fsid*] The cluster's fsid.
# Mandatory. Get one with `uuidgen -r`.
#
# [*release*] The name of the Ceph release to install.
# Optional.
#
# [*authentication_type*] Authentication type.
# Optional. none or 'cephx'. Defaults to 'undef'.
#
# [*mon_initial_members*] The IDs of initial MONs in the cluster during startup.
# Optional. String like e.g. 'a, b, c'.
#
# [*mon_host*] The fqdn of MONs in the cluster. They can also be declared
# individually through ceph::mon.
# Optional. String like e.g. 'a, b, c'.
#
# [*osd_pool_default_pg_num*] The default number of PGs per pool.
# Optional. Integer. Default provided by Ceph.
#
# [*osd_pool_default_pgp_num*] The default flags for new pools.
# Optional. Integer. Default provided by Ceph.
#
# [*osd_pool_default_size*] Number of replicas for objects in the pool
# Optional. Integer. Default provided by Ceph.
#
# [*osd_pool_default_min_size*] The default minimum num of replicas.
# Optional. Integer. Default provided by Ceph.
#
# [*osd_pool_default_crush_rule*] The default CRUSH ruleset to use
# when creating a pool.
# Optional. Integer. Default provided by Ceph.
#
# [*mon_osd_full_ratio*] Percentage of disk space used before
# an OSD considered full
# Optional. Integer e.g. 95, NOTE: ends in config as .95
# Default provided by Ceph.
#
# [*mon_osd_nearfull_ratio*] Percentage of disk space used before
# an OSD considered nearfull
# Optional. Float e.g. 90, NOTE: ends in config as .90
# Default provided by Ceph.
#
# [*cluster_network*] The address of the cluster network.
# Optional. {cluster-network-ip/netmask}
#
# [*public_network*] The address of the public network.
# Optional. {public-network-ip/netmask}
#
# [*admin_key*] The admin secret key.
# Optional.
#
# [*admin_key_mode*] The admin key mode.
# Optional.
#
# [*mon_key*] The mon secret key.
# Optional. Either mon_key or mon_keyring need to be set when using cephx.
#
# [*mon_keyring*] The location of the keyring retrieved by default
# Optional. Either mon_key or mon_keyring need to be set when using cephx
#
# [*bootstrap_osd_key*] The osd secret key (used for bootstrap)
# Optional.
#
# [*bootstrap_mds_key*] The mds secret key (used for bootstrap)
# Optional.
#
# [*manage_repo*] Whether we should manage the local repository (true) or depend
# on what is available (false). Set this to false when you want to manage the
# the repo by yourself.
# Optional. Defaults to true
#
# [*osds*] A Ceph osd hash
# Optional.
#
class ceph::profile::params (
# puppet 2.7 compatibiliy hack. TODO: change to undef once 2.7 is deprecated
$fsid = '4b5c8c0a-ff60-454b-a1b4-9747aa737d19',

View File

@ -22,6 +22,24 @@
# Author: David Gurtner <aldavud@crimson.ch>
# Author: Ricardo Rocha <ricardo@catalyst.net.nz>
#
# == Class: ceph::repo
#
# Configure ceph APT repo for Ceph
#
# === Parameters:
#
# [*ensure*] The ensure state for package ressources.
# Optional. Defaults to 'present'.
#
# [*release*] The name of the Ceph release to install
# Optional. Default to 'giant'.
#
# [*extras*] Install Ceph Extra APT repo.
# Optional. Defaults to 'false'.
#
# [*fastcgi*] Install Ceph fastcgi apache module for Ceph
# Optional. Defaults to 'false'
#
class ceph::repo (
$ensure = present,
$release = 'giant',

View File

@ -17,12 +17,12 @@
#
# Configures a ceph radosgw.
#
### == Name
# == Define: ceph::rgw
#
# The RGW id. An alphanumeric string uniquely identifying the RGW.
# ( example: radosgw.gateway )
#
### == Parameters
# === Parameters:
#
# [*pgk_cephrgw*] Package name for the ceph radosgw.
# Optional. Default is osfamily dependent (check ceph::params).