On Wed, Feb 20, 2008 at 4:48 PM, Ben <abnormaliti@clivepeeters.com.au>
wrote:> Should this work?
>
> # --- remove any cronjobs that are not managed by puppet.
> resources { "cron": purge => true }
>
> I get the following error.
>
> Resources[cron]: Failed to generate additional resources: You must
> specify a title for objects of type Puppet::Type::Cron
I would be very careful about using the ''resources'' resource
type to
purge. It seems to be pretty greedy and will try to purge a great many
resources that one may not to remove. That said, what version are you
using? I have 0.24.1 on my local system and I did a test:
class delres {
resources { "file": noop => true, purge => true, }
resources { "cron": noop => true, purge => true, }
}
include delres
$ puppet test.pp
notice: /File[/var]/ensure: is directory, should be absent (noop)
notice: /File[/sys]/ensure: is directory, should be absent (noop)
notice: /File[/export]/ensure: is directory, should be absent (noop)
notice: /File[/opt]/ensure: is directory, should be absent (noop)
notice: /File[/usr]/ensure: is directory, should be absent (noop)
notice: /File[/etc]/ensure: is directory, should be absent (noop)
notice: /File[/tmp]/ensure: is directory, should be absent (noop)
notice: /File[/sbin]/ensure: is directory, should be absent (noop)
notice: /File[/mnt]/ensure: is directory, should be absent (noop)
notice: /File[/console.txt]/ensure: is file, should be absent (noop)
notice: /File[/proc]/ensure: is directory, should be absent (noop)
notice: /File[/media]/ensure: is directory, should be absent (noop)
notice: /File[/initrd]/ensure: is directory, should be absent (noop)
notice: /File[/lib]/ensure: is directory, should be absent (noop)
notice: /File[/dev]/ensure: is directory, should be absent (noop)
notice: /File[/srv]/ensure: is directory, should be absent (noop)
notice: /File[/lost+found]/ensure: is directory, should be absent (noop)
notice: /File[/home]/ensure: is directory, should be absent (noop)
notice: /File[/initrd.img]/ensure: is link, should be absent (noop)
notice: /File[/vmlinuz]/ensure: is link, should be absent (noop)
notice: /File[/boot]/ensure: is directory, should be absent (noop)
notice: /File[/bin]/ensure: is directory, should be absent (noop)
notice: /File[/cdrom]/ensure: is link, should be absent (noop)
notice: /File[/root]/ensure: is directory, should be absent (noop)
Note that it didn''t find any cron resources for purging, but the
''file'' resource purge seems to be everything under / (this is
on an
Ubuntu system).
Luke, As an aside, is there any way to specify the title of a resource
type for purging? So that puppet will search the manifest for say,
Cron["some cronjob"] and basically set ensure => absent? Should I
file
a bug report as a feature request for this?