Bug #6804

+> operator only works on ignore in defaults context

Added by Frank Sweetser about 1 year ago. Updated about 1 year ago.

Status:Rejected Start date:03/21/2011
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:parser
Target version:-
Affected Puppet version:2.6.6 Branch:
Keywords:
Votes: 0

Description

In my global site.pp, I have this default value set:

File {
  ignore => ["*~", "#*#", ".#*", ".git", ".gitignore"]
}

Then, in a module, I’m attempting to add onto the ignore list in a recursive file resource:

  file { "/etc/mrtg":
    ensure => directory,
    owner => root,
    group => mrtg,
    mode => 750,
    purge => true,
    recurse => true,
    source => "puppet:///modules/mrtg/empty",
    ignore +> ".for-git"
  }

In 0.25, this worked fine. In 2.6.6, though, it produces a parser error:

Mon Mar 21 15:49:00 -0400 2011 Puppet (err): Could not retrieve catalog from remote server: Error 400 on SERVER: Syntax error at '+>'; expected '}' at /etc/puppet/modules/mrtg/manifests/init.pp:32 on node

If instead I change it to a file type defaults within the module context, though, it appears to work fine:

  File["/etc/mrtg"] { ignore +> ".for-git" }
  file { "/etc/mrtg":
    ensure => directory,
    owner => root,
    group => mrtg,
    mode => 750,
    purge => true,
    recurse => true,
    source => "puppet:///modules/mrtg/empty"
  }

Was I doing something that should never have worked in the first place, or have I found a regression?

History

Updated by Nigel Kersten about 1 year ago

  • Status changed from Unreviewed to Needs More Information

Are you sure it was actually working before? I thought the plusignment operator only ever worked in the context of class inheritance and overriding resources defined in a parent class?

Updated by Frank Sweetser about 1 year ago

I can’t say for certain that it actually worked before (everything has been upgraded now, so I don’t have the setup in 0.25 to test at the moment), but it did at least parse and run the manifest. If this is something that shouldn’t have worked to begin with, though, I’m fine with closing out the ticket as such.

Updated by Nigel Kersten about 1 year ago

  • Status changed from Needs More Information to Rejected

Yep. I’m positive this didn’t actually work :)

http://projects.puppetlabs.com/issues/2585

Feel free to follow that one.

I think you were just hitting an error that wasn’t caught correctly.

Also available in: Atom PDF