puppet 0.23.0 → 0.23.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of puppet might be problematic. Click here for more details.

Files changed (125) hide show
  1. data/CHANGELOG +58 -0
  2. data/Rakefile +1 -1
  3. data/bin/filebucket +6 -6
  4. data/bin/puppetca +11 -1
  5. data/bin/puppetmasterd +7 -6
  6. data/conf/redhat/client.init +1 -0
  7. data/conf/redhat/{puppetd.conf → puppet.conf} +1 -1
  8. data/conf/redhat/puppet.spec +43 -31
  9. data/conf/redhat/server.init +1 -0
  10. data/lib/puppet.rb +3 -3
  11. data/lib/puppet/configuration.rb +16 -5
  12. data/lib/puppet/metatype/attributes.rb +12 -19
  13. data/lib/puppet/metatype/evaluation.rb +10 -1
  14. data/lib/puppet/metatype/instances.rb +39 -15
  15. data/lib/puppet/metatype/manager.rb +1 -28
  16. data/lib/puppet/metatype/metaparams.rb +20 -16
  17. data/lib/puppet/metatype/providers.rb +8 -2
  18. data/lib/puppet/metatype/schedules.rb +14 -19
  19. data/lib/puppet/{modules.rb → module.rb} +2 -0
  20. data/lib/puppet/network/authstore.rb +5 -1
  21. data/lib/puppet/network/client/dipper.rb +2 -2
  22. data/lib/puppet/network/client/master.rb +18 -9
  23. data/lib/puppet/network/handler/fileserver.rb +3 -6
  24. data/lib/puppet/network/handler/report.rb +2 -1
  25. data/lib/puppet/network/server/mongrel.rb +4 -2
  26. data/lib/puppet/network/xmlrpc/client.rb +10 -3
  27. data/lib/puppet/parameter.rb +11 -4
  28. data/lib/puppet/parser/ast/collexpr.rb +10 -10
  29. data/lib/puppet/parser/ast/hostclass.rb +2 -2
  30. data/lib/puppet/parser/ast/resourceparam.rb +4 -3
  31. data/lib/puppet/parser/ast/resourceref.rb +16 -2
  32. data/lib/puppet/parser/collector.rb +8 -4
  33. data/lib/puppet/parser/functions.rb +5 -2
  34. data/lib/puppet/parser/interpreter.rb +48 -9
  35. data/lib/puppet/parser/lexer.rb +2 -1
  36. data/lib/puppet/parser/parser.rb +669 -589
  37. data/lib/puppet/parser/resource.rb +20 -11
  38. data/lib/puppet/parser/resource/param.rb +21 -10
  39. data/lib/puppet/parser/resource/reference.rb +2 -2
  40. data/lib/puppet/parser/scope.rb +22 -10
  41. data/lib/puppet/{type/property.rb → property.rb} +48 -15
  42. data/lib/puppet/propertychange.rb +3 -3
  43. data/lib/puppet/provider/cron/crontab.rb +38 -36
  44. data/lib/puppet/provider/host/netinfo.rb +1 -2
  45. data/lib/puppet/provider/mailalias/aliases.rb +31 -0
  46. data/lib/puppet/provider/maillist/mailman.rb +113 -0
  47. data/lib/puppet/provider/mount.rb +5 -11
  48. data/lib/puppet/provider/mount/parsed.rb +2 -2
  49. data/lib/puppet/provider/package/appdmg.rb +1 -2
  50. data/lib/puppet/provider/package/apt.rb +3 -1
  51. data/lib/puppet/provider/package/aptrpm.rb +14 -4
  52. data/lib/puppet/provider/package/blastwave.rb +6 -4
  53. data/lib/puppet/provider/package/dpkg.rb +12 -4
  54. data/lib/puppet/provider/package/pkgdmg.rb +2 -2
  55. data/lib/puppet/provider/package/rpm.rb +11 -1
  56. data/lib/puppet/provider/package/rug.rb +1 -0
  57. data/lib/puppet/provider/package/urpmi.rb +11 -1
  58. data/lib/puppet/provider/package/yum.rb +12 -2
  59. data/lib/puppet/provider/parsedfile.rb +36 -6
  60. data/lib/puppet/rails.rb +9 -2
  61. data/lib/puppet/rails/param_name.rb +2 -3
  62. data/lib/puppet/rails/param_value.rb +20 -1
  63. data/lib/puppet/rails/resource.rb +8 -2
  64. data/lib/puppet/reference/configuration.rb +14 -16
  65. data/lib/puppet/reference/type.rb +4 -4
  66. data/lib/puppet/transaction.rb +4 -4
  67. data/lib/puppet/type.rb +19 -6
  68. data/lib/puppet/type/component.rb +9 -3
  69. data/lib/puppet/type/cron.rb +10 -4
  70. data/lib/puppet/type/exec.rb +9 -5
  71. data/lib/puppet/type/group.rb +2 -3
  72. data/lib/puppet/type/mailalias.rb +50 -0
  73. data/lib/puppet/type/maillist.rb +57 -0
  74. data/lib/puppet/type/mount.rb +25 -11
  75. data/lib/puppet/type/package.rb +6 -27
  76. data/lib/puppet/type/pfile.rb +5 -6
  77. data/lib/puppet/type/pfile/source.rb +8 -2
  78. data/lib/puppet/type/pfilebucket.rb +4 -3
  79. data/lib/puppet/type/resources.rb +1 -3
  80. data/lib/puppet/type/schedule.rb +16 -16
  81. data/lib/puppet/type/service.rb +4 -1
  82. data/lib/puppet/type/tidy.rb +1 -2
  83. data/lib/puppet/type/user.rb +2 -3
  84. data/lib/puppet/type/yumrepo.rb +2 -2
  85. data/lib/puppet/util.rb +29 -4
  86. data/lib/puppet/util/autoload.rb +45 -16
  87. data/lib/puppet/util/fileparsing.rb +23 -6
  88. data/lib/puppet/util/filetype.rb +12 -1
  89. data/lib/puppet/util/log.rb +2 -2
  90. data/lib/puppet/util/log_paths.rb +16 -0
  91. data/lib/puppet/util/reference.rb +2 -2
  92. data/test/language/ast/hostclass.rb +21 -4
  93. data/test/language/ast/resourceref.rb +95 -0
  94. data/test/language/functions.rb +5 -5
  95. data/test/language/interpreter.rb +129 -1
  96. data/test/language/node.rb +13 -2
  97. data/test/language/resource.rb +26 -1
  98. data/test/language/scope.rb +25 -5
  99. data/test/lib/puppettest/support/collection.rb +2 -2
  100. data/test/network/client/master.rb +28 -42
  101. data/test/network/server/mongrel_test.rb +7 -1
  102. data/test/other/propertychange.rb +2 -2
  103. data/test/other/transactions.rb +44 -5
  104. data/test/puppet/modules.rb +2 -1
  105. data/test/rails/ast.rb +7 -8
  106. data/test/rails/collection.rb +2 -2
  107. data/test/rails/railsresource.rb +21 -5
  108. data/test/ral/manager/attributes.rb +33 -1
  109. data/test/ral/manager/instances.rb +33 -6
  110. data/test/ral/manager/type.rb +29 -49
  111. data/test/ral/providers/cron/crontab.rb +61 -13
  112. data/test/ral/providers/mailalias/aliases.rb +57 -0
  113. data/test/ral/providers/mount/parsed.rb +4 -4
  114. data/test/ral/providers/package/apt.rb +13 -1
  115. data/test/ral/providers/parsedfile.rb +20 -7
  116. data/test/ral/types/cron.rb +17 -1
  117. data/test/ral/types/mailalias.rb +50 -0
  118. data/test/ral/types/mount.rb +35 -2
  119. data/test/ral/types/package.rb +10 -2
  120. data/test/ral/types/parameter.rb +4 -4
  121. data/test/ral/types/property.rb +39 -1
  122. data/test/util/autoload.rb +33 -18
  123. data/test/util/filetype.rb +49 -3
  124. metadata +13 -6
  125. data/lib/puppet/element.rb +0 -52
