Issue #11912 has been updated by Matthew Leather.
I'm using this as a workaround, it seems to be working.
scope.find_resource_type 'test::def'
create_resource 'test::def'
----------------------------------------
Bug #11912: Ruby DSL should be able to use defined resources
https://projects.puppetlabs.com/issues/11912
Author: Hunter Haugen
Status: Accepted
Priority: Normal
Assignee:
Category: language
Target version: Telly
Affected Puppet version:
Keywords: rubydsl, ruby, dsl, define
Branch:
Currently there is no way to use defined resources in puppet ruby dsl. At all.
Given a module called `test` with two defined resources:
1st: `test/manifests/def.pp`
define test::def {
notify { 'test':
message => "Some test def for $name",
}
}
2nd: `test/manifests/ruby_def.rb`
define 'test::ruby_def' do
notify 'ruby test',
:message => "Some ruby test def for $name"
end
I can use both of these from a normal puppet manifest just fine:
`test/manifests/include.pp`
class test::include {
test::def { 'my title1': }
test::ruby_def { 'my ruby title1': }
}
THE BUG: The following example does not work. Puppet Ruby DSL cannot use either
ruby defines or puppet defines with `create_resource`, and there are no other
alternatives to use them. So defined resources are not possible to use in the
puppet ruby dsl afaict:
`test/manifests/ruby_include.pp`
hostclass 'test::ruby_include' do
create_resource 'test::def', 'my title'
create_resource 'test::ruby_def', 'my ruby title'
end
The errors given:
Cannot find definition Test::Def on node training.puppetlabs.lan
Cannot find definition Test::Ruby_def on node training.puppetlabs.lan
--
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.