Skip to content

Commit

Permalink
Update ceph to 2fb87074581f04c83885f8dec4f3bad0eaeae9ed
Browse files Browse the repository at this point in the history
2fb87074581f04c83885f8dec4f3bad0eaeae9ed Add support for civetweb

Change-Id: I01fe5ef6216c97d1084388bd60e57d7efbe1f481
  • Loading branch information
jguiditta committed Feb 29, 2016
1 parent c90f31a commit 3d5c36f
Show file tree
Hide file tree
Showing 10 changed files with 538 additions and 36 deletions.
2 changes: 1 addition & 1 deletion Puppetfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ mod 'ceilometer',
:git => 'https://github.com/openstack/puppet-ceilometer.git'

mod 'ceph',
:commit => '59fc06026da552462e6d852695eb963cb5272e1a',
:commit => '2fb87074581f04c83885f8dec4f3bad0eaeae9ed',
:git => 'https://github.com/stackforge/puppet-ceph.git'

mod 'certmonger',
Expand Down
22 changes: 22 additions & 0 deletions ceph/manifests/profile/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,23 @@
# the repo by yourself.
# Optional. Defaults to true
#
# [*enable_rgw*] boolean to enable the installation and configuration of
# radosgw on the controller
# Optional. Default to false
#
# [*rgw_user*] the user ID radosgw should run as.
# Optional. Default to root
#
# [*rgw_print_continue*] should http 100 continue be used
# Optional. Default to false
#
# [*frontend_type*] What type of frontend to use
# Optional. Default is apache-fastcgi. Other options are apache-proxy-fcgi or civetweb
#
# [*rgw_frontends*] Arguments to the rgw frontend
# Optional. Default is 'fastcgi socket_port=9000 socket_host=127.0.0.1'. Example: "civetweb port=7480"
#