@@ -12,6 +12,13 @@ module Puppet::Rails
12
12
  Puppet.config.use(:main, :rails, :puppetmasterd)
13
13
 
14
14
  ActiveRecord::Base.logger = Logger.new(Puppet[:railslog])
15
+ begin
16
+ loglevel = Logger.const_get(Puppet[:rails_loglevel].upcase)
17
+ ActiveRecord::Base.logger.level = loglevel
18
+ rescue => detail
19
+ Puppet.warning "'%s' is not a valid Rails log level; using debug" % Puppet[:rails_loglevel]
20
+ ActiveRecord::Base.logger.level = Logger::DEBUG
21
+ end
15
22
  ActiveRecord::Base.allow_concurrency = true
16
23
  ActiveRecord::Base.verify_active_connections!
17
24
 
@@ -28,7 +35,7 @@ module Puppet::Rails
28
35
 
29
36
  # The arguments for initializing the database connection.
30
37
  def self.database_arguments
31
- args = {:adapter => Puppet[:dbadapter]}
38
+ args = {:adapter => Puppet[:dbadapter], :log_level => Puppet[:rails_loglevel]}
32
39
 
33
40
  case Puppet[:dbadapter]
34
41
  when "sqlite3":
@@ -117,4 +124,4 @@ if Puppet.features.rails?
117
124
  require 'puppet/rails/host'
