Issue #5761 has been updated by Ben Hughes.

Status changed from Unreviewed to Accepted
Assignee set to Ben Hughes

Interesting. Thank you for the good example code.

What's weirder still is the following:

<pre>
[ben@paresthesia:~]% cat scope.pp    
File { tag => 'dave' }
File { tag => 'sc_test' }

@file {
    "/tmp/test1": ensure => present;
    "/tmp/test2": ensure => present, tag => 'sc_test';
}

File <| tag == 'sc_test' |>
</pre>

(I made it virtual, rather than exported, just to remove one element of 
working.)
and you get:

<pre>
[ben@paresthesia:~]% puppet apply -v scope.pp
info: Connecting to sqlite3 database: 
/Users/ben/.puppet/var/state/clientconfigs.sqlite3
Default already defined for File { tag }; cannot redefine at 
/Users/ben/scope.pp:2 on node paresthesia.box
</pre>

Adding in more debug as I go, it's weird, it's being set.

<pre>
debug: File[/tmp/test1]: Adding default for tag
debug: File[/tmp/test1]: Param is at tag => sc_test
</pre>
----------------------------------------
Bug #5761: a local collect ignores default values
https://projects.puppetlabs.com/issues/5761

Author: David Schmitt
Status: Accepted
Priority: Normal
Assignee: Ben Hughes
Category: exported resources
Target version: 
Affected Puppet version: 2.6.3
Keywords: export collect tags defaults
Branch: 


    File { tag => 'sc_test' }
    @@file {
        "/tmp/test1": ensure => present;
        "/tmp/test2": ensure => present, tag => 'sc_test';
    }
    File <<| tag == 'sc_test' |>>


    # ls -la /tmp/test*
    -rw-r--r-- 1 root root 0 Jan  3 14:28 /tmp/test2

>From my understanding, the defaults statement in the first line should ensure 
>that both files are tagged 'sc_test'. As can be seen from the results, only 
>the explicitly tagged resource is collected. This can also be observed with 
>other parameters.

The resource gets written into the stored configs database and other nodes can 
collect both files.


-- 
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