Puppet: System Administration Automated

Support

Ticket #1066 (closed enhancement: duplicate)

Opened 8 months ago

Last modified 6 months ago

file type; purging a directory requires non-existent source hack

Reported by: mccune Assigned to: luke
Priority: low Milestone: elmo
Component: file Version:
Severity: normal Keywords: file info notice log purge recurse
Cc: Triage Stage: Accepted
Attached Patches: None Complexity: Medium

Description

Summary

info and notice messages are generated when using File { purge => true, recurse => true }

Description

As documented in the FAQ

When using something like:

file { "/etc/nagios/conf.d":
  owner   => nagios,
  group   => nagios,
  purge   => true,
  recurse => true,
}

"It seems what most people expect to happen here is create the named directory, set the owner and group, then purge any files or directories that are not managed by puppet underneath that. But this is not the behavior puppet will display. In fact the purge will silently fail.

The workaround is to define a source for the directory that doesn't exist."

So we must use a non existent source:

file { "/etc/nagios/conf.d":
   owner   => nagios,
   group   => nagios,
   purge   => true,
   recurse => true,
   source  => "/dev/null/nuller",

This is a reasonably acceptable hack, but the problem is the number of log messages:

notice: mount[localhost]: File source /var/should/not/exist/at/all/or/ever does not exist
info: //default/puppet/puppet::server/firewall/File[/etc/sysconfig/iptables.d]/source: No specified sources exist

I haven't really thought through how this might be solved, but my initial idea of providing a loglevel metaparam and setting it to silence the messages should not be the final solution, because it will mask other "real" problems with the resource.


Possibly related tickets: #543 #789

Change History

02/14/08 18:55:38 changed by mccune

  • priority changed from normal to low.
  • type changed from defect to enhancement.

02/19/08 04:56:24 changed by jamtur01

  • owner changed from community to jamtur01.
  • status changed from new to assigned.
  • complexity changed from Unknown to Medium.
  • stage changed from Unreviewed to Accepted.
  • milestone set to elmo.

02/19/08 04:56:42 changed by jamtur01

  • owner changed from jamtur01 to luke.
  • status changed from assigned to new.

04/24/08 08:08:17 changed by luke

  • component changed from library to file.

04/24/08 08:09:16 changed by luke

  • status changed from new to closed.
  • resolution set to duplicate.

This is essentially a dupe of #1057.