The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Feature #6643

Make ensure mandatory.

Added by Nigel Kersten about 3 years ago. Updated about 2 years ago.

Status:AcceptedStart date:03/08/2011
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:provider
Target version:3.x
Affected Puppet version: Branch:
Keywords:

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This ticket may be automatically exported to the PUP project on JIRA using the button below:


Description

(Proposal)

Take the following two cases:

file { "/tmp/foo": }
file { "/tmp/foo":
  content => foo",
}

The first case doesn’t create the file, the second does, even though the ensure state hasn’t been specified in either.

We’ve pushed this complexity down into the providers themselves, where they need to handle all the various permutations of non-ensure properties, and decide whether or not to set ensure.

I believe this is error-prone, and will end up varying significantly across types and providers, resulting in confused users.

I’m proposing that we make ensure mandatory, and if you set any properties other than “audit” on a resource when you haven’t specified ensure, we either:

  • error at a higher level
  • provide a standard way of marking properties as providing an implicit ensure value
    • error if a property not marked in this manner is used.

History

#1 Updated by Ben Hughes about 3 years ago

  • Status changed from Unreviewed to Accepted

#2 Updated by Devon Peters about 2 years ago

  • Category set to provider

Also available in: Atom PDF