118
125
  end
119
126
 
120
- # $Id: rails.rb 2609 2007-06-18 18:46:00Z luke $
127
+ # $Id: rails.rb 2667 2007-07-09 23:15:01Z luke $
@@ -12,12 +12,11 @@ class Puppet::Rails::ParamName < ActiveRecord::Base
12
12
  hash[:value] = resource.param_values.find(:all, :conditions => [ "param_name_id = ?", self]).collect { |v| v.value }
13
13
  if hash[:value].length == 1
14
14
  hash[:value] = hash[:value].shift
15
- end
16
- if hash[:value].empty?
15
+ elsif hash[:value].empty?
17
16
  hash[:value] = nil
18
17
  end
19
18
  Puppet::Parser::Resource::Param.new hash
20
19
  end
21
20
  end
22
21
 
23
- # $Id: param_name.rb 2565 2007-06-12 00:31:16Z ballman $
22
+ # $Id: param_name.rb 2706 2007-07-18 19:47:09Z luke $
@@ -1,6 +1,25 @@
1
1
  class Puppet::Rails::ParamValue < ActiveRecord::Base
2
2
  belongs_to :param_name
3
3
  belongs_to :resource
4
+
5
+ def value
6
+ val = self[:value]
7
+ if val =~ /^--- \!/
8
+ YAML.load(val)
9
+ else
10
+ val
11
+ end
12
+ end
13
+
14
+ # I could not find a cleaner way to handle making sure that resource references
15
+ # were consistently serialized and deserialized.
16
+ def value=(val)
17
+ if val.is_a?(Puppet::Parser::Resource::Reference)
18
+ self[:value] = YAML.dump(val)
19
+ else
20
+ self[:value] = val
21
+ end
22
+ end
4
23
  end
5
24
 
6
- # $Id: param_value.rb 2565 2007-06-12 00:31:16Z ballman $
25
+ # $Id: param_value.rb 2706 2007-07-18 19:47:09Z luke $
@@ -45,7 +45,8 @@ class Puppet::Rails::Resource < ActiveRecord::Base
45
45
  def get_tag_hash(tags = nil)
46
46
  tags ||= resource_tags.find(:all, :include => :puppet_tag)
47
47
  return tags.inject({}) do |hash, tag|
48
- hash[tag.puppet_tag.name] = tag.puppet_tag.name
48
+ # We have to store the tag object, not just the tag name.
49
+ hash[tag.puppet_tag.name] = tag
49
50
  hash
50
51
  end
51
52
  end
@@ -105,7 +106,12 @@ class Puppet::Rails::Resource < ActiveRecord::Base
105
106
  hash[:source] = scope.source
106
107
  obj = Puppet::Parser::Resource.new(hash)
107
108
 
109
+ names = []
108
110
  self.param_names.each do |pname|
