Thanks for the reply Nikolay,

If I have a class like the following:
class role {
$myrole = ymllookup('web_role')
notify{"this is my role: $myrole": }
}

I then use the ymllookup parser that I grabbed from http://projects.puppetlabs.com/attachments/1297/ymllookup.rb which will parse my /etc/puppet/manifest/extdata directory looking for assignments of the 'web_role' - using the following precedence.

# For external lookups
$ymllookup_datadir = "/etc/puppet/manifests/extdata"
$ymllookup_precedence = ["node/%{fqdn}", "location/%{location}", "role/%{hitwise_role}", "common/common"]

So I would have something like

cat /etc/puppet/manifest/extdata/node/testnode.yml
web_role: 'php_zend'

I create the module feature like so:
cat features/modules/role/role.feature
Feature: role
In order to run a client webserver
As a admin
I want role to be installed

Scenario: testing role
Given a node specified by "features/yaml/testnode.yaml"
Given a node of class "role"
When I compile the catalog
Then the node should notify "this is my role: php_zend"

and it runs like this:

Feature: role
In order to run a client webserver
As a admin
I want role to be installed

Scenario: testing role # features/modules/role/role.feature:6
Given a node specified by "features/yaml/testnode.yaml" # cucumber-puppet-0.3.5/lib/cucumber-puppet/steps.rb:1
Given a node of class "role" # features/steps/puppet.rb:1
When I compile the catalog # features/steps/puppet.rb:25
No match found for 'web_role' in any data file during ymllookup() at /home/dennism/workspace/ChangeControl/puppet/trunk/modules/role/manifests/init.pp:2 on node testnode (Puppet::Error)
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:30:in `compile'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:77:in `compile'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:198:in `benchmark'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:75:in `compile' /usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:34:in `find'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/indirection.rb:188:in `find'
./features/steps/puppet.rb:26:in `/^I compile the catalog$/'
features/modules/role/role.feature:9:in `When I compile the catalog'
Then the node should notify "this is my role: php_zend" # features/steps/puppet.rb:41

Failing Scenarios:
cucumber features/modules/role/role.feature:6 # Scenario: testing role

1 scenario (1 failed)
4 steps (1 failed, 1 skipped, 2 passed)

That help?

Cheers,
Den
On , Nikolay Sturm <[email protected]> wrote:
* denmat [2011-09-12]:

> The issue here is that class roles::prod_webserver doesn't expect to

> be passed any values, but there is a bunch of ymllookups that pull

> values in from local yaml files. This causes errors when it complains

> about either invalid parameter (which it is in the above example) or

> failed lookup of value when I remove those parameters.



Please provide me with a minimal example to reproduce your problem and

I'll have a look.



cheers,



Nikolay



--

"It's all part of my Can't-Do approach to life." Wally



--

You received this message because you are subscribed to the Google Groups "Puppet Users" 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-users?hl=en.




--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" 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-users?hl=en.

Reply via email to