Skip to content

Commit d56464f

Browse files
author
Joshua Hoblitt
committed
refactor pureftpd::config similar to pureftpd::config::ldap
to allow the same erb template to be shared between pureftpd::config and pureftpd::config::ldap
1 parent d351586 commit d56464f

File tree

5 files changed

+124
-658
lines changed

5 files changed

+124
-658
lines changed

manifests/config.pp

+117-111
Original file line numberDiff line numberDiff line change
@@ -1,126 +1,132 @@
1-
# == Define: pureftpd::config
1+
# == Class: pureftpd::config
22
#
33
# This module manages the pure-ftpd server configuration file
44
#
55
# === Parameters
66
#
7-
# [*use_selinux*]
8-
# Optional, defaults to false.
9-
# Manages whether or not to enable selinux extensions.
10-
#
11-
# [*allow_anonymous*]
12-
# Optional, defaults to false.
13-
# Manages whether or not to allow anonymous users.
14-
#
15-
# [*allow_fxp*]
16-
# Optional, defaults to false.
17-
# Manages whether or not to allow the fxp protocol
18-
#
19-
# [*user_bandwidth*]
20-
# Optional, defaults to undef.
21-
# Defines the maximum bandwidth that the can be used, in the form
22-
# $kb_download:$kb_upload (e.g., 1800:1800).
23-
#
24-
# [*max_clients_number*]
25-
# Optional, defaults to 50.
26-
# Maximum number of simultaneous users that the server can manage.
27-
#
28-
# [*max_clients_per_ip*]
29-
# Optional, defaults to 8.
30-
# Maximum number of different clients that can come from a single IP
31-
#
32-
# [*umask*]
33-
# Optional, defaults to 133:022.
34-
# Specifies the user mask of the uploaded files/directories, in the form
35-
# $file_umask:$dir_umask (e.g., 177:077).
36-
#
37-
# [*min_uid*]
38-
# Optional, defaults to 500.
39-
# The minimum user id that can be accepted as an ftp user.
40-
#
41-
# [*allow_chmod*]
42-
# Optional, defaults to false.
43-
# Whether or not users are allowed to change ownerships of their files.
44-
#
45-
# [*use_tls*]
46-
# Optional, defaults to false.
47-
# Whether or not to accept tls connections in addition to normal ones.
48-
# TODO: Remember to place your server certificate in
49-
# /etc/ssl/private/pure-ftpd.pem
50-
#
51-
# [*force_passive_ip*]
52-
# Optional, defaults to undef (not set)
53-
# Force an IP address in PASV/EPSV/SPSV replies
54-
#
55-
# [*motd_file*]
56-
# Optional, defaults to undef (use the dynamic provided file).
57-
# Manages the location of the server motd file, if any.
58-
#
59-
# === Examples
60-
#
61-
# pureftpd::config { 'ftp-server':
62-
# user_bandwidth => '1800:1800'
63-
# }
64-
#
657
# === Authors
668
#
679
# 5Ub-Z3r0
10+
# Joshua Hoblitt <[email protected]>
6811
#
12+
6913
class pureftpd::config(
70-
$chrooteveryone = true,
71-
$trustedgid = '100',
72-
$brokenclientscompatibility = false,
73-
$maxclientsnumber = '50',
74-
$maxclientsperip = '8',
75-
$verboselog = false,
76-
$displaydotfiles = true,
77-
$anonymousonly = false,
78-
$noanonymous = false,
79-
$syslogfacility = 'ftp',
80-
$fortunesfile = false,
81-
$dontresolve = true,
82-
$maxidletime = '15',
83-
$ldapconfigfile = false,
84-
$mysqlconfigfile = false,
85-
$pgsqlconfigfile = false,
86-
$pamauthentication = true,
87-
$unixauthentication = false,
88-
$limitrecursion = '10000 8',
89-
$anonymouscancreatedirs = false,
90-
$maxload = '4',
91-
$passiveportrange = undef,
92-
$forcepassiveip = undef,
93-
$anonymousratio = undef,
94-
$userratio = undef,
95-
$antiwarez = true,
96-
$bind = false, # false means bind to ALL
97-
$anonymousbandwidth = false,
98-
$userbandwidth = undef,
99-
$umask = '133:022',
100-
$minuid = '500',
101-
$useftpusers = false,
102-
$allowuserfxp = false,
103-
$allowanonymousfxp = false,
104-
$prohibitdotfileswrite = false,
105-
$prohibitdotfilesread = false,
106-
$autorename = false,
107-
$anonymouscantupload = true,
108-
$trustedip = false,
109-
$logpid = false,
110-
$altlog = 'clf:/var/log/pureftpd.log',
111-
$nochmod = false,
112-
$createhomedir = false,
113-
$quota = false,
114-
$maxdiskusage = '99',
115-
$norename = false,
116-
$customerproof = true,
117-
$peruserlimits = false,
118-
$notruncate = false,
119-
$tls = false,
120-
$ipv4only = false,
121-
$ipv6only = false,
14+
$IPV4Only = undef,
15+
$IPV6Only = undef,
16+
$ChrootEveryone = undef,
17+
$BrokenClientsCompatibility = undef,
18+
$Daemonize = undef,
19+
$VerboseLog = undef,
20+
$DisplayDotFiles = undef,
21+
$AnonymousOnly = undef,
22+
$NoAnonymous = undef,
23+
$DontResolve = undef,
24+
$AnonymousCanCreateDirs = undef,
25+
$NATmode = undef,
26+
$CallUploadScript = undef,
27+
$AntiWarez = undef,
28+
$AllowUserFXP = undef,
29+
$AllowAnonymousFXP = undef,
30+
$ProhibitDotFilesWrite = undef,
31+
$ProhibitDotFilesRead = undef,
32+
$AllowDotFiles = undef,
33+
$AutoRename = undef,
34+
$AnonymousCantUpload = undef,
35+
$LogPID = undef,
36+
$NoChmod = undef,
37+
$KeepAllFiles = undef,
38+
$CreateHomeDir = undef,
39+
$NoRename = undef,
40+
$CustomerProof = undef,
41+
$NoTruncate = undef,
42+
$FileSystemCharset = undef,
43+
$ClientCharset = undef,
44+
$SyslogFacility = undef,
45+
$FortunesFile = undef,
46+
$ForcePassiveIP = undef,
47+
$Bind = undef,
48+
$AnonymousBandwidth = undef,
49+
$UserBandwidth = undef,
50+
$TrustedIP = undef,
51+
$AltLog = undef,
52+
$PIDFile = undef,
53+
$MaxIdleTime = undef,
54+
$MaxDiskUsage = undef,
55+
$TrustedGID = undef,
56+
$MaxClientsNumber = undef,
57+
$MaxClientsPerIP = undef,
58+
$MaxLoad = undef,
59+
$MinUID = undef,
60+
$TLS = undef,
61+
$LimitRecursion = undef,
62+
$PassivePortRange = undef,
63+
$AnonymousRatio = undef,
64+
$UserRatio = undef,
65+
$Umask = undef,
12266
) inherits pureftpd::params {
12367

68+
$conf_options = [
69+
'IPV4Only',
70+
'IPV6Only',
71+
'ChrootEveryone',
72+
'BrokenClientsCompatibility',
73+
'Daemonize',
74+
'VerboseLog',
75+
'DisplayDotFiles',
76+
'AnonymousOnly',
77+
'NoAnonymous',
78+
'DontResolve',
79+
'AnonymousCanCreateDirs',
80+
'NATmode',
81+
'CallUploadScript',
82+
'AntiWarez',
83+
'AllowUserFXP',
84+
'AllowAnonymousFXP',
85+
'ProhibitDotFilesWrite',
86+
'ProhibitDotFilesRead',
87+
'AllowDotFiles',
88+
'AutoRename',
89+
'AnonymousCantUpload',
90+
'LogPID',
91+
'NoChmod',
92+
'KeepAllFiles',
93+
'CreateHomeDir',
94+
'NoRename',
95+
'CustomerProof',
96+
'NoTruncate',
97+
'FileSystemCharset',
98+
'ClientCharset',
99+
'SyslogFacility',
100+
'FortunesFile',
101+
'ForcePassiveIP',
102+
'Bind',
103+
'AnonymousBandwidth',
104+
'UserBandwidth',
105+
'TrustedIP',
106+
'AltLog',
107+
'PIDFile',
108+
'MaxIdleTime',
109+
'MaxDiskUsage',
110+
'TrustedGID',
111+
'MaxClientsNumber',
112+
'MaxClientsPerIP',
113+
'MaxLoad',
114+
'MinUID',
115+
'TLS',
116+
'LimitRecursion',
117+
'PassivePortRange',
118+
'AnonymousRatio',
119+
'UserRatio',
120+
'Umask',
121+
'Quota',
122+
'PerUserLimits',
123+
'LDAPConfigFile',
124+
'MySQLConfigFile',
125+
'PGSQLConfigFile',
126+
'PureDB',
127+
'ExtAuth',
128+
]
129+
124130
file { $pureftpd::params::conf_path:
125131
ensure => file,
126132
content => template("${module_name}/${pureftpd::params::conf_erb}"),

manifests/config/ldap.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
) inherits pureftpd::params {
3030

3131
# the complete list of options is defined in pure-ftpd/src/log_ldap_p.h
32-
$ldap_conf_options = [
32+
$conf_options = [
3333
'LDAPPort',
3434
'LDAPBindDN',
3535
'LDAPBindPW',

manifests/params.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
$conf_erb = 'redhat/pure-ftpd.conf.erb'
2121
$conf_path = "${config_dir}/pure-ftpd.conf"
2222

23-
$ldap_conf_erb = 'redhat/pureftpd-ldap.conf.erb'
23+
$ldap_conf_erb = 'redhat/pure-ftpd.conf.erb'
2424
$ldap_conf_path = "${config_dir}/pureftpd-ldap.conf"
2525

2626
$mysql_conf_erb = 'redhat/pureftpd-mysql.conf.erb'

0 commit comments

Comments
 (0)