> Example class that brings on this behaviour:
>
> Class ldap::setup {
> $loc = getLocation() #Custom function that returns a location
> based on IP address fact
>
> case $loc {
> london: {
> $bind = "cn=base,dc=site,dc=com"
> notice ("Target 1 - bind - ${bind}")
> }
> ...
> default: {
> $bind = "cn=def,dc=site,dc=com"
> notice ("Target 1 - bind - ${bind}")
> }
> }
>
> notice ("Target 2 - bind - ${bind}")
> $ldapParams = callCustomFunction($bind)
>
> exec { authconfig:
> command => "authconfig ${ldapParams}"
> path => ["/usr/sbin"]
> }
> }
>
> So when this class is used, Target 2 fires before Target 1 is called.
> As a result, the call to callCustomFunction has an empty parameter
> list as $bind has not been set yet. The solution is to add the
> callCustomFunction call to every arm of the case. When you have 20
> plus conditionals, this is not elegant.
>
> Any ideas?
>
> Geoff Newell
------------------------------------------------------------------------
For important statutory and regulatory disclosures and more information about
Barclays Capital, please visit our web site at barcap.com.
Internet communications are not secure and therefore the Barclays Group does not
accept legal responsibility for the contents of this message. Although the
Barclays Group operates anti-virus programmes, it does not accept responsibility
for any damage whatsoever that is caused by viruses being passed. Any views or
opinions presented are solely those of the author and do not necessarily
represent those of the Barclays Group. Replies to this email may be monitored
by the Barclays Group for operational or business reasons.
Barclays Capital is the investment banking division of Barclays Bank PLC, a
company registered in England (number 1026167) with its registered office at 1
Churchill Place, London, E14 5HP. This email may relate to or be sent from other
members of the Barclays Group.
------------------------------------------------------------------------