On Wed, Oct 12, 2011 at 2:23 PM, Mohamed Lrhazi <lrh...@gmail.com> wrote: > I have a custom fact called: gu_app_oracle_rac > > Which gets set, indirectly, by puppet itself... and so in the very > first run it does not exist... I will be changing the whole business > of how I set these facts, but I need a quick workaround to the > following issue... > > I have some templates using that variable and so the first run fails > because the var is undefined, and so I added this to site.pp: > > > if !defined(gu_app_oracle_rac) { > $gu_app_oracle_rac = false > } > > > Now, this allows the first run, maybe a few, to work... then when the > fact comes to life, I get: > > Cannot reassign variable gu_app_oracle_rac in site.pp > > Why doesn't the *if* statement do what I expect it to do?
Pretty sure defined is for resource not variables. I'm not sure how gu_app_oracle_rac is used, it might be easier to handle undef as false instead. if ! $fact_gu_app_oracle_rac { $gu_app_oracle_rac = false } else { $gu_app_oracle_rac = $fact_gu_app_oracle_rac } Thanks, Nan -- 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.