111
+ # We can get the same name multiple times because of how the
112
+ # db layout works.
113
+ next if names.include?(pname.name)
114
+ names << pname.name
109
115
  obj.set(pname.to_resourceparam(self, scope.source))
110
116
  end
111
117
 
@@ -116,4 +122,4 @@ class Puppet::Rails::Resource < ActiveRecord::Base
116
122
  end
117
123
  end
118
124
 
119
- # $Id: resource.rb 2597 2007-06-17 21:41:50Z luke $
125
+ # $Id: resource.rb 2705 2007-07-18 17:32:46Z luke $
@@ -46,25 +46,23 @@ Specifying Configuration Parameters
46
46
  On The Command-Line
47
47
  +++++++++++++++++++
48
48
  Every Puppet executable (with the exception of ``puppetdoc``) accepts all of
49
- the arguments below, but not all of the arguments make sense for every executable.
50
- Each argument has a section listed with it in parentheses; often, that section
49
+ the parameters below, but not all of the arguments make sense for every executable.
50
+ Each parameter has a section listed with it in parentheses; often, that section
51
51
  will map to an executable (e.g., ``puppetd``), in which case it probably only
52
- makes sense for that one executable. If ``puppet`` is listed as the section,
52
+ makes sense for that one executable. If ``main`` is listed as the section,
53
53
  it is most likely an option that is valid for everyone.
54
54
 
55
- This will not always be the case. I have tried to be as thorough as possible
56
- in the descriptions of the arguments, so it should be obvious whether an
57
- argument is appropriate or not.
55
+ I have tried to be as thorough as possible in the descriptions of the
56
+ arguments, so it should be obvious whether an argument is appropriate or not.
58
57
 
59
- These arguments can be supplied to the executables either as command-line
60
- arugments or in the configuration file for the appropriate executable. For
61
- instance, the command-line invocation below would set the configuration directory
62
- to ``/private/puppet``::
58
+ These parameters can be supplied to the executables either as command-line
59
+ options or in the configuration file. For instance, the command-line
60
+ invocation below would set the configuration directory to ``/private/puppet``::
63
61
 
64
62
  $ puppetd --confdir=/private/puppet
65
63
 
66
- Note that boolean options are turned on and off with a slightly different syntax
67
- on the command line::
64
+ Note that boolean options are turned on and off with a slightly different
65
+ syntax on the command line::
68
66
 
69
67
  $ puppetd --storeconfigs
70
68
 
@@ -76,14 +74,14 @@ the client configuration.
76
74
  Configuration Files
77
75
  +++++++++++++++++++
78
76
  As mentioned above, the configuration parameters can also be stored in a
79
- configuration file located in the configuration directory (`/etc/puppet`
80
- by default). All executables look for ``puppet.conf`` in their
81
- configuration directory (although they used to each look to separate files).
77
+ configuration file, located in the configuration directory (`/etc/puppet`
78
+ by default). As of 0.23.0, all executables look for ``puppet.conf`` in their
79
+ configuration directory (although they previously looked for separate files).
82
80
 
83
81
  All executables will set any parameters set within the ``main`` section,
84
82
  while each executable will also look for a section named for the executable
85
83
  and load those parameters. For example, ``puppetd`` will look for a
