Skip to content

Commit 38097ad

Browse files
author
Joshua Hoblitt
committed
add $config_mysql param to class pureftpd
1 parent 1c81250 commit 38097ad

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

manifests/init.pp

+21
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@
4444
$use_selinux = false,
4545
$config = {},
4646
$config_ldap = {},
47+
$config_mysql = {},
4748
$config_pgsql = {},
4849
) {
4950
validate_bool($use_selinux)
5051
validate_hash($config)
5152
validate_hash($config_ldap)
53+
validate_hash($config_mysql)
5254
validate_hash($config_pgsql)
5355

5456
include pureftpd::service
@@ -73,6 +75,24 @@
7375
Class[ 'pureftpd::config::ldap' ]
7476
}
7577

78+
if ! empty($config_mysql) {
79+
# insert the path to the mysql conf file into pure-ftpd.conf
80+
$enable_mysql = { mysqlconfigfile => $pureftpd::params::mysql_conf_path }
81+
82+
# instantiate a pureftpd::config::mysql that will notify the service class
83+
$safe_config_mysql = merge($config_mysql,
84+
{ notify => Class[ 'pureftpd::service' ] }
85+
)
86+
create_resources( 'class',
87+
{ 'pureftpd::config::mysql' => $safe_config_mysql }
88+
)
89+
90+
# only try to create the mysql configuration file after the pureftpd package
91+
# is installed and configuration; otherwise the dir may not exist yet
92+
Class[ 'pureftpd::config' ] ->
93+
Class[ 'pureftpd::config::mysql' ]
94+
}
95+
7696
if ! empty($config_pgsql) {
7797
# insert the path to the pgsql conf file into pure-ftpd.conf
7898
$enable_pgsql = { pgsqlconfigfile => $pureftpd::params::pgsql_conf_path }
@@ -96,6 +116,7 @@
96116
$config,
97117
{ notify => Class[ 'pureftpd::service' ] },
98118
$enable_ldap,
119+
$enable_mysql,
99120
$enable_pgsql
100121
)
101122

0 commit comments

Comments
 (0)