Skip to content

Commit

Permalink
Allow turning off storeconfigs/hostkey managment
Browse files Browse the repository at this point in the history
  • Loading branch information
rfay committed Mar 7, 2014
1 parent 58c4944 commit 1e597d7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
4 changes: 3 additions & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ or
```

### Server only
Host keys will be collected for client distribution
Host keys will be collected for client distribution unless
storeconfigs_enabled => false

```
include ssh::server
Expand All @@ -89,6 +90,7 @@ or

```
class { 'ssh::server':
storeconfigs_enabled => false,
options => {
'Match User www-data' => {
'ChrootDirectory' => '%h',
Expand Down
31 changes: 22 additions & 9 deletions manifests/server.pp
Original file line number Diff line number Diff line change
@@ -1,23 +1,36 @@
class ssh::server(
$ensure = present,
$storeconfigs_enabled = true,
$options = {}
) inherits ssh::params {
$merged_options = merge($ssh::params::sshd_default_options, $options)

include ssh::server::install
include ssh::server::config
include ssh::server::service
include ssh::hostkeys
include ssh::knownhosts

anchor { 'ssh::server::start': }
anchor { 'ssh::server::end': }

Anchor['ssh::server::start'] ->
Class['ssh::server::install'] ->
Class['ssh::server::config'] ~>
Class['ssh::server::service'] ->
Class['ssh::hostkeys'] ->
Class['ssh::knownhosts'] ->
Anchor['ssh::server::end']
# Provide option to *not* use storeconfigs/puppetdb, which means not managing
# hostkeys and knownhosts
if ($storeconfigs_enabled) {
include ssh::hostkeys
include ssh::knownhosts

Anchor['ssh::server::start'] ->
Class['ssh::server::install'] ->
Class['ssh::server::config'] ~>
Class['ssh::server::service'] ->
Class['ssh::hostkeys'] ->
Class['ssh::knownhosts'] ->
Anchor['ssh::server::end']
}
else {
Anchor['ssh::server::start'] ->
Class['ssh::server::install'] ->
Class['ssh::server::config'] ~>
Class['ssh::server::service'] ->
Anchor['ssh::server::end']
}
}

0 comments on commit 1e597d7

Please sign in to comment.