86
- section named ``puppetd`, and ``puppetmasterd`` looks for a section
84
+ section named ``puppetd``, and ``puppetmasterd`` looks for a section
87
85
  named ``puppetmasterd``. This allows you to use a single configuration file
88
86
  to customize the settings for all of your executables.
89
87
 
@@ -11,7 +11,7 @@ type = Puppet::Util::Reference.newreference :type, :doc => "All Puppet resource
11
11
  str = %{
12
12
  Metaparameters
13
13
  --------------
14
- Metaparameters are parameters that work with any element; they are part of the
14
+ Metaparameters are parameters that work with any resource type; they are part of the
15
15
  Puppet framework itself rather than being part of the implementation of any
16
16
  given instance. Thus, any defined metaparameter can be used with any instance
17
17
  in your manifest, including defined components.
@@ -66,9 +66,6 @@ Resource Types
66
66
  dependency handling), and because ``path`` is the namevar for ``file``, that
67
67
  string is assigned to the ``path`` parameter.
68
68
 
69
- - *Features* are abilities that some providers might not support. You can use the list
70
- of supported features to determine how a given provider can be used.
71
-
72
69
  - *Parameters* determine the specific configuration of the instance. They either
73
70
  directly modify the system (internally, these are called properties) or they affect
74
71
  how the instance behaves (e.g., adding a search path for ``exec`` instances
@@ -82,6 +79,9 @@ Resource Types
82
79
  binaries indicate that Puppet will search for the binary using the shell
83
80
  path.
84
81
 
82
+ - *Features* are abilities that some providers might not support. You can use the list
83
+ of supported features to determine how a given provider can be used.
84
+
85
85
  Resource types define features they can use, and providers can be tested to see
86
86
  which features they provide.
87
87
 
@@ -68,7 +68,7 @@ class Transaction
68
68
  resourceevents = apply_changes(resource, changes)
69
69
 
70
70
  # If there were changes and the resource isn't in noop mode...
71
- unless changes.empty? or changes.include?(:noop)
71
+ unless changes.empty? or resource.noop
72
72
  # Record when we last synced
73
73
  resource.cache(:synced, Time.now)
74
74
 
@@ -490,12 +490,12 @@ class Transaction
490
490
  if Puppet[:trace]
491
491
  puts detail.backtrace
492
492
  end
493
- Puppet.err "Could not prefetch % provider %s: %s" % [resources[0].class.name, provider.name, detail]
493
+ Puppet.err "Could not prefetch %s provider '%s': %s" % [provider.resource_type.name, provider.name, detail]
494
494
  end
495
495
  end
496
496
  end
497
497
 
498
- # Prepare to evaluate the elements in a transaction.
498
+ # Prepare to evaluate the resources in a transaction.
499
499
  def prepare
500
500
  prefetch()
501
501
 
@@ -737,4 +737,4 @@ end
737
737
 
738
738
  require 'puppet/transaction/report'
739
739
 
740
- # $Id: transaction.rb 2621 2007-06-18 21:56:11Z luke $
740
+ # $Id: transaction.rb 2678 2007-07-11 19:30:42Z luke $
@@ -1,18 +1,25 @@
1
1
  require 'puppet'
2
2
  require 'puppet/util/log'
3
- require 'puppet/element'
4
3
  require 'puppet/event'
5
4
  require 'puppet/util/metric'
6
- require 'puppet/type/property'
5
+ require 'puppet/property'
7
6
  require 'puppet/parameter'
8
7
  require 'puppet/util'
9
8
  require 'puppet/util/autoload'
10
9
  require 'puppet/metatype/manager'
10
+ require 'puppet/util/errors'
11
+ require 'puppet/util/log_paths'
12
+ require 'puppet/util/logging'
11
13
 
12
14
  # see the bottom of the file for the rest of the inclusions
13
15
 
14
16
  module Puppet
15
- class Type < Puppet::Element
17
+ class Type
18
+ include Puppet::Util
19
+ include Puppet::Util::Errors
20
+ include Puppet::Util::LogPaths
21
+ include Puppet::Util::Logging
22
+
16
23
  # Nearly all of the code in this class is stored in files in the
17
24
  # metatype/ directory. This is a temporary measure until I get a chance
18
25
  # to refactor this class entirely. There's still more simplification to
@@ -28,7 +35,7 @@ class Type < Puppet::Element
28
35
  require 'puppet/metatype/schedules'
29
36
  require 'puppet/metatype/tags'
30
37
 
31
- # Types (which map to elements in the languages) are entirely composed of
38
+ # Types (which map to resources in the languages) are entirely composed of
32
39
  # attribute value pairs. Generally, Puppet calls any of these things an
33
40
  # 'attribute', but these attributes always take one of three specific
34
41
  # forms: parameters, metaparams, or properties.
@@ -40,6 +47,7 @@ class Type < Puppet::Element
40
47
  attr_reader :parent
41
48
 
42
49
  attr_writer :title
50
+ attr_writer :noop
43
51
 
44
52
  include Enumerable
45
53
 
@@ -53,6 +61,9 @@ class Type < Puppet::Element
53
61
  attr_accessor :self_refresh
54
62
  include Enumerable, Puppet::Util::ClassGen
55
63
  include Puppet::MetaType::Manager
64
+
65
+ include Puppet::Util
66
+ include Puppet::Util::Logging
56
67
  end
57
68
 
58
69
  # all of the variables that must be initialized for each subclass
@@ -241,10 +252,12 @@ class Type < Puppet::Element
241
252
  rescue ArgumentError, Puppet::Error, TypeError
242
253
  raise
243
254
  rescue => detail
244
- self.devfail(
255
+ error = Puppet::DevError.new(
245
256
  "Could not set %s on %s: %s" %
246
257
  [attr, self.class.name, detail]
247
258
  )
259
+ error.set_backtrace(detail.backtrace)
260
+ raise error
248
261
  end
249
262
  hash.delete attr
250
263
  end
@@ -381,4 +394,4 @@ require 'puppet/type/tidy'
381
394
 
382
395
 
383
396
 
384
- # $Id: type.rb 2577 2007-06-14 03:39:23Z luke $
397
+ # $Id: type.rb 2684 2007-07-12 16:39:47Z luke $
@@ -95,6 +95,12 @@ Puppet::Type.newtype(:component) do
95
95
  def initialize(args)
96
96
  @children = []
97
97
  super(args)
98
+
99
+ # If the title isn't a full resource reference, assume
100
+ # we're a class and make an alias for that.
101
+ unless @title.to_s.include?("[")
102
+ self.class.alias("class[%s]" % @title, self)
103
+ end
98
104
  end
99
105
 
100
106
  def initvars
@@ -131,10 +137,10 @@ Puppet::Type.newtype(:component) do
131
137
  if parentof?(child)
132
138
  devfail "Already the parent of %s[%s]" % [child.class.name, child.title]
133
139
  end
134
- unless child.is_a?(Puppet::Element)
140
+ unless child.is_a?(Puppet::Type)
135
141
  self.debug "Got object of type %s" % child.class
136
142
  self.devfail(
137
- "Containers can only contain Puppet::Elements, not %s" %
143
+ "Containers can only contain Puppet resources, not %s" %
138
144
  child.class
139
145
  )
140
146
  end
@@ -230,4 +236,4 @@ Puppet::Type.newtype(:component) do
230
236
  end
231
237
  end
232
238
 
233
- # $Id: component.rb 2499 2007-05-09 21:30:44Z luke $
239
+ # $Id: component.rb 2715 2007-07-19 19:23:56Z luke $
@@ -1,6 +1,5 @@
1
1
  require 'etc'
2
2
  require 'facter'
3
- require 'puppet/type/property'
4
3
  require 'puppet/util/filetype'
5
4
 
6
5
  Puppet::Type.newtype(:cron) do
@@ -92,6 +91,9 @@ Puppet::Type.newtype(:cron) do
92
91
 
93
92
  def should_to_s(newvalue = @should)
94
93
  if newvalue
94
+ unless newvalue.is_a?(Array)
95
+ newvalue = [newvalue]
96
+ end
95
97
  if self.name == :command or newvalue[0].is_a? Symbol
96
98
  newvalue[0]
97
99
  else
@@ -302,8 +304,12 @@ Puppet::Type.newtype(:cron) do
302
304
  end
303
305
 
304
306
  def is_to_s(newvalue)
305
- if newvalue
306
- newvalue.join(",")
307
+ if newvalue
308
+ if newvalue.is_a?(Array)
309
+ newvalue.join(",")
310
+ else
311
+ newvalue
312
+ end
307
313
  else
308
314
  nil
309
315
  end
@@ -402,5 +408,5 @@ Puppet::Type.newtype(:cron) do
402
408
  end
403
409
 
404
410
 
405
- # $Id: cron.rb 2621 2007-06-18 21:56:11Z luke $
411
+ # $Id: cron.rb 2698 2007-07-14 21:18:36Z luke $
406
412
 
@@ -6,7 +6,12 @@ module Puppet
6
6
  @doc = "Executes external commands. It is critical that all commands
7
7
  executed using this mechanism can be run multiple times without
8
8
  harm, i.e., they are *idempotent*. One useful way to create idempotent
9
- commands is to use the *creates* parameter.
9
+ commands is to use the checks like ``creates`` to avoid running the
10
+ command unless some condition is met.
11
+
12
+ Note also that you can restrict an ``exec`` to only run when it receives
13
+ events by using the ``refreshonly`` parameter; this is a useful way to
14
+ have your configuration respond to events with arbitrary commands.
10
15
 
11
16
  It is worth noting that ``exec`` is special, in that it is not
12
17
  currently considered an error to have multiple ``exec`` instances
@@ -48,10 +53,9 @@ module Puppet
48
53
  to native Puppet types as quickly as possible. If you find that
49
54
  you are doing a lot of work with ``exec``, please at least notify
50
55
  us at Reductive Labs what you are doing, and hopefully we can work with
51
- you to get a native element type for the work you are doing."
56
+ you to get a native resource type for the work you are doing."
52
57
 
53
58
  require 'open3'
54
- require 'puppet/type/property'
55
59
 
56
60
  # Create a new check mechanism. It's basically just a parameter that
57
61
  # provides one extra 'check' method.
@@ -197,7 +201,7 @@ module Puppet
197
201
 
198
202
  newparam(:logoutput) do
199
203
  desc "Whether to log output. Defaults to logging output at the
200
- loglevel for the ``exec`` element. Values are **true**, *false*,
204
+ loglevel for the ``exec`` resource. Values are **true**, *false*,
201
205
  and any legal log level."
202
206
 
203
207
  values = [:true, :false]
@@ -598,4 +602,4 @@ module Puppet
598
602
  end
599
603
  end
600
604
 
601
- # $Id: exec.rb 2551 2007-06-04 20:37:14Z luke $
605
+ # $Id: exec.rb 2696 2007-07-14 20:26:31Z luke $
@@ -8,12 +8,11 @@
8
8
 
9
9
  require 'etc'
10
10
  require 'facter'
11
- require 'puppet/type/property'
12
11
 
13
12
  module Puppet
14
13
  newtype(:group) do
15
14
  @doc = "Manage groups. This type can only create groups. Group
16
- membership must be managed on individual users. This element type
15
+ membership must be managed on individual users. This resource type
17
16
  uses the prescribed native tools for creating groups and generally
18
17
  uses POSIX APIs for retrieving information about them. It does
19
18
  not directly modify ``/etc/group`` or anything.
@@ -130,4 +129,4 @@ module Puppet
130
129
  end
131
130
  end
132
131
 
133
- # $Id: group.rb 2551 2007-06-04 20:37:14Z luke $
132
+ # $Id: group.rb 2665 2007-07-09 21:32:33Z luke $
@@ -0,0 +1,50 @@
1
+ module Puppet
2
+ newtype(:mailalias) do
3
+ @doc = "Creates an email alias in the local alias database."
4
+
5
+ ensurable
6
+
7
+ newparam(:name, :namevar => true) do
8
+ desc "The alias name."
9
+ end
10
+
11
+ newproperty(:recipient, :array_matching => :all) do
12
+ desc "Where email should should be sent. Multiple values
13
+ should be specified as an array."
14
+
15
+ def is_to_s(value)
16
+ if value.include?(:absent)
17
+ super
18
+ else
19
+ value.join(",")
20
+ end
21
+ end
22
+
23
+ def should
24
+ @should
25
+ end
26
+
27
+ def should_to_s(value)
28
+ if value.include?(:absent)
29
+ super
30
+ else
31
+ value.join(",")
32
+ end
33
+ end
34
+ end
35
+
36
+ newproperty(:target) do
37
+ desc "The file in which to store the aliases. Only used by
38
+ those providers that write to disk (i.e., not NetInfo)."
39
+
40
+ defaultto { if @resource.class.defaultprovider.ancestors.include?(Puppet::Provider::ParsedFile)
41
+ @resource.class.defaultprovider.default_target
42
+ else
43
+ nil
44
+ end
45
+ }
46
+ end
47
+ end
48
+ end
49
+
50
+ # $Id: mailalias.rb 2676 2007-07-10 23:24:34Z luke $