Skip to content

Commit f6e050e

Browse files
committed
Added documentation to modules.
1 parent 3f5cc49 commit f6e050e

File tree

8 files changed

+159
-34
lines changed

8 files changed

+159
-34
lines changed

Modulefile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
name 'jlondon-zookeeper'
22
version '0.1.0'
33
source 'UNKNOWN'
4-
author 'jlondon'
4+
author 'Justice London'
55
license 'Apache License, Version 2.0'
6-
summary 'UNKNOWN'
7-
description 'UNKNOWN'
8-
project_page 'UNKNOWN'
9-
10-
## Add dependencies, if any:
11-
# dependency 'username/name', '>= 1.2.0'
6+
summary 'Puppet zookeeper cluster module'
7+
description 'Module which allows you to simply install/configure an entire zookeeper cluster'
8+
project_page 'http://github.com/justicel/puppet-zookeeper'
9+
dependency 'ripienaar/concat', '>= 0.2.0'

README

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,30 @@
1-
zookeeper
1+
puppet-zookeeper
2+
================
23

3-
This is the zookeeper module.
4+
Zookeeper installation and configuration for puppet. Allows you to install a
5+
zookeeper server cluster easily. Generally a good idea to use it with an
6+
orchestration engine like Mcollective as you will need to run each
7+
zookeeper puppet configuration a couple times to pull in all node definitions.
8+
9+
Usage
10+
-----
11+
node 'zookeeper' {
12+
class { 'zookeeper':
13+
server_name => $::ipaddress,
14+
}
15+
}
416

517
License
618
-------
719

20+
Apache License, Version 2.0
821

922
Contact
1023
-------
1124

25+
Justice London <[email protected]>
1226

1327
Support
1428
-------
1529

