puppet 3.1.0.rc1 → 3.1.0.rc2

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 (127) hide show
  1. data/COMMITTERS.md +185 -0
  2. data/ext/debian/changelog.erb +6 -0
  3. data/ext/debian/puppet-common.manpages +1 -0
  4. data/ext/debian/puppet.default +3 -1
  5. data/ext/debian/puppetmaster.default +6 -3
  6. data/ext/redhat/puppet.spec.erb +16 -5
  7. data/lib/puppet.rb +3 -5
  8. data/lib/puppet/defaults.rb +6 -5
  9. data/lib/puppet/dsl.rb +3 -7
  10. data/lib/puppet/dsl/resource_api.rb +120 -0
  11. data/lib/puppet/dsl/resource_type_api.rb +34 -0
  12. data/lib/puppet/module_tool.rb +23 -11
  13. data/lib/puppet/network/formats.rb +1 -1
  14. data/lib/puppet/node/environment.rb +1 -3
  15. data/lib/puppet/parser/ast/definition.rb +5 -2
  16. data/lib/puppet/parser/ast/hostclass.rb +3 -2
  17. data/lib/puppet/parser/ast/node.rb +5 -2
  18. data/lib/puppet/parser/ast/resourceparam.rb +1 -1
  19. data/lib/puppet/parser/compiler.rb +0 -10
  20. data/lib/puppet/parser/lexer.rb +50 -39
  21. data/lib/puppet/parser/parser_support.rb +29 -11
  22. data/lib/puppet/parser/scope.rb +2 -2
  23. data/lib/puppet/parser/type_loader.rb +7 -31
  24. data/lib/puppet/provider/package/openbsd.rb +16 -2
  25. data/lib/puppet/provider/package/pip.rb +11 -2
  26. data/lib/puppet/provider/package/portage.rb +29 -12
  27. data/lib/puppet/provider/service/launchd.rb +19 -14
  28. data/lib/puppet/provider/service/upstart.rb +1 -1
  29. data/lib/puppet/provider/user/hpux.rb +37 -2
  30. data/lib/puppet/resource.rb +25 -38
  31. data/lib/puppet/resource/type.rb +6 -14
  32. data/lib/puppet/settings.rb +1 -1
  33. data/lib/puppet/ssl/certificate_authority.rb +4 -1
  34. data/lib/puppet/ssl/certificate_request.rb +3 -1
  35. data/lib/puppet/ssl/certificate_signer.rb +22 -0
  36. data/lib/puppet/type.rb +4 -4
  37. data/lib/puppet/util/methodhelper.rb +0 -19
  38. data/lib/puppet/util/rubygems.rb +3 -1
  39. data/lib/puppet/util/selinux.rb +1 -6
  40. data/lib/puppet/version.rb +1 -1
  41. data/man/man5/puppet.conf.5 +81 -95
  42. data/man/man8/extlookup2hiera.8 +23 -0
  43. data/man/man8/puppet-agent.8 +3 -3
  44. data/man/man8/puppet-apply.8 +2 -6
  45. data/man/man8/puppet-ca.8 +6 -7
  46. data/man/man8/puppet-catalog.8 +6 -7
  47. data/man/man8/puppet-cert.8 +4 -4
  48. data/man/man8/puppet-certificate.8 +6 -7
  49. data/man/man8/puppet-certificate_request.8 +6 -7
  50. data/man/man8/puppet-certificate_revocation_list.8 +6 -7
  51. data/man/man8/puppet-config.8 +4 -8
  52. data/man/man8/puppet-describe.8 +1 -1
  53. data/man/man8/puppet-device.8 +1 -1
  54. data/man/man8/puppet-doc.8 +3 -3
  55. data/man/man8/puppet-facts.8 +4 -8
  56. data/man/man8/puppet-file.8 +6 -7
  57. data/man/man8/puppet-filebucket.8 +1 -1
  58. data/man/man8/puppet-help.8 +2 -6
  59. data/man/man8/puppet-inspect.8 +1 -1
  60. data/man/man8/puppet-instrumentation_data.8 +3 -7
  61. data/man/man8/puppet-instrumentation_listener.8 +3 -7
  62. data/man/man8/puppet-instrumentation_probe.8 +3 -7
  63. data/man/man8/puppet-key.8 +6 -7
  64. data/man/man8/puppet-kick.8 +5 -1
  65. data/man/man8/puppet-man.8 +2 -6
  66. data/man/man8/puppet-master.8 +2 -2
  67. data/man/man8/puppet-module.8 +11 -9
  68. data/man/man8/puppet-node.8 +38 -37
  69. data/man/man8/puppet-parser.8 +2 -6
  70. data/man/man8/puppet-plugin.8 +2 -6
  71. data/man/man8/puppet-queue.8 +1 -1
  72. data/man/man8/puppet-report.8 +3 -7
  73. data/man/man8/puppet-resource.8 +1 -1
  74. data/man/man8/puppet-resource_type.8 +3 -7
  75. data/man/man8/puppet-secret_agent.8 +2 -6
  76. data/man/man8/puppet-status.8 +3 -7
  77. data/man/man8/puppet.8 +1 -1
  78. data/spec/integration/parser/ruby_manifest_spec.rb +128 -0
  79. data/spec/lib/puppet_spec/compiler.rb +0 -11
  80. data/spec/spec_helper.rb +3 -4
  81. data/spec/unit/dsl/resource_api_spec.rb +180 -0
  82. data/spec/unit/dsl/resource_type_api_spec.rb +53 -0
  83. data/spec/unit/module_tool_spec.rb +79 -46
  84. data/spec/unit/network/formats_spec.rb +4 -0
  85. data/spec/unit/node/environment_spec.rb +0 -13
  86. data/spec/unit/parser/compiler_spec.rb +0 -26
  87. data/spec/unit/parser/parser_spec.rb +14 -0
  88. data/spec/unit/parser/type_loader_spec.rb +4 -15
  89. data/spec/unit/provider/package/openbsd_spec.rb +148 -35
  90. data/spec/unit/provider/package/pip_spec.rb +49 -25
  91. data/spec/unit/provider/package/portage_spec.rb +65 -0
  92. data/spec/unit/provider/service/launchd_spec.rb +6 -5
  93. data/spec/unit/provider/user/hpux_spec.rb +39 -11
  94. data/spec/unit/provider/user/useradd_spec.rb +14 -14
  95. data/spec/unit/resource/type_spec.rb +7 -49
  96. data/spec/unit/resource_spec.rb +0 -32
  97. data/spec/unit/ssl/certificate_request_spec.rb +18 -0
  98. data/spec/unit/util/rubygems_spec.rb +1 -1
  99. data/spec/unit/util/selinux_spec.rb +0 -2
  100. metadata +17 -50
  101. data/lib/puppet/dsl/actions.rb +0 -283
  102. data/lib/puppet/dsl/blank_slate.rb +0 -55
  103. data/lib/puppet/dsl/context.rb +0 -393
  104. data/lib/puppet/dsl/parser.rb +0 -57
  105. data/lib/puppet/dsl/resource_decorator.rb +0 -56
  106. data/lib/puppet/dsl/resource_reference.rb +0 -95
  107. data/lib/puppet/dsl/type_reference.rb +0 -102
  108. data/lib/puppet/util/manifest_filetype_helper.rb +0 -22
  109. data/spec/integration/dsl/classes_spec.rb +0 -191
  110. data/spec/integration/dsl/defaults_spec.rb +0 -38
  111. data/spec/integration/dsl/definitions_spec.rb +0 -73
  112. data/spec/integration/dsl/functions_spec.rb +0 -95
  113. data/spec/integration/dsl/nodes_spec.rb +0 -96
  114. data/spec/integration/dsl/params_spec.rb +0 -146
  115. data/spec/integration/dsl/relationships_spec.rb +0 -46
  116. data/spec/integration/dsl/resources_spec.rb +0 -202
  117. data/spec/integration/dsl/type_loading_spec.rb +0 -64
  118. data/spec/lib/matchers/catalog.rb +0 -50
  119. data/spec/lib/puppet_spec/dsl.rb +0 -29
  120. data/spec/unit/dsl/actions_spec.rb +0 -402
  121. data/spec/unit/dsl/blank_slate_spec.rb +0 -27
  122. data/spec/unit/dsl/context_spec.rb +0 -678
  123. data/spec/unit/dsl/parser_spec.rb +0 -56
  124. data/spec/unit/dsl/resource_decorator_spec.rb +0 -94
  125. data/spec/unit/dsl/resource_reference_spec.rb +0 -150
  126. data/spec/unit/dsl/type_reference_spec.rb +0 -164
  127. data/spec/unit/util/manifest_filetype_helper_spec.rb +0 -29
