Issue #1771 has been updated by luke.

Subject changed from Would be able to export something multiple times but only 
have it exported once to Resources that are unique across a site
Status changed from Unreviewed to Accepted

Hmm, this is an interesting idea -- site-unique resources, rather than the 
typical host-unique.

There are at least two problems to solve:

* The syntax: I'm not a big fan of just adding another '@' to the resource, but 
Brice has led a discussion that will likely lead to a complete revamping of how 
exporting is done, so it shouldn't be too hard to find a decent syntax.

* The implementation: This is harder, especially since you'd have at least the 
possibility for these site resources to be configured differently on different 
hosts.  I would assume that the back-end would throw an error if that ever 
happened; we couldn't just ignore them.

I'll rename the ticket and accept it, but we need a more complete design.
----------------------------------------
Feature #1771: Resources that are unique across a site
http://projects.reductivelabs.com/issues/show/1771

Author: johnf
Status: Accepted
Priority: Normal
Assigned to: 
Category: language
Target version: 
Complexity: Medium
Affected version: 0.24.6
Keywords: export virtual resource nagios


So let's say I have an ssh class like so, included by all nodes

class ssh {

    package {
        ssh:
           ensure: present
    }

    @@nagios_service {
        "ssh_${fqdn}":
            service_description => 'SSH'
            command_name => 'check_ssh',
            host_name => $fqdn
    }

# This bit doesn't work
#    @@nagios_command {
#        'check_ssh':
#             command_line => 'check_ssh -H $HOSTADDRESS'
#    }    

}

then a nagios class included only by my nagios host

class nagios {
  Nagios_service <<||>>
  Nagios_command <<||>>
}

Now all the services get collected which is fine since they all have different 
names and you want multiple entries one per host.

For the command however you only want one copy to exist since the command 
should only be created once. But it's nice to be able to include it in the ssh 
class so that everything is in the one place.

Current work arounds are 

a) Surround it with an if defined(nagios_host) and make sure the nagios_host 
class is defined on your nagios node before anything else gets called

b) Have a separate class with all the commands

I'm proposing that we create a new type of exported resource something like

@@@nagios_command {
    'check_ssh':
        command_line => 'check_ssh -H $HOSTADDRESS'
}

When collected only one instantiation of it would be presented for each name. 
Putting to resources in the config with the same name but different parameters 
would constitute an error.

I'm prepared to implement this if anyone else thinks it's a good idea.    




----------------------------------------
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://reductivelabs.com/redmine/my/account

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to