Skip to content

Commit

Permalink
don't fail if config section does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
fraenki committed May 2, 2016
1 parent be87695 commit c91d96c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
$load_modules = $::proftpd::load_modules

# create AuthUserFile/AuthGroupFile to allow the configtest to succeed
if $real_options['ROOT']['AuthUserFile'] {
if $real_options['ROOT'] and $real_options['ROOT']['AuthUserFile'] {
$authuser_require = File["${real_options['ROOT']['AuthUserFile']}"]
if !defined(File["${real_options['ROOT']['AuthUserFile']}"]) {
file { "${real_options['ROOT']['AuthUserFile']}":
Expand All @@ -39,7 +39,8 @@
before => File[$::proftpd::config],
}
}
} elsif $real_options['Global']['AuthUserFile'] {
} elsif $real_options['Global'] and
$real_options['Global']['AuthUserFile'] {
$authuser_require = File["${real_options['Global']['AuthUserFile']}"]
if !defined(File["${real_options['Global']['AuthUserFile']}"]) {
file { "${real_options['Global']['AuthUserFile']}":
Expand All @@ -49,7 +50,7 @@
}
}
}
if $real_options['ROOT']['AuthGroupFile'] {
if $real_options['ROOT'] and $real_options['ROOT']['AuthGroupFile'] {
$authgroup_require = File["${real_options['ROOT']['AuthGroupFile']}"]
if !defined(File["${real_options['ROOT']['AuthGroupFile']}"]) {
file { "${real_options['ROOT']['AuthGroupFile']}":
Expand All @@ -58,7 +59,8 @@
before => File[$::proftpd::config],
}
}
} elsif $real_options['Global']['AuthGroupFile'] {
} elsif $real_options['Global'] and
$real_options['Global']['AuthGroupFile'] {
$authgroup_require = File["${real_options['Global']['AuthGroupFile']}"]
if !defined(File["${real_options['Global']['AuthGroupFile']}"]) {
file { "${real_options['Global']['AuthGroupFile']}":
Expand Down

0 comments on commit c91d96c

Please sign in to comment.