Hello everybody,
I have a question regarding virtual resources and the exporting/ collection thereof.

I have several hosts that should export one and the same file resource. This should be collected exactly once by one host.
The resources are exported within a define:

## this define is used by many hosts.
## example: sge::queue{"testqueue": ensure => present }
define sge::queue(...){
        @@file{"/var/lib/puppet/exported/sge/queue.template.${queue_name}":
                content => template("sge/queue.template.erb"),
                tag => "sge_queue_template",
        }
}

### one host should import the File resource above.
class queue_collect{
        File <<| tag == "sge_queue_template" |>>
        #there should be exactly one file:
        # /var/lib/puppet/exported/sge/queue.template.testqueue
}

How would I do this? If I simply do the examples above, I get the "cannot override local resource" error on the host which is in the queue_collect class.

I would like to know how I could have many hosts export the "same" (as in identical) resource. Is this possible? Looking into the database (resources table), it becomes clear that every exporting host's resource is different, since it has different "host_id"s.

I have a similar problem with "Exec" resources, but ther I have the "onlyif" parameter with a test that prefents execution if the exec has already been applied on the collecting node. This is not possible for the File resources though.

Could it be that exporting via @file{...} and collecting with realize(...) would solve this issue? I do not really understand the use of this approach, I must confess.

A helping hint would be highly appreciated.
Thanks in advance,
udo.
--
:: udo waechter - [EMAIL PROTECTED] :: N 52º16'30.5" E 8º3'10.1"
:: genuine input for your ears: http://auriculabovinari.de
::                          your eyes: http://ezag.zoide.net
::                          your brain: http://zoide.net




Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to