Issue #18093 has been reported by Guillaume Fenollar.

----------------------------------------
Bug #18093: Case and selectors don't work
https://projects.puppetlabs.com/issues/18093

Author: Guillaume Fenollar
Status: Unreviewed
Priority: Normal
Assignee: 
Category: modules
Target version: 
Affected Puppet version: 2.6.2
Keywords: case,selector,ensure
Branch: 


Hello, I'm trying to do something like this:

    user{'username':
    ensure=>"$state",
    (...),
    }

To guess the value of $state, I tried to use selectors and case matching 
following the documentation , with no success.
In the top of my class, I added this case :

    case $hostname {
    host1: { $state = "present" }
    host2: { $state = "present" }
    default: { $state = "absent" }
    }

As you understand, I just want to be sure this user will be absent on every 
agents, except those I tell. I also tried selectors:

    $state = $hostname ? {
    host1 => 'present',
    host2 => 'present',
    default => 'absent',
    }

Everytime, I got a "Error 400 on SERVER: Could not find class myclass::username 
in namespaces myclass".
I verified that the rest of the class file is ok. Everything works if I comment 
the selectors (or case) block, and replacing the "ensure=>$state" by 
"ensure=>absent". It proves that my selectors/case blocks are not understood by 
puppet (or the ensure=>$state) and that's pretty frustrating.

Sorry if it's a well known issue, and thanks for the investigation!

Regards


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to