@@ -1,38 +0,0 @@
1
- require 'puppet'
2
- require 'spec_helper'
3
- require 'matchers/catalog'
4
- require 'puppet_spec/compiler'
5
-
6
- include PuppetSpec::Compiler
7
-
8
- describe Puppet::DSL do
9
- prepare_compiler
10
-
11
- before :each do
12
- @catalog = compile_to_catalog(<<-MANIFEST)
13
- Notify { message => "foo" }
14
- MANIFEST
15
- end
16
-
17
- describe "defaults" do
18
-
19
- it "should be able to update defaults for a resource" do
20
- r = compile_ruby_to_catalog(<<-MANIFEST)
21
- Notify.defaults :message => "foo"
22
- MANIFEST
23
-
24
- @catalog.should be_equivalent_to_catalog r
25
- end
26
-
27
- it "should be able to update defaults for a resource passing a block" do
28
- r = compile_ruby_to_catalog(<<-MANIFEST)
29
- Notify.defaults do |n|
30
- n.message = "foo"
31
- end
32
- MANIFEST
33
-
34
- @catalog.should be_equivalent_to_catalog r
35
- end
36
- end
37
- end
38
-
@@ -1,73 +0,0 @@
1
- require 'spec_helper'
2
- require 'matchers/catalog'
3
- require 'puppet_spec/compiler'
4
-
5
- include PuppetSpec::Compiler
6
-
7
- describe Puppet::DSL do
8
- prepare_compiler
9
-
10
- describe "definitions" do
11
-
12
- it "should be able to create the definition" do
13
- p = compile_to_catalog(<<-MANIFEST)
14
- define foo() {
15
- notify {"foo": }
16
- }
17
- MANIFEST
18
-
19
- r = compile_ruby_to_catalog(<<-MANIFEST)
20
- define :foo do
21
- notify "foo"
22
- end
23
- MANIFEST
24
-
25
- r.should be_equivalent_to_catalog p
26
- end
27
-
28
- it "should be able to create a resource using definition" do
29
- p = compile_to_catalog(<<-MANIFEST)
30
- define foo() {
31
- notify {"foo": }
32
- }
33
-
34
- foo {"bar": }
35
- MANIFEST
36
-
37
- r = compile_ruby_to_catalog(<<-MANIFEST)
38
- define :foo do
39
- notify "foo"
40
- end
41
-
42
- foo "bar"
43
- MANIFEST
44
- r.resources.map(&:name).should include "Foo/bar"
45
-
46
- r.should be_equivalent_to_catalog p
47
- end
48
-
49
- it "should be able to create a definition with arguments" do
50
- p = compile_to_catalog(<<-MANIFEST)
51
- define foo($name) {
52
- notify {"$name": }
53
- }
54
-
55
- foo {"bar": name => "asdf"}
56
- MANIFEST
57
-
58
- r = compile_ruby_to_catalog(<<-MANIFEST)
59
- define :foo, :arguments => {:name => nil} do
60
- notify params[:name]
61
- end
62
-
63
- foo "bar", :name => "asdf"
64
- MANIFEST
65
- r.resources.map(&:name).should include "Notify/asdf"
66
-
67
- r.should be_equivalent_to_catalog p
68
-
69
- end
70
-
71
- end
72
- end
73
-
@@ -1,95 +0,0 @@
1
- require 'puppet'
2
- require 'spec_helper'
3
- require 'matchers/catalog'
4
- require 'puppet_spec/compiler'
5
-
6
- include PuppetSpec::Compiler
7
-
8
- describe Puppet::DSL do
9
- prepare_compiler
10
-
11
- describe "functions" do
12
-
13
- it "should be able to use a function from a node" do
14
- p = compile_to_catalog(<<-MANIFEST)
15
- node default {
16
- notice("foo")
17
- }
18
- MANIFEST
19
-
20
- r = compile_ruby_to_catalog(<<-MANIFEST)
21
- node "default" do
22
- notice "foo"
23
- end
24
- MANIFEST
25
-
26
- r.should be_equivalent_to_catalog p
27
- end
28
-
29
- it "should be able to use a function from a hostclass" do
30
- p = compile_to_catalog(<<-MANIFEST)
31
- class foo {
32
- notice("foo")
33
- }
34
-
35
- include foo
36
- MANIFEST
37
-
38
- r = compile_ruby_to_catalog(<<-MANIFEST)
39
- hostclass :foo do
40
- notice "foo"
41
- end
42
-
43
- use :foo
44
- MANIFEST
45
-
46
- r.should be_equivalent_to_catalog p
47
- end
48
-
49
- it "should be able to use a function from a definition" do
50
- p = compile_to_catalog(<<-MANIFEST)
51
- define foo() {
52
- notice("foo")
53
- }
54
-
55
- foo {"bar": }
56
- MANIFEST
57
-
58
- r = compile_ruby_to_catalog(<<-MANIFEST)
59
- define :foo do
60
- notice "foo"
61
- end
62
-
63
- foo "bar"
64
- MANIFEST
65
-
66
- r.should be_equivalent_to_catalog p
67
- end
68
-
69
- it "should be able to use a function from top level scope" do
70
- p = compile_to_catalog(<<-MANIFEST)
71
- notice("foo")
72
- MANIFEST
73
-
74
- r = compile_ruby_to_catalog(<<-MANIFEST)
75
- notice "foo"
76
- MANIFEST
77
-
78
- r.should be_equivalent_to_catalog p
79
- end
80
-
81
- it "should be able to pass parameters to the function" do
82
- p = compile_to_catalog(<<-MANIFEST)
83
- notice("foo", "bar", 3)
84
- MANIFEST
85
-
86
- r = compile_ruby_to_catalog(<<-MANIFEST)
87
- notice "foo", "bar", 3
88
- MANIFEST
89
-
90
- r.should be_equivalent_to_catalog p
91
- end
92
-
93
- end
94
- end
95
-
@@ -1,96 +0,0 @@
1
- require 'puppet'
2
- require 'spec_helper'
3
- require 'matchers/catalog'
4
- require 'puppet_spec/compiler'
5
-
6
- include PuppetSpec::Compiler
7
-
8
- describe Puppet::DSL do
9
- prepare_compiler
10
-
11
- describe "nodes" do
12
-
13
- it "should be able to create default node" do
14
- p = compile_to_catalog(<<-MANIFEST)
15
- node default {
16
- notify{"foo": }
17
- }
18
- MANIFEST
19
-
20
- r = compile_ruby_to_catalog(<<-MANIFEST)
21
- node "default" do
22
- notify "foo"
23
- end
24
- MANIFEST
25
- r.resources.map(&:name).should include "Notify/foo"
26
-
27
- r.should be_equivalent_to_catalog p
28
- end
29
-
30
- it "should be able to create named node" do
31
- p = compile_to_catalog(<<-MANIFEST)
32
- node "foonode" {
33
- notify{"foo": }
34
- }
35
- MANIFEST
36
-
37
- r = compile_ruby_to_catalog(<<-MANIFEST)
38
- node "foonode" do
39
- notify "foo"
40
- end
41
- MANIFEST
42
- r.resources.map(&:name).should include "Notify/foo"
43
-
44
- r.should be_equivalent_to_catalog p
45
- end
46
-
47
- it "should be able to create node with regexp" do
48
- p = compile_to_catalog(<<-MANIFEST)
49
- node /^foo/ {
50
- notify{"foo": }
51
- }
52
- MANIFEST
53
-
54
- r = compile_ruby_to_catalog(<<-MANIFEST)
55
- node /^foo/ do
56
- notify "foo"
57
- end
58
- MANIFEST
59
- r.resources.map(&:name).should include "Notify/foo"
60
-
61
- r.should be_equivalent_to_catalog p
62
- end
63
-
64
- it "should be able to create node inheriting from another node" do
65
- p = compile_to_catalog(<<-MANIFEST)
66
- node "base.example.com" {
67
- notify {"base": }
68
- }
69
-
70
- node "foonode" inherits "base.example.com" {
71
- notify {"foonode": }
72
- }
73
- MANIFEST
74
-
75
- r = compile_ruby_to_catalog(<<-MANIFEST)
76
- node "base.example.com" do
77
- notify "base"
78
- end
79
-
80
- node "foonode", :inherits => "base.example.com" do
81
- notify "foonode"
82
- end
83
- MANIFEST
84
-
85
- r.resources.map(&:name).tap do |names|
86
- %w[base foonode].each do |node_name|
87
- names.should include "Notify/#{node_name}"
88
- end
89
- end
90
-
91
- r.should be_equivalent_to_catalog p
92
- end
93
-
94
- end
95
- end
96
-
@@ -1,146 +0,0 @@
1
- require 'puppet'
2
- require 'spec_helper'
3
- require 'matchers/catalog'
4
- require 'puppet_spec/compiler'
5
-
6
- include PuppetSpec::Compiler
7
-
8
- describe Puppet::DSL do
9
- prepare_compiler
10
-
11
- describe "params" do
12
-
13
- it "should be able to set and read a variable" do
14
- p = compile_to_catalog(<<-MANIFEST)
15
- node default {
16
- $asdf = "foo"
17
-
18
- notify {"$asdf": }
19
- }
20
- MANIFEST
21
-
22
- r = compile_ruby_to_catalog(<<-MANIFEST)
23
- node "default" do
24
- params[:asdf] = "foo"
25
-
26
- notify params[:asdf]
27
- end
28
- MANIFEST
29
- r.resources.map(&:name).should include "Notify/foo"
30
-
31
- r.should be_equivalent_to_catalog p
32
- end
33
-
34
- it "should be able to read params for a resource" do
35
- p = compile_to_catalog(<<-MANIFEST)
36
- define foo($msg) {
37
- notify {"$msg": }
38
- }
39
-
40
- foo {"foo": msg => "asdf"}
41
- MANIFEST
42
-
43
- r = compile_ruby_to_catalog(<<-MANIFEST)
44
- define :foo, :arguments => {:msg => nil} do
45
- notify params[:msg]
46
- end
47
-
48
- foo :foo, :msg => "asdf"
49
- MANIFEST
50
- r.resources.map(&:name).should include "Notify/asdf"
51
-
52
- r.should be_equivalent_to_catalog p
53
- end
54
-
55
- context "defined in outer scope" do
56
- it "should available in inner scope" do
57
- p = compile_to_catalog(<<-MANIFEST)
58
- $foobar = "baz"
59
- define foo() {
60
- notify {"$foobar": }
61
- }
62
-
63
- foo {"foo": }
64
- MANIFEST
65
-
66
- r = compile_ruby_to_catalog(<<-MANIFEST)
67
- params[:foobar] = "baz"
68
-
69
- define :foo do
70
- notify params[:foobar]
71
- end
72
-
73
- foo :foo
74
- MANIFEST
75
- r.resources.map(&:name).should include "Notify/baz"
76
-
77
- r.should be_equivalent_to_catalog p
78
- end
79
-
80
- it "should be overwritten in inner scope" do
81
- p = compile_to_catalog(<<-MANIFEST)
82
- $foobar = "baz"
83
- define foo() {
84
- $foobar = "asdf"
85
- notify {"$foobar": }
86
- }
87
-
88
- foo {"foo": }
89
- MANIFEST
90
-
91
- r = compile_ruby_to_catalog(<<-MANIFEST)
92
- params[:foobar] = "baz"
93
-
94
- define :foo do
95
- params[:foobar] = "asdf"
96
- notify params[:foobar]
97
- end
98
-
99
- foo :foo
100
- MANIFEST
101
- r.resources.map(&:name).should include "Notify/asdf"
102
-
103
- r.should be_equivalent_to_catalog p
104
- end
105
-
106
- it "should not be overwritten in outer scope" do
107
- p = compile_to_catalog(<<-MANIFEST)
108
- $foobar = "baz"
109
- define foo() {
110
- $foobar = "asdf"
111
- notify {"$foobar": }
112
- }
113
-
114
- notify {"$foobar": }
115
-
116
- foo {"foo": }
117
- MANIFEST
118
-
119
- r = compile_ruby_to_catalog(<<-MANIFEST)
120
- params[:foobar] = "baz"
121
-
122
- define :foo do
123
- params[:foobar] = "asdf"
124
- notify params[:foobar]
125
- end
126
-
127
- notify params[:foobar]
128
-
129
- foo :foo
130
- MANIFEST
131
- r.resources.map(&:name).tap do |names|
132
- %w[asdf baz].each do |name|
133
- names.should include "Notify/#{name}"
134
- end
135
- end
136
-
137
- r.should be_equivalent_to_catalog p
138
-
139
-
140
- end
141
-
142
- end
143
-
144
- end
145
- end
146
-