Issue #16971 has been updated by eric sorenson.

Status changed from Accepted to Closed
Assignee changed from Henrik Lindberg to Julien Vaubourg
Keywords deleted (backlog)

Ah, thank you Henrik. 

Julien I think you generalised the documentation about "Appending to Resource 
Attributes" at 
http://docs.puppetlabs.com/puppet/3/reference/lang_classes.html#class-parameters-and-variables
 incorrectly. The `+>` syntax is only available in *defaults* sections, not in 
a specific resource. So as Henrik says, and I was able to duplicate this, 
simply shifting the require line to `Package { require +> 
File['/etc/apt/apt.conf.d/no-cache'],` will fix your problem.  

Julien is that sufficient to help you get past the problem? If not please mark 
it Status: Re-Opened and assign it back to me with more information about your 
use case.
----------------------------------------
Bug #16971: Add values to default resources with the plusignment
https://projects.puppetlabs.com/issues/16971#change-77700

Author: Julien Vaubourg
Status: Closed
Priority: Low
Assignee: Julien Vaubourg
Category: language
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


# Example #

Directly in site.pp:

    Package {
        require => File['/etc/apt/apt.conf.d/no-cache'],
    }

In the "blog" class:

    package { 'php5-cli':
        ensure  => present,
        require => Package['php5-cgi'],
    }

On the agent side, with the "*require => Package['php5-cgi']*" line:

    # puppet agent -t --noop -d | grep no-cache | grep -i blog
    #

Without it:

    # puppet agent -t --noop -d | grep no-cache | grep -i blog
    debug: /Stage[main]/Blog/Package[php5-cli]/require: requires 
File[/etc/apt/apt.conf.d/no-cache]
    #

And with "*require +> Package['php5-cgi']*":

    # puppet agent -t --noop -d | grep no-cache | grep -i blog
    err: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Syntax error at '+>'; expected '}' at 
/etc/puppet/modules/blog/manifests/init.pp:5 on node xxxxx
    warning: Not using cache on failed catalog
    err: Could not retrieve catalog; skipping run

# Problem #

According to this example:

1. Define a resource set before as a default resource overwrite it.
1. The usage of the plusignment ("*+>*") operator is not recognized in this 
case.

How add values to default resources? The plusignment should work in this case.


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