16-
Please log tickets and issues at our [Projects site](http://projects.example.com)
30+
Please log tickets and issues at our [Projects site](http://github.com/justicel/puppet-phpmyadmin)

manifests/config.pp

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,41 @@
1+
# == Class: zookeeper::config
2+
#
3+
# Configuration class for zookeeper. Allows you to specify a configuration for
4+
# zookeeper nodes. Generally not launched directly.
5+
#
6+
# === Parameters
7+
#
8+
# [*homedir*]
9+
# Defines where the zookeeper 'home' folder will be. Default param used.
10+
# [*datadir*]
11+
# Where to store the zookeeper data files. Can be different from home.
12+
# [*logdir*]
13+
# Storage location for all of the zookeeper logs. Generally should be the
14+
# home-folder.
15+
# [*clientport*]
16+
# The port used for communications with the zookeeper cluster by client
17+
# scripts or programs.
18+
# [*group*]
19+
# Which zookeeper group this configuration is a member of.
20+
# [*myid*]
21+
# An ID to identify the particular zookeeper server. Defaults to a rand.
22+
#
23+
# === Examples
24+
#
25+
# class { 'zookeeper::config':
26+
# group => 'clustertwo',
27+
# myid => '1',
28+
# }
29+
#
30+
# === Authors
31+
#
32+
# Justice London <[email protected]>
33+
#
34+
# === Copyright
35+
#
36+
# Copyright 2013 Justice London, unless otherwise noted.
37+
#
38+
139
class zookeeper::config (
240
$homedir = $zookeeper::params::zookeeper_home,
341
$datadir = $zookeeper::params::zookeeper_datadir,
@@ -24,7 +62,7 @@
2462
group => 'root',
2563
require => File[$homedir],
2664
}
27-
65+
2866
#Log folder
2967
file { $logdir:
3068
ensure => directory,

manifests/init.pp

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,41 @@
11
# == Class: zookeeper
22
#
3-
# Full description of class zookeeper here.
3+
# Defines a default cluster member for zookeeper and configures it
44
#
55
# === Parameters
66
#
7-
# Document parameters here.
8-
#
9-
# [*sample_parameter*]
10-
# Explanation of what this parameter affects and what it defaults to.
11-
# e.g. "Specify one or more upstream ntp servers as an array."
12-
#
13-
# === Variables
14-
#
15-
# Here you should define a list of variables that this module would require.
16-
#
17-
# [*sample_variable*]
18-
# Explanation of how this variable affects the funtion of this class and if it
19-
# has a default. e.g. "The parameter enc_ntp_servers must be set by the
20-
# External Node Classifier as a comma separated list of hostnames." (Note,
21-
# global variables should not be used in preference to class parameters as of
22-
# Puppet 2.6.)
7+
# [*version*]
8+
# The version of zookeeper to install.
9+
# [*homedir*]
10+
# Defines where the zookeeper 'home' folder will be. Default param used.
11+
# [*datadir*]
12+
# Where to store the zookeeper data files. Can be different from home.
13+
# [*logdir*]
14+
# Storage location for all of the zookeeper logs. Generally should be the
15+
# home-folder.
16+
# [*clientport*]
17+
# The port used for communications with the zookeeper cluster by client
18+
# scripts or programs.
19+
# [*server_name*]
20+
# The actual name to use to identify the particular server-node.
21+
# [*server_group*]
22+
# Which zookeeper group this configuration is a member of.
2323
#
2424
# === Examples
2525
#
26-
# class { zookeeper:
27-
# servers => [ 'pool.ntp.org', 'ntp.local.company.com' ]
26+
# class { 'zookeeper':
27+
# version => '0.0.1',
28+
# server_name => $::fqdn,
29+
# server_group => 'default',
2830
# }
2931
#
3032
# === Authors
3133
#
32-
# Author Name <author@domain.com>
34+
# Justice London <jlondon@syrussystems.com>
3335
#
3436
# === Copyright
3537
#
36-
# Copyright 2013 Your name here, unless otherwise noted.
38+
# Copyright 2013 Justice London, unless otherwise noted.
3739
#
3840
class zookeeper (
3941
$version = $zookeeper::params::zookeeper_version,
@@ -47,7 +49,7 @@
4749
{
4850

4951
#Add node to cluster with stored config
50-
@@zookeeper::servernode { "${server_name}":
52+
@@zookeeper::servernode { $server_name:
5153
group => $server_group,
5254
homedir => $homedir,
5355
}

manifests/install.pp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
1+
# == Class: zookeeper::install
2+
#
3+
# Install class for zookeeper. Takes care of package installation, etc.
4+
#
5+
# === Parameters
6+
#
7+
# [*mirror*]
8+
# The location to download the installer from.
9+
# [*version*]
10+
# The version of zookeeper to install.
11+
# [*homedir*]
12+
# Install location for the final zookeeper package.
13+
# [*datadir*]
14+
# Where to store/configure the zookeeper data.
15+
# [*logdir*]
16+
# Storage location for zookeeper logs.
17+
#
18+
# === Examples
19+
#
20+
# class { 'zookeeper::install':
21+
# mirror => 'http://www.mymirror.com/zookeeper-package',
22+
# }
23+
#
24+
# === Authors
25+
#
26+
# Justice London <[email protected]>
27+
#
28+
# === Copyright
29+
#
30+
# Copyright 2013 Justice London, unless otherwise noted.
31+
#
132
class zookeeper::install (
233
$mirror = $zookeeper::params::zookeeper_mirror,
334
$version = $zookeeper::params::zookeeper_version,

manifests/params.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#Basic parameter options for zookeeper, including mirrors location etc.
12
class zookeeper::params {
23

34
$zookeeper_version = '3.4.5'

manifests/server.pp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
1+
# == Class: zookeeper::server
2+
#
3+
# Launches a server for zookeeper. Don't use directly
4+
#
5+
# === Authors
6+
#
7+
# Justice London <[email protected]>
8+
#
9+
# === Copyright
10+
#
11+
# Copyright 2013 Justice London, unless otherwise noted.
12+
#
113
class zookeeper::server {
214

315
exec { 'zookeeper-start':
416
command => 'zkServer.sh restart',
517
cwd => "${zookeeper::params::zookeeper_home}/bin",
618
path => ['/bin', '/sbin', '/usr/bin', '/usr/sbin',
719
"${zookeeper::params::zookeeper_home}/bin"
8-
],
20+
],
921
require => File[$zookeeper::params::zookeeper_home],
1022
unless => "netstat -ln | grep ':3888'",
1123
}

manifests/servernode.pp

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,32 @@
1+
# == Class: zookeeper::servernode
2+
#
3+
# Defines a zookeeper node into the cluster. Generally not launched directly.
4+
#
5+
# === Parameters
6+
#
7+
# [*server_name*]
8+
# The name of the server you are launching. Could be ip, fqdn, etc.
9+
# [*group*]
10+
# The group this server should live in.
11+
# [*homedir*]
12+
# Where zookeeper lives.
13+
# [*myid*]
14+
# A randomized ID to define this server in the cluster
15+
# === Examples
16+
#
17+
# class { 'zookeeper::servernode':
18+
# group => 'clustertwo',
19+
# myid => '1',
20+
# }
21+
#
22+
# === Authors
23+
#
24+
# Justice London <[email protected]>
25+
#
26+
# === Copyright
27+
#
28+
# Copyright 2013 Justice London, unless otherwise noted.
29+
#
130
define zookeeper::servernode (
231
$server_name = $name,
332
$group = 'default',

0 commit comments

Comments
 (0)