I contrast to the description you cannot use the same title for
different resources. Thats what title_patterns are for: To use one title
to specify all key_attributes. So if one wants to specify a resource
with two protocols, the easiest way to this is to just write
port { 'telnet:tcp': number => 23, ensure => present }
port { 'telnet:udp': number => 23, ensure => present }
The titlepattern will both set name ("telnet") and protocol (:tcp or
:udp)
Signed-off-by: Stefan Schulte <[email protected]>
---
Local-branch: feature/next/5660
lib/puppet/type/port.rb | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/lib/puppet/type/port.rb b/lib/puppet/type/port.rb
index 2087d7c..e2a4afa 100755
--- a/lib/puppet/type/port.rb
+++ b/lib/puppet/type/port.rb
@@ -33,10 +33,11 @@ module Puppet
newparam(:protocol) do
desc "The protocols the port uses. Valid values are *udp* and *tcp*.
Most services have both protocols, but not all. If you want both
- protocols you have to define two resources. You can define both
- resources with the same title as long as the combination of
- resourcetitle and protocol is uniq. Keep in mind that if another
- resource requires Port['title'] it requires both resources"
+ protocols you have to define two resources. Remeber that you cannot
+ specify two resources with the same title but you can use a title
+ to set both, name and protocol if you use ':' as a seperator. So
+ port { 'telnet:tcp': ... } sets both name and protocol and you dont
+ have to specify them explicitly then"
newvalues :tcp, :udp
--
1.7.3.4
--
You received this message because you are subscribed to the Google Groups
"Puppet Developers" 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-dev?hl=en.