Perfect response. Thanks!!
On Thursday, October 31, 2013 11:49:38 AM UTC-4, John wrote:
>
> 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/f673d2df-3dcc-4522-8044-a535942ddbad%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.