From bf53e2f36ecd4239737fbecae75146eb81f9f40f Mon Sep 17 00:00:00 2001 From: Garrett Honeycutt Date: Sat, 9 Aug 2014 10:35:59 -0400 Subject: [PATCH] Fixup gmcgrath's contribution to comply with style --- manifests/init.pp | 37 ++++++++++++++++--------------------- templates/sshd_config.erb | 8 ++++---- 2 files changed, 20 insertions(+), 25 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 5de46f5..582d076 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -483,40 +483,35 @@ class ssh ( $supported_loglevel_vals=['QUIET', 'FATAL', 'ERROR', 'INFO', 'VERBOSE'] validate_re($sshd_config_loglevel, $supported_loglevel_vals) -#enable hiera merging for allow groups and allow users + #enable hiera merging for allow groups and allow users if $hiera_merge_real == true { - $real_sshd_config_denygroups = hiera_array('ssh::sshd_config_denygroups', undef) - $real_sshd_config_denyusers = hiera_array('ssh::sshd_config_denyusers', undef) - $real_sshd_config_allowgroups = hiera_array('ssh::sshd_config_allowgroups', undef) - $real_sshd_config_allowusers = hiera_array('ssh::sshd_config_allowusers', undef) - } - else{ - $real_sshd_config_denygroups = $sshd_config_denygroups - $real_sshd_config_denyusers = $sshd_config_denyusers - $real_sshd_config_allowgroups = $sshd_config_allowgroups - $real_sshd_config_allowusers = $sshd_config_allowusers - } - - + $sshd_config_denygroups_real = hiera_array('ssh::sshd_config_denygroups', undef) + $sshd_config_denyusers_real = hiera_array('ssh::sshd_config_denyusers', undef) + $sshd_config_allowgroups_real = hiera_array('ssh::sshd_config_allowgroups', undef) + $sshd_config_allowusers_real = hiera_array('ssh::sshd_config_allowusers', undef) + } else { + $sshd_config_denygroups_real = $sshd_config_denygroups + $sshd_config_denyusers_real = $sshd_config_denyusers + $sshd_config_allowgroups_real = $sshd_config_allowgroups + $sshd_config_allowusers_real = $sshd_config_allowusers + } if $real_sshd_config_denyusers != undef { validate_array($real_sshd_config_denyusers) - } + } if $real_sshd_config_denygroups != undef { validate_array($real_sshd_config_denygroups) - } + } if $real_sshd_config_allowusers != undef { validate_array($real_sshd_config_allowusers) - } + } if $real_sshd_config_allowgroups != undef { validate_array($real_sshd_config_allowgroups) - } - - - + } + package { $packages_real: ensure => installed, source => $ssh_package_source_real, diff --git a/templates/sshd_config.erb b/templates/sshd_config.erb index 40c41bd..95cdc7e 100644 --- a/templates/sshd_config.erb +++ b/templates/sshd_config.erb @@ -167,14 +167,14 @@ Ciphers <%= @sshd_config_ciphers.join(',') %> MACs <%= @sshd_config_macs.join(',') %> <% end -%> <% if @sshd_config_denyusers -%> -DenyUsers <%= @real_sshd_config_denyusers.join(' ') %> +DenyUsers <%= @sshd_config_denyusers_real.join(' ') %> <% end -%> <% if @sshd_config_denygroups -%> -DenyGroups <%= @real_sshd_config_denygroups.join(' ') %> +DenyGroups <%= @sshd_config_denygroups_real.join(' ') %> <% end -%> <% if @sshd_config_allowusers -%> -AllowUsers <%= @real_sshd_config_allowusers.join(' ') %> +AllowUsers <%= @sshd_config_allowusers_real.join(' ') %> <% end -%> <% if @sshd_config_allowgroups -%> -AllowGroups <%= @real_sshd_config_allowgroups.join(' ') %> +AllowGroups <%= @sshd_config_allowgroups_real.join(' ') %> <% end -%>