Skip to content

Commit afb41e2

Browse files
author
Joshua Hoblitt
committed
major doc update
1 parent af343f3 commit afb41e2

File tree

10 files changed

+208
-112
lines changed

10 files changed

+208
-112
lines changed

Modulefile

+8-18
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,10 @@
11
name 'puppet-pureftpd'
2-
version '1.0.3'
3-
4-
author '5Ub-Z3r0'
5-
license 'GPL v3'
6-
project_page 'https://github.com/5Ub-Z3r0/puppet-pureftpd'
7-
source 'https://github.com/5Ub-Z3r0/puppet-pureftpd.git'
8-
summary 'Pure-FTPd module'
9-
description 'This module manages Pure-FTPd via Puppet.
10-
11-
It currently supports only RHEL, altough it should be easy to modify it to manage Debian-like systems.
12-
13-
Requirements:
14-
15-
* [Facter](http://www.puppetlabs.com/puppet/related-projects/facter/) 1.6.1 or greater (versions that support the osfamily fact)
16-
17-
Todo:
18-
- complete the config_mysql and config_pgsql defines
19-
'
2+
version '1.0.0'
3+
4+
author 'Joshua Hoblitt <[email protected]>'
5+
license 'Apache + GPLv3'
6+
project_page 'https://github.com/jhoblitt/puppet-pureftpd'
7+
source 'https://github.com/jhoblitt/puppet-pureftpd.git'
8+
summary 'Manages the pure-ftpd package with comprehensive configuration support'
9+
description 'Manages the pure-ftpd package with comprehensive configuration support'
2010
dependency 'puppetlabs/stdlib', '>= 4.1.0'

README.md

+161-21
Original file line numberDiff line numberDiff line change
@@ -3,48 +3,128 @@ Puppet pureftpd Module
33

44
[![Build Status](https://travis-ci.org/jhoblitt/puppet-pureftpd.png)](https://travis-ci.org/jhoblitt/puppet-pureftpd)
55

6+
#### Table of Contents
7+
8+
1. [Overview](#overview)
9+
2. [Description](#description)
10+
3. [Usage](#usage)
11+
4. [Limitations](#limitations)
12+
* [Tested Platforms](#tested-platforms)
13+
5. [Support](#support)
14+
15+
16+
Overview
17+
--------
18+
19+
Manages the pure-ftpd package with comprehensive configuration support'
20+
621

722
Description
823
-----------
924

10-
This is a puppet module for installation and configuration of the `pure-ftpd`
11-
software.
25+
This is a puppet module for installation and configuration of the
26+
[`pure-ftpd`](http://www.pureftpd.org/project/pure-ftpd) software package. It
27+
aims to support all valid configuration file values.
1228

29+
### Forked
1330

14-
Examples
15-
--------
31+
This module started out as a fork of
32+
[`5Ub-Z3r0/puppet-pureftpd`](https://github.com/5Ub-Z3r0/puppet-pureftpd) but
33+
has been so heavily redesigned over time that it's probably not reasonable to
34+
blame any of the design or implementation on
35+
[`5Ub-Z3r0`](https://github.com/5Ub-Z3r0). It would also be exceptionally
36+
difficult to re-unify the two modules due to fundamental API differences.
37+
38+
The original module was marked as being licensed under `GPLv3` in comments and
39+
no `LICENSE` file was present. Very little to none of the original module code
40+
remains in the present version of this module. All contributions by `Joshua
41+
Hoblitt` are licensed under `Apache License, Version 2.0`. You should consult
42+
with a lawyer for a legal opinion as to weather or not this module constitutes
43+
a derived work.
44+
45+
46+
Usage
47+
-----
48+
49+
In general, any valid `pure-ftpd` configuration file option (including the
50+
separate configuration files for auth modules) can be set by creating a key in
51+
the appropriate class parameter hash but with the name of the option
52+
transliterated to *lowercase*. The values passed to that option are handled
53+
completely as raw strings but this module. No effort is made to handle
54+
`boolean` or `integer` values as `pure-ftpd` itself is not consistent in how it
55+
handles these values.
56+
57+
For example, if you wanted to create the configuration option example below in the file `/etc/pure-ftpd/pure-ftpd.conf`,
58+
59+
ChrootEveryone yes
60+
61+
You would declare it like this to the puppet module:
1662

17-
### Basic
63+
class { 'pureftpd':
64+
config => {
65+
chrooteveryone => 'yes',
66+
}
67+
}
68+
69+
The notable exception to that rule is for these `pure-ftpd.conf` options, which
70+
should not need to be manually declared. Passing a hash of configuration
71+
options to the appropriate class parameter automatically defines these options
72+
for you.
73+
74+
LDAPConfigFile
75+
MySQLConfigFile
76+
PGSQLConfigFile
77+
78+
79+
### `pure-ftpd` Options
80+
81+
The `pure-ftpd` documentation does not provide a canonical list of all possible
82+
configuration options with examples. However, there are number of "HOW TO"s on
83+
the official [documentation](http://www.pureftpd.org/project/pure-ftpd/doc) web
84+
page.
1885

19-
Install `pure-ftpd` with an empty `pure-ftpd.conf` config file (accepting all
20-
defaults) and start `pure-ftpd` as a stand alone daemon.
86+
There is a list of command line switches in the distribution's
87+
[`README`](https://github.com/jedisct1/pure-ftpd/blob/master/README) that
88+
should all have `pure-ftpd.conf` option analogs.
89+
90+
Here are some useful sources for discovering configuration parameters with examples:
91+
92+
* [`pure-ftpd.conf`](https://github.com/jedisct1/pure-ftpd/blob/master/configuration-file/pure-ftpd.conf.in)
93+
* [`pureftpd-ldap.conf`](https://github.com/jedisct1/pure-ftpd/blob/master/pureftpd-ldap.conf)
94+
* [`pureftpd-mysql.conf`](https://github.com/jedisct1/pure-ftpd/blob/master/pureftpd-mysql.conf)
95+
* [`pureftpd-pgsql.conf`](https://github.com/jedisct1/pure-ftpd/blob/master/pureftpd-pgsql.conf)
96+
97+
### Basic Usage
98+
99+
Install the `pure-ftpd` package with an empty `pure-ftpd.conf` config file
100+
(accepting all defaults) and start `pure-ftpd` as a stand alone daemon.
21101

22102
class { 'pureftpd': }
23103

24-
### Selinux support
104+
### SELinux Support
25105

26106
class { 'pureftpd':
27107
use_selinux => true,
28108
}
29109

30-
### Setting configuration options
110+
### Setting Configuration Options
111+
112+
Options for `pure-ftpd.conf`] should be passed into the `config` class
113+
parameter as a hash.
31114

32115
class { 'pureftpd':
33-
use_selinux => true,
34116
config => {
35117
ipv4only => 'Yes',
36118
passiveportrange => '49999:59999',
37119
},
38120
}
39121

40-
### Enabling LDAP authentication
122+
### Enabling LDAP Authentication
123+
124+
Options for `pureftpd-ldap.conf`] should be passed into the `config_ldap` class
125+
parameter as a hash.
41126

42127
class { 'pureftpd':
43-
use_selinux => true,
44-
config => {
45-
ipv4only => 'Yes',
46-
passiveportrange => '49999:59999',
47-
},
48128
config_ldap => {
49129
ldapserver => 'ldap.example.com',
50130
ldapauthmethod => 'PASSWORD',
@@ -62,14 +142,43 @@ defaults) and start `pure-ftpd` as a stand alone daemon.
62142
},
63143
}
64144

65-
### Enabling PGSQL authentication
145+
### Enabling MYSQL Authentication
146+
147+
Options for `pureftpd-mysql.conf`] should be passed into the `config_mysql`
148+
class parameter as a hash.
66149

67150
class { 'pureftpd':
68-
use_selinux => true,
69-
config => {
70-
ipv4only => 'Yes',
71-
passiveportrange => '49999:59999',
151+
config_mysql => {
152+
mysqlserver => 'localhost'
153+
mysqlport => '3306'
154+
mysqlsocket => '/tmp/mysql.sock'
155+
mysqluser => 'root'
156+
mysqlpassword => 'rootpw'
157+
mysqldatabase => 'pureftpd'
158+
mysqlcrypt => 'cleartext'
159+
mysqltransactions => 'On'
160+
mysqlgetpw => 'SELECT Password FROM users WHERE User="\L"'
161+
mysqlgetuid => 'SELECT Uid FROM users WHERE User="\L"'
162+
mysqldefaultuid => '1000'
163+
mysqlgetgid => 'SELECT Gid FROM users WHERE User="\L"'
164+
mysqldefaultgid => '1000'
165+
mysqlgetdir => 'SELECT Dir FROM users WHERE User="\L"'
166+
mysqlforcetildeexpansion => '0'
167+
mysqlgetqtafs => 'SELECT QuotaFiles FROM users WHERE User="\L"'
168+
mysqlgetqtasz => 'SELECT QuotaSize FROM users WHERE User="\L"'
169+
mysqlgetratioul => 'SELECT ULRatio FROM users WHERE User="\L"'
170+
mysqlgetratiodl => 'SELECT DLRatio FROM users WHERE User="\L"'
171+
mysqlgetbandwidthul => 'SELECT ULBandwidth FROM users WHERE User="\L"'
172+
mysqlgetbandwidthdl => 'SELECT DLBandwidth FROM users WHERE User="\L"'
72173
},
174+
}
175+
176+
### Enabling PGSQL Authentication
177+
178+
Options for `pureftpd-pgsql.conf`] should be passed into the `config_pgsql`
179+
class parameter as a hash.
180+
181+
class { 'pureftpd':
73182
config_pgsql => {
74183
pgsqlserver => 'localhost',
75184
pgsqlport => '5432',
@@ -91,3 +200,34 @@ defaults) and start `pure-ftpd` as a stand alone daemon.
91200
pgsqlgetbandwidthdl => 'SELECT DLBandwidth FROM users WHERE User=\'\L\'',
92201
},
93202
}
203+
204+
### Canonical Example
205+
206+
Limitations
207+
-----------
208+
209+
At present, this module is only capable of installing the `pure-ftpd` package
210+
and enabling it as a daemonized service. The lack of uninstallation support is
211+
probably a bug.
212+
213+
Only support for `$::osfamily == 'RedHat'` has been implemented. Adding
214+
support for other platform should be trivial but needs to involve full up
215+
integration testing.
216+
217+
The supported configuration file values were discovered via code inspection of
218+
the `pure-ftpd` `v1.0.31` release. There are possibly new configuration
219+
values that have been introduced it subsequent releases. Any configuration
220+
values present in a `pure-ftpd` but not supported by this module should be
221+
considered a bug.
222+
223+
### Tested Platforms
224+
225+
* el6.x
226+
227+
228+
Support
229+
-------
230+
231+
Please log tickets and issues at
232+
[github](https://github.com/jhoblitt/puppet-pureftpd/issues)
233+

manifests/config.pp

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
# == Class: pureftpd::config
22
#
3-
# This module manages the pure-ftpd server configuration file
3+
# Manages the `pure-ftpd.conf` file. This class should be considered private.
44
#
5-
# === Parameters
6-
#
7-
# === Authors
8-
#
9-
# 5Ub-Z3r0
10-
# Joshua Hoblitt <[email protected]>
115
#
126
class pureftpd::config(
137
$ipv4only = undef,

manifests/config/ldap.pp

+2-10
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
# == Class: pureftpd::config::ldap
22
#
3-
# This module manages the pure-ftpd configuration files with LDAP
4-
# authentication
3+
# Manages the `pureftpd-ldap.conf` file. This class should be considered
4+
# private.
55
#
6-
# === Parameters
76
#
8-
#
9-
# === Authors
10-
#
11-
# 5Ub-Z3r0
12-
# Joshua Hoblitt <[email protected]>
13-
#
14-
157
class pureftpd::config::ldap (
168
$ldapserver = undef,
179
$ldapport = undef,

manifests/config/mysql.pp

+2-14
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,9 @@
11
# == Class: pureftpd::config::mysql
22
#
3-
# This module manages the pure-ftpd configuration files with mysql
4-
# authentication
3+
# Manages the `pureftpd-mysql.conf` file. This class should be considered
4+
# private.
55
#
6-
# === Parameters
76
#
8-
#
9-
# === Authors
10-
#
11-
# 5Ub-Z3r0
12-
# Joshua Hoblitt <[email protected]>
13-
#
14-
# === TODO:
15-
#
16-
# - implement template and variables for the mysql config file
17-
#
18-
197
class pureftpd::config::mysql (
208
$mysqlserver = undef,
219
$mysqlport = undef,

manifests/config/pgsql.pp

+2-10
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
# == Class: pureftpd::config::pgsql
22
#
3-
# This module manages the pure-ftpd configuration files with pgsql
4-
# authentication
3+
# Manages the `pureftpd-pgsql.conf` file. This class should be considered
4+
# private.
55
#
6-
# === Authors
7-
#
8-
# 5Ub-Z3r0
9-
# Joshua Hoblitt <[email protected]>
10-
#
11-
# === TODO:
12-
#
13-
# - implement template and variables for the pgsql config file
146
#
157
class pureftpd::config::pgsql (
168
$pgsqlserver = undef,

manifests/init.pp

+29-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,44 @@
11
# == Class: pureftpd
22
#
3-
# This class installs, configures, and enables the pure-ftpd server
3+
# This class installs, configures, and enables the pure-ftpd package
44
#
55
# === Parameters
66
#
77
# [*use_selinux*]
8+
# Boolean. Manages whether or not to enable the selinux extensions.
9+
#
810
# Optional, defaults to false.
9-
# Manages whether or not to enable the selinux extensions.
1011
#
1112
# [*config*]
13+
# A hash of configuration file options to be created in `pure-ftpd.conf`.
14+
#
15+
# Optional, defaults to `{}`.
16+
#
17+
# [*config_ldap*]
18+
# A hash of configuration file options to be created in `pureftpd-ldap.conf`.
19+
#
20+
# Optional, defaults to `{}`.
21+
#
22+
# [*config_mysql*]
23+
# A hash of configuration file options to be created in `pureftpd-mysql.conf`.
24+
#
25+
# Optional, defaults to `{}`.
26+
#
27+
# [*config_pgsql*]
28+
# A hash of configuration file options to be created in `pureftpd-pgsql.conf`.
29+
#
1230
# Optional, defaults to `{}`.
1331
#
14-
# === Authors
32+
# === Examples
33+
#
34+
# class { 'pureftpd':
35+
# use_selinux => true,
36+
# config => {
37+
# ipv4only => 'Yes',
38+
# passiveportrange => '49999:59999',
39+
# },
40+
# }
1541
#
16-
# 5Ub-Z3r0
1742
#
1843
class pureftpd (
1944
$use_selinux = false,

0 commit comments

Comments
 (0)