Issue #1885 has been reported by dkM1.
----------------------------------------
Bug #1885: Requires are passed down to defines and exported with resources
http://projects.reductivelabs.com/issues/show/1885
Author: dkM1
Status: Unreviewed
Priority: High
Assigned to:
Category:
Target version:
Complexity: Unknown
Affected version: 0.24.7
Keywords:
When an export is in a define and the define is called with a require the
require is exported.
Sample code.
<pre>
class export::collect_test {
Export::Collect_define <<||>>
}
define export::collect_define ($content) {
file {
"$name":
ensure => file,
owner => "root", group => "root", mode => 755,
content => $content;
}
}
class remote_export::remote_test1 {
file {
"/tmp/testrequirefile1":
ensure => file,
owner => "root", group => "root", mode => 755,
content => "I am only required on remote host";
}
remote_export::remote_define {
"remote_test1":
content => "test file contents",
require => File["/tmp/testrequirefile1"];
}
}
class remote_export::remote_test2 {
file {
"/tmp/testrequirefile2":
ensure => file,
owner => "root", group => "root", mode => 755,
content => "I am only required on remote host",
before => Remote_export::Remote_define["remote_test2"];
}
remote_export::remote_define {
"remote_test2":
content => "test file contents";
}
}
define remote_export::remote_define ($content) {
file {
"/tmp/testlocalfile":
ensure => file,
owner => "root", group => "root", mode => 755,
content => $content;
}
@@export::collect_define {
$name:
content => $content;
}
}
</pre>
When I use a "require" to require the order in remote_export1 class it does
export the require.
<pre>
id | value |
param_name_id | line | resource_id | updated_at |
created_at
----------+-------------------------------------------------------+---------------+------+-------------+----------------------------+----------------------------
12669414 | --- !ruby/object:Puppet::Parser::Resource::Reference
title: /tmp/testrequirefile1
type: File
| 2 | | 94995 | 2009-01-23 12:36:06.533296 | 2009-01-23
12:36:06.533296
12669413 | test file contents |
10 | 46 | 94995 | 2009-01-23 12:35:06.005715 | 2009-01-23
12:35:06.005715
</pre>
When I use a "before" to require the order in remote_export2 class it doesn't
export the require.
<pre>
puppet=# SELECT * from param_values where resource_id = 94995;
id | value | param_name_id | line | resource_id |
updated_at | created_at
----------+--------------------+---------------+------+-------------+----------------------------+----------------------------
12669413 | test file contents | 10 | 46 | 94995 |
2009-01-23 12:35:06.005715 | 2009-01-23 12:35:06.005715
(1 row)
</pre>
----------------------------------------
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://reductivelabs.com/redmine/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
-~----------~----~----~----~------~----~------~--~---