From: François Charlier Date: Tue, 23 Apr 2013 08:51:24 +0000 (+0200) Subject: Merge remote-tracking branch 'mgagne/grizzly' into lint X-Git-Tag: grizzly-eol~15^2~1 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=74bbcac98bb94649dd6742d5c85ac93b4db38905;p=puppet-modules%2Fpuppet-ceilometer.git Merge remote-tracking branch 'mgagne/grizzly' into lint Conflicts: manifests/db/mysql.pp manifests/db/mysql/host_access.pp manifests/keystone/auth.pp Update some docs in the process --- 74bbcac98bb94649dd6742d5c85ac93b4db38905 diff --cc manifests/api.pp index f020dd9,5136d18..96de777 --- a/manifests/api.pp +++ b/manifests/api.pp @@@ -1,20 -1,4 +1,27 @@@ +# Installs & configure the ceilometer api service +# +# == Parameters - # $enabled: should the service be enabled - # Optional. Defaults to true - # $keystone_host: keystone's admin endpoint IP/Host - # Optional. Defaults to 127.0.0.1 - # $keystone_port: keystone's admin endpoint port - # Optional. Defaults to 35357 - # $keystone_protocol: http/https ++# [*enabled*] ++# should the service be enabled. Optional. Defaults to true ++# ++# [*keystone_host*] ++# keystone's admin endpoint IP/Host. Optional. Defaults to 127.0.0.1 ++# ++# [*keystone_port*] ++# keystone's admin endpoint port. Optional. Defaults to 35357 ++# ++# [*keystone_protocol*] http/https +# Optional. Defaults to https - # $keytone_user: user to authenticate with ++# ++# [*keytone_user*] user to authenticate with +# Optional. Defaults to ceilometer - # $keystone_tenant: tenant to authenticate with ++# ++# [*keystone_tenant*] tenant to authenticate with +# Optional. Defaults to services - # $keystone_password: password to authenticate with ++# ++# [*keystone_password*] password to authenticate with +# Mandatory. + # class ceilometer::api ( $enabled = true, $keystone_host = '127.0.0.1', diff --cc manifests/db/mysql.pp index 643c556,64231e0..93c2d9e --- a/manifests/db/mysql.pp +++ b/manifests/db/mysql.pp @@@ -1,23 -1,6 +1,30 @@@ +# The ceilometer::db::mysql class creates a MySQL database for ceilometer. +# It must be used on the MySQL server +# +# == Parameters +# - # $password: password to connect to the database - # Mandatory. - # $dbname: name of the database - # Optional. Defaults to ceilometer. - # $user: user to connect to the database - # Optional. Defaults to ceilometer. - # $host: the default source host user is allowed to connect from ++# [*password*] ++# password to connect to the database. Mandatory. ++# ++# [*dbname*] ++# name of the database. Optional. Defaults to ceilometer. ++# ++# [*user*] ++# user to connect to the database. Optional. Defaults to ceilometer. ++# ++# [*host*] ++# the default source host user is allowed to connect from. +# Optional. Defaults to 'localhost' - # $allowed_hosts: other hosts the user is allowd to connect from ++# ++# [*allowed_hosts*] ++# other hosts the user is allowd to connect from. +# Optional. Defaults to undef. - # $charset: the database charset - # Optional. Defaults to 'latin1' - ++# ++# [*charset*] ++# the database charset. Optional. Defaults to 'latin1' + # class ceilometer::db::mysql( - $password, + $password = false, $dbname = 'ceilometer', $user = 'ceilometer', $host = 'localhost', diff --cc manifests/db/mysql/host_access.pp index cd2dac1,863af57..e9a802d --- a/manifests/db/mysql/host_access.pp +++ b/manifests/db/mysql/host_access.pp @@@ -1,11 -1,6 +1,20 @@@ +# Allow a user to access the ceilometer database +# ++# == Namevar ++# The host to allow ++# +# == Parameters - # * namevar: the host to allow - # * user: username to allow - # * password: user password - # * database: the database name ++# [*user*] ++# username to allow ++# ++# [*password*] ++# user password ++# ++# [*database*] ++# the database name + # define ceilometer::db::mysql::host_access ($user, $password, $database) { + database_user { "${user}@${name}": password_hash => mysql_password($password), provider => 'mysql', diff --cc manifests/keystone/auth.pp index 37cf32f,5593636..68f1732 --- a/manifests/keystone/auth.pp +++ b/manifests/keystone/auth.pp @@@ -1,37 -1,50 +1,49 @@@ + # == Class: ceilometer::keystone::auth # - # Sets up ceilometer users, service and endpoint + # Configures Ceilometer user, service and endpoint in Keystone. # - # == Parameters: + # === Parameters # - # $password: ceilometer user's password - # Mandatory - # $email: ceilometer user's email - # Optional. - # $auth_name: username - # Optional. Defaults to 'ceilometer'. - # $service_type: type of service to create. - # Optional. Defaults to 'metering'. - # $public_address: Public address for endpoint. - # Optional. Defaults to 127.0.0.1. - # $admin_address: Admin address for endpoint. - # Optional. Defaults to 127.0.0.1. - # $internal_address: Internal address for endpoint. - # Optional. Defaults to 127.0.0.1. - # $port: Port for endpoint. Needs to match ceilometer api service port. - # Optional. Defaults to 8777. - # $region: Region where endpoint is set. - # Optional. Defaults to 'RegionOne'. - # $tenant: Service tenant name. - # Optional. Defaults to 'services'. - # $public_protocol: http/https. - # Optional. Defaults to 'http'. - # $configure_endpoint: should the endpoint be created in keystone ? - # Optional. Defaults to true + # [*password*] + # Password for Ceilometer user. Required. # - class ceilometer::keystone::auth( - $password = false, + # [*email*] + # Email for Ceilometer user. Optional. Defaults to 'ceilometer@localhost'. + # + # [*auth_name*] + # Username for Ceilometer service. Optional. Defaults to 'ceilometer'. + # + # [*configure_endpoint*] + # Should Ceilometer endpoint be configured? Optional. Defaults to 'true'. + # + # [*service_type*] + # Type of service. Optional. Defaults to 'metering'. + # + # [*public_address*] + # Public address for endpoint. Optional. Defaults to '127.0.0.1'. + # + # [*admin_address*] + # Admin address for endpoint. Optional. Defaults to '127.0.0.1'. + # + # [*internal_address*] + # Internal address for endpoint. Optional. Defaults to '127.0.0.1'. + # + # [*port*] + # Port for endpoint. Optional. Defaults to '8777'. + # + # [*region*] + # Region for endpoint. Optional. Defaults to 'RegionOne'. + # + # [*tenant*] + # Tenant for Ceilometer user. Optional. Defaults to 'services'. + # + # [*protocol*] + # Protocol for public endpoint. Optional. Defaults to 'http'. + # + class ceilometer::keystone::auth ( - $password, ++ $password = false, $email = 'ceilometer@localhost', $auth_name = 'ceilometer', - $configure_endpoint = true, $service_type = 'metering', $public_address = '127.0.0.1', $admin_address = '127.0.0.1', @@@ -39,16 -52,10 +51,16 @@@ $port = '8777', $region = 'RegionOne', $tenant = 'services', - $public_protocol = 'http' + $public_protocol = 'http', + $admin_protocol = 'http', + $internal_protocol = 'http', + $configure_endpoint = true ) { - Keystone_user_role["${auth_name}@${tenant}"] ~> Service <| title == 'ceilometer-api' |> + validate_string($password) + + Keystone_user_role["${auth_name}@${tenant}"] ~> - Service <| name == 'ceilometer' |> ++ Service <| name == 'ceilometer-api' |> keystone_user { $auth_name: ensure => present,