Re: removing exported resources

David Schmitt
2008-01-10T12:47:27Z

udo waechter schrieb:
> Hello everybody.
> I have a question about removing exported resources. How is this done?
> Does it happen automagically?
>
> If I do:
>
> @@file{"/tmp/bla":
> 	content => "blahs content",
> 	ensure	=> present,
> }
>
> and thus export "/tmp/bla" to another host does it vanish by
itself as
> soon as I remove the definition, or would I need to state something
> like:
>
> @@file{"/tmp/bla":
> 	content => "blahs content",
> 	ensure	=> absent,
> }
>
> I am asking, because I have reconfigred some of the exported resources
> that I have been using: "ensure => absent".
>
> What happens is the following:
> When puppetd runs on the collection host, the file is first deleted
> and then created again. Huh? how can this be explained? Is this the
> expected behaviour or have I found a bug? (server and client are
> version 0.24.1 on Debian Etch and Mac OS X Tiger (with client 0.23.0))

The resources are exported at the time of compiling the configuration
for the exporting node.

A example:

node a {
	@@file{
		$file1: ensure => present;
		$file2: ensure => absent;
	}
}

node b { File<<||>> }

Initial state: puppetmasterd running; no nodes ever configured; thus
there are no resources stored in the database

Execute on b: puppetd --test => nothing happens

Execute on a: puppetd --test => file1 and file2 will be stored in the
database

Execute on b: puppetd --test => file1 will be created; file2 will be
forced absent

Remove file1 definition from node a manifest

Execute on b: puppetd --test => file1 will be created; file2 will be
forced absent

This is because a''s configuration was not yet compiled again

Execute on a: puppetd --test => file2 will be stored in the database

Execute on b: puppetd --test => file1 will be ignored(!); file2 will be
forced absent


That should cover the major cases. Other should follow the same pattern.



Regards, DavidS