Feature #3375

parsedfile should consider order when writing new records.

Added by Dan Bode almost 2 years ago. Updated almost 2 years ago.

Status:Accepted Start date:03/16/2010
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:newfeature
Target version:-
Affected Puppet version:0.25.4 Branch:
Keywords:
Votes: 0

Description

I noticed the following behavior when I was trying to implement sudoers with parsedfile.

Order of entries in sudoers matters and need to be managed. Parsedfile does not fully support the ability to specify the order of lines.

More specifically, it only seems to control order of lines that are created.

I will use cron for my examples:

Consider the following code:

resources{'cron':
  purge => true,
}
cron{'dude':
  user => 'root',
  command => 'y',
  require => Cron['dude2'],
}
cron{'dude3':
  user => 'root',
  command => 'y',
}
cron{'dude2':
  user => 'root',
  command => 'y',
  require => Cron['dude3'],
}

This creates well ordered entries when run for the first time.

# Puppet Name: dude3
* * * * * y
# Puppet Name: dude2
* * * * * y
# Puppet Name: dude
* * * * * y

Now, if I delete one of the lines:

# Puppet Name: dude3
* * * * * y
# Puppet Name: dude
* * * * * y

and re-run the puppet code.

# Puppet Name: dude3
* * * * * y
# Puppet Name: dude
* * * * * y
# Puppet Name: dude2
* * * * * y

records that are created are always added after existing records regardless of the specified ordering.

Also, existing records will not be reordered, even if the properties of those records change.

History

Updated by James Turnbull almost 2 years ago

  • Category set to newfeature
  • Status changed from Unreviewed to Needs Decision
  • Assignee set to Luke Kanies

Updated by Luke Kanies almost 2 years ago

  • Subject changed from parsedfile only considers order when writing new records. to parsedfile should consider order when writing new records.
  • Status changed from Needs Decision to Accepted
  • Assignee deleted (Luke Kanies)

Definitely a good idea, but not a trivial amount of work.

Also available in: Atom PDF