Puppet: System Administration Automated

Support

Ticket #871 (new enhancement)

Opened 1 year ago

Last modified 1 year ago

Cannot append values to type default resource parameters.

Reported by: mccune Assigned to: community
Priority: normal Milestone: unplanned
Component: language Version: 0.23.2
Severity: normal Keywords:
Cc: Triage Stage: Accepted
Attached Patches: None Complexity: Easy

Description

Consider the following, were we wish to have both Exec["hello"] and Exec["goodbye"] notified from File[/tmp/foobar.txt]:

#!/usr/bin/env puppet

class parent {
  Exec {
    cwd  => "/tmp",
    path => [ "/bin", "/usr/bin" ],
    refreshonly => true
  }
  File {
    mode => 0751,
    notify => Exec["hello"],
    ensure => present
  }
  exec { "echo Hello": alias => "hello" }
  exec { "echo Goodbye": alias => "goodbye" }
}

class parent::child inherits parent {
  File { notify +> Exec["goodbye"] }
  file { "/tmp/foobar.txt": }
}

include parent::child

The line, File { notify +> Exec["goodbye"] } generates a syntax error on "+>".

Change History

10/26/07 20:58:37 changed by luke

  • complexity changed from Unknown to Easy.
  • stage changed from Unreviewed to Accepted.
  • milestone set to unplanned.

This should be as easy as changing the grammar to allow this syntax in defaults, although there's a bit of a semantic difference, given that there's no "override default" syntax, like there is an "override resource" syntax.

11/24/07 06:33:55 changed by luke

  • type changed from defect to enhancement.

Actually, in thinking about this... There is a semantic difference, because you'd be modifying the original default, rather than just adding a default. This might actually be a good thing, but it's definitely a difference.

Also, this is more of an enhancement than a defect.