Hi,

my servers have some kind of "role" like "app1" or "app1,app2" which im 
getting out of a selfmade global facter variable.
Im then going through this list and include classes depending on the 
content of this variable.

# site.pp

define iterateSystemRole {
        case $name {
                'app1':   {
                        include app1
                        $defineVariable = 'content'
                }
                'app2':   {
                        include app2                
                }
                default:  { }
        }
}

$cur_system_role = split($::system_role, ',')
iterateSystemRole { $cur_system_role: }

node default {
        inlude xyz
}

Now i want to work with variables too. Like checking in class 'app1' if 
variable $defineVariable is set to "content".
I would do this like:

# app1.pp

class app1 {
  if $::iterateSystemRole::defineVariable == 'content' {
     doSomething
  }
}

But the variable $::iterateSystemRole::defineVariable is always undefined. 
So i cant get the content from $defineVariable.

How can i get this working?
I googled a lot but did not find a way... I think its an issue with scoping 
but i hope there is a way to get this working...

Best regards!


-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/b042bf85-3a5a-4e50-9513-142348ee3695%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to