Skip to content

Commit

Permalink
Add support for ssl certificates
Browse files Browse the repository at this point in the history
  • Loading branch information
dobrerazvan committed Mar 1, 2016
1 parent 7e67d3a commit ebb3e32
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
$config_pgsql = {},
$extauth_enabled = false,
$extauth_handler = '',
$ssl_certificates = '',
) {
validate_bool($use_selinux)
validate_hash($config)
Expand All @@ -70,6 +71,7 @@
validate_hash($config_pgsql)
validate_bool($extauth_enabled)
validate_string($extauth_handler)
validate_string($ssl_certificates)

include pureftpd::service

Expand Down Expand Up @@ -149,6 +151,25 @@

create_resources( 'class', { 'pureftpd::config' => $safe_config } )

if $ssl_certificates != '' {
if $ssl_certificates =~ /^puppet:\/\// {
file {'/etc/pki/pure-ftpd/pure-ftpd.pem':
ensure => present,
owner => 'root',
group => 'root',
mode => '0400',
source => $ssl_certificates,
notify => Class[ 'pureftpd::service' ]
}
} else {
file {'/etc/pki/pure-ftpd/pure-ftpd.pem':
ensure => link,
target => $ssl_certificates,
notify => Class[ 'pureftpd::service' ]
}
}
}

Class[ 'pureftpd::install' ] ->
Class[ 'pureftpd::config' ] ->
Class[ 'pureftpd::service' ] ->
Expand Down

0 comments on commit ebb3e32

Please sign in to comment.