Wow that's a smart way of solving this issue, I haven't thought of that! Tnx!
Kind regards, Ivo On Tue, 17 Mar 2009 10:38:57 -0700, Joshua Anderson <joshua_ander...@mac.com> wrote: > On Mar 17, 2009, at 7:45 AM, Ivo van der Meer wrote: > >> Is my syntax wrong or isn't it possible yet to use the "ensure" >> statement >> like this ? >> >> <snip> >> "sym_ldap.conf": >> path => $operatingsystem ? { >> "FreeBSD" => "/usr/local/etc/ldap.conf", >> "Debian" => "/etc/ldap.conf" >> }, >> ensure => openldap-client::File["ldap.conf"]; >> >> "sym_ldap.secret": >> path => $operatingsystem ? { >> "FreeBSD" => "/usr/local/etc/ldap.secret", >> "Debian" => "/etc/ldap.secret" >> }, >> ensure => File["ldap.secret"]; >> </snip> > > Ivo, > > I don't believe that you can use a file reference that way, but here's > how I would avoid having to specify the full paths multiple times: > > > class openldap-client { > case $operatingsystem { > "FreeBSD": { > $ldap_conf_dir = "/usr/local/etc/openldap" > $ldap_link_dir = "/usr/local/etc" > } > "Debian": { > $ldap_conf_dir = "/etc/ldap" > $ldap_link_dir = "/etc" > } > } > > file { "ldap.conf": > path => "${ldap_conf_dir}/ldap.conf", > ... > } > > file { "ldap.secret": > path => "${ldap_conf_dir}/ldap.secret", > ... > } > > file { "sym_ldap.conf": > ensure => "$ldap_conf_dir}/ldap.conf" > path => "${ldap_link_dir}/ldap.conf" > ... > } > > file { "sym_ldap.secret": > ensure => "$ldap_conf_dir}/ldap.secret" > path => "${ldap_link_dir}/ldap.secret" > ... > } > > ... > > } > > > -Josh > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---