Note the following code snippet I've written for my puppet module.  My 
question is there a better (perhaps more efficient) method to accomplish 
this in a puppet module?  The logic requires if a string (say aaa) is in an 
ldap_conf file, then install a specific sshd config, if bbb, then another 
sshd config, finally if ccc then install another sshd config file.  The 
"file" section is meant to represent a specif SSHD config  There is also a 
requirement to support different configurations for different operating 
systems?  Thanks in advance.

 if ($ldap_conf_file =~ /aaa/) and ($operatingsystem == redhat)
     {
     file { '/etc/ssh/sshd_config': ensure => present }
     }

  if ($ldap_conf_file =~ /aaa/)  and ($operatingsystem == freebsd)
     {
     file { '/etc/ssh/sshd_config': ensure => present }
     }

  if ($ldap_conf_file =~ /aaa/)  and ($operatingsystem == aix)
     {
     file { '/etc/ssh/sshd_config': ensure => present }
     }

  if ($ldap_conf_file =~ /bbb/)  and ($operatingsystem == redhat)
     {
     file { '/etc/ssh/sshd_config': ensure => present }
     }

  if ($ldap_conf_file =~ /bbb/)  and ($operatingsystem == freebsd)
     {
     file { '/etc/ssh/sshd_config': ensure => present }
     }

  if ($ldap_conf_file =~ /bbb/)  and ($operatingsystem == aix)
     {
     file { '/etc/ssh/sshd_config': ensure => present }
     }

  if ($ldap_conf_file =~ /ccc/)  and ($operatingsystem == redhat)
     {
     file { '/etc/ssh/sshd_config': ensure => present }
     }

  if ($ldap_conf_file =~ /ccc/)  and ($operatingsystem == freebsd)
     {
     file { '/etc/ssh/sshd_config': ensure => present }
     }

  if ($ldap_conf_file =~ /ccc/)  and ($operatingsystem == aix)
     {
     file { '/etc/ssh/sshd_config': ensure => present }
     }

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/64f4e2a2-bd39-4bcf-90c7-19db28e24225%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to