class ceph::profile::params (
$fsid = undef,
$release = undef,
Expand All @@ -113,6 +130,11 @@
$client_keys = {},
$osds = undef,
$manage_repo = true,
$enable_rgw = false,
$rgw_user = 'root',
$rgw_print_continue = false,
$frontend_type = 'apache-fastcgi',
$rgw_frontends = 'fastcgi socket_port=9000 socket_host=127.0.0.1',
) {
validate_hash($client_keys)

Expand Down
42 changes: 42 additions & 0 deletions ceph/manifests/profile/rgw.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#
# Copyright (C) 2016 Keith Schincke
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Author: Keith Schincke <[email protected].>
#
# == Class: ceph::profile::rgw
#
# Profile for Ceph rgw
#
class ceph::profile::rgw {
require ::ceph::profile::base

if $ceph::profile::params::enable_rgw
{
ceph::rgw { 'radosgw.gateway':
pkg_radosgw => $::ceph::params::pkg_radosgw,
rgw_data => "/var/lib/ceph/radosgw/ceph-${name}",
user => $ceph::profile::params::rgw_user,
keyring_path => "/etc/ceph/ceph.client.${name}.keyring",
log_file => '/var/log/ceph/radosgw.log',
rgw_dns_name => $::fqdn,
rgw_socket_path => $::ceph::params::rgw_socket_path,
rgw_print_continue => $::ceph::params::rgw_print_continue,
rgw_port => undef,
syslog => true,
frontend_type => $ceph::profile::params::frontend_type,
rgw_frontends => $ceph::profile::params::rgw_frontends,
}
}
}
79 changes: 51 additions & 28 deletions ceph/manifests/rgw.pp
Original file line number Diff line number Diff line change
Expand Up @@ -67,48 +67,63 @@
# [*syslog*] Whether or not to log to syslog.
# Optional. Default is true.
#
# [*frontend_type*] What type of frontend to use
# Optional. Default is apache-fastcgi. Other options are apache-proxy-fcgi or civetweb
#
# [*rgw_frontends*] Arguments to the rgw frontend
# Optional. Default is 'fastcgi socket_port=9000 socket_host=127.0.0.1'. Example: "civetweb port=7480"
#
define ceph::rgw (
$pkg_radosgw = $::ceph::params::pkg_radosgw,
$rgw_ensure = 'running',
$rgw_enable = true,
$rgw_data = "/var/lib/ceph/radosgw/ceph-${name}",
$user = $::ceph::params::user_radosgw,
$keyring_path = "/etc/ceph/ceph.client.${name}.keyring",
$log_file = '/var/log/ceph/radosgw.log',
$rgw_dns_name = $::fqdn,
$rgw_socket_path = $::ceph::params::rgw_socket_path,
$rgw_print_continue = false,
$rgw_port = undef,
$frontend_type = 'apache-fastcgi',
$rgw_frontends = 'fastcgi socket_port=9000 socket_host=127.0.0.1',
$syslog = true,
$pkg_radosgw = $::ceph::params::pkg_radosgw,
$rgw_ensure = 'running',
$rgw_enable = true,
$rgw_data = "/var/lib/ceph/radosgw/ceph-${name}",
$user = $::ceph::params::user_radosgw,
$keyring_path = "/etc/ceph/ceph.client.${name}.keyring",
$log_file = '/var/log/ceph/radosgw.log',
$rgw_dns_name = $::fqdn,
$rgw_socket_path = $::ceph::params::rgw_socket_path,
$rgw_print_continue = false,
$rgw_port = undef,
$frontend_type = 'apache-fastcgi',
$rgw_frontends = 'fastcgi socket_port=9000 socket_host=127.0.0.1',
$syslog = true,
) {

if $frontend_type {
validate_re(downcase($frontend_type), '^(apache-fastcgi|apache-proxy-fcgi)$',
"${frontend_type} is not supported for frontend_type.
Allowed values are 'apache-fastcgi' and 'apache-proxy-fcgi'.")
}

ceph_config {
"client.${name}/host": value => $::hostname;
"client.${name}/keyring": value => $keyring_path;
"client.${name}/log_file": value => $log_file;
"client.${name}/rgw_dns_name": value => $rgw_dns_name;
"client.${name}/rgw_print_continue": value => $rgw_print_continue;
"client.${name}/rgw_socket_path": value => $rgw_socket_path;
"client.${name}/user": value => $user;
}

if $frontend_type == 'apache-fastcgi' {
ceph_config {
"client.${name}/rgw_port": value => $rgw_port;
if ($frontend_type == 'civetweb')
{
ceph::rgw::civetweb { 'radosgw.gateway':
rgw_frontends => $rgw_frontends,
}
} elsif $frontend_type == 'apache-proxy-fcgi' {
}
elsif ( ( $frontend_type == 'apache-fastcgi' ) or ( $frontend_type == 'apache-proxy-fcgi' ) )
{
ceph_config {
"client.${name}/rgw_frontends": value => $rgw_frontends;
"client.${name}/rgw_dns_name": value => $rgw_dns_name;
"client.${name}/rgw_print_continue": value => $rgw_print_continue;
"client.${name}/rgw_socket_path": value => $rgw_socket_path;
}
if $frontend_type == 'apache-fastcgi' {
ceph_config {
"client.${name}/rgw_port": value => $rgw_port;
}
} elsif $frontend_type == 'apache-proxy-fcgi' {
ceph_config {
"client.${name}/rgw_frontends": value => $rgw_frontends;
}
}
}
else
{
fail("Unsupported frontend_type: ${frontend_type}")
}

package { $pkg_radosgw:
ensure => installed,
Expand Down Expand Up @@ -169,12 +184,20 @@
fail("operatingsystem = ${::operatingsystem} is not supported")
}

#for RHEL/CentOS7, systemctl needs to reload to pickup the ceph-radosgw init file
if (($::operatingsystem == 'RedHat' or $::operatingsystem == 'CentOS') and (versioncmp($::operatingsystemmajrelease, '7') >= 0))
{
exec { 'systemctl-reload-from-rgw': #needed for the new init file
command => '/usr/bin/systemctl daemon-reload',
}
}
service { "radosgw-${name}":
ensure => $rgw_ensure,
}

Ceph_config<||> -> Service["radosgw-${name}"]
Package<| tag == 'ceph' |> -> File['/var/lib/ceph/radosgw']
Package<| tag == 'ceph' |> -> File[$log_file]
File['/var/lib/ceph/radosgw']
-> File[$rgw_data]
-> Service["radosgw-${name}"]
Expand Down
32 changes: 32 additions & 0 deletions ceph/manifests/rgw/civetweb.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#
# Copyright (C) 2016 Keith Schincke
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Author: Keith Schincke <[email protected].>
#
# Configures a ceph radosgw using civetweb.
#
# == Define: ceph::rgw::civetweb
# [*rgw_frontends*] Arguments to the rgw frontend
# Optional. Default is undef. Example: "civetweb port=7480"
#
define ceph::rgw::civetweb (
$rgw_frontends = undef,
) {

ceph_config {
"client.${name}/rgw_frontends": value => $rgw_frontends;
}

}
Loading

0 comments on commit 3d5c36f

Please sign in to comment.