puppet 2.7.19 → 2.7.20.rc1

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 (324) hide show
  1. data/CONTRIBUTING.md +61 -238
  2. data/Gemfile +32 -0
  3. data/Gemfile.lock +44 -0
  4. data/LICENSE +1 -1
  5. data/README_DEVELOPER.md +300 -5
  6. data/Rakefile +41 -37
  7. data/ext/build_defaults.yaml +20 -0
  8. data/ext/debian/README.Debian +8 -0
  9. data/ext/debian/README.source +2 -0
  10. data/ext/debian/TODO.Debian +1 -0
  11. data/ext/debian/changelog.erb +1104 -0
  12. data/ext/debian/compat +1 -0
  13. data/ext/debian/control +142 -0
  14. data/ext/debian/copyright +361 -0
  15. data/ext/debian/docs +1 -0
  16. data/ext/debian/fileserver.conf +17 -0
  17. data/ext/debian/puppet-common.dirs +8 -0
  18. data/ext/debian/puppet-common.install +3 -0
  19. data/ext/debian/puppet-common.lintian-overrides +7 -0
  20. data/ext/debian/puppet-common.manpages +2 -0
  21. data/ext/debian/puppet-common.postinst +35 -0
  22. data/ext/debian/puppet-common.postrm +32 -0
  23. data/ext/debian/puppet-el.dirs +1 -0
  24. data/ext/debian/puppet-el.emacsen-install +25 -0
  25. data/ext/debian/puppet-el.emacsen-remove +11 -0
  26. data/ext/debian/puppet-el.emacsen-startup +9 -0
  27. data/ext/debian/puppet-el.install +1 -0
  28. data/ext/debian/puppet-testsuite.install +3 -0
  29. data/ext/debian/puppet-testsuite.lintian-overrides +4 -0
  30. data/ext/debian/puppet.NEWS +86 -0
  31. data/ext/debian/puppet.conf +14 -0
  32. data/ext/debian/puppet.default +7 -0
  33. data/ext/debian/puppet.dirs +1 -0
  34. data/ext/debian/puppet.init +118 -0
  35. data/ext/debian/puppet.install +4 -0
  36. data/ext/debian/puppet.lintian-overrides +3 -0
  37. data/ext/debian/puppet.logrotate +11 -0
  38. data/ext/debian/puppet.manpages +36 -0
  39. data/ext/debian/puppet.postinst +20 -0
  40. data/ext/debian/puppet.postrm +20 -0
  41. data/ext/debian/puppet.preinst +20 -0
  42. data/ext/debian/puppetmaster-common.install +5 -0
  43. data/ext/debian/puppetmaster-common.manpages +5 -0
  44. data/ext/debian/puppetmaster-common.puppetqd.default +27 -0
  45. data/ext/debian/puppetmaster-common.puppetqd.init +84 -0
  46. data/ext/debian/puppetmaster-passenger.dirs +4 -0
  47. data/ext/debian/puppetmaster-passenger.postinst +66 -0
  48. data/ext/debian/puppetmaster-passenger.postrm +33 -0
  49. data/ext/debian/puppetmaster.NEWS +13 -0
  50. data/ext/debian/puppetmaster.README.debian +16 -0
  51. data/ext/debian/puppetmaster.default +38 -0
  52. data/ext/debian/puppetmaster.dirs +1 -0
  53. data/ext/debian/puppetmaster.init +158 -0
  54. data/ext/debian/puppetmaster.install +1 -0
  55. data/ext/debian/puppetmaster.lintian-overrides +3 -0
  56. data/ext/debian/puppetmaster.manpages +1 -0
  57. data/ext/debian/puppetmaster.postinst +20 -0
  58. data/ext/debian/puppetmaster.postrm +5 -0
  59. data/ext/debian/puppetmaster.preinst +22 -0
  60. data/ext/debian/rules +127 -0
  61. data/ext/debian/source/format +1 -0
  62. data/ext/debian/source/options +1 -0
  63. data/ext/debian/vim-puppet.README.Debian +13 -0
  64. data/ext/debian/vim-puppet.dirs +3 -0
  65. data/ext/debian/vim-puppet.yaml +5 -0
  66. data/ext/debian/watch +2 -0
  67. data/ext/emacs/puppet-mode.el +1 -0
  68. data/{conf → ext}/osx/PackageInfo.plist +0 -0
  69. data/{conf → ext}/osx/createpackage.sh +0 -0
  70. data/ext/osx/file_mapping.yaml +38 -0
  71. data/ext/osx/preflight.erb +37 -0
  72. data/{tasks/rake/templates → ext/osx}/prototype.plist.erb +0 -0
  73. data/ext/packaging/README-Solaris.md +117 -0
  74. data/ext/packaging/README.md +255 -0
  75. data/ext/packaging/spec/spec_helper.rb +12 -0
  76. data/ext/packaging/spec/tasks/00_utils_spec.rb +66 -0
  77. data/ext/packaging/tasks/00_utils.rake +382 -0
  78. data/ext/packaging/tasks/10_setupvars.rake +71 -0
  79. data/ext/packaging/tasks/20_setupextravars.rake +25 -0
  80. data/ext/packaging/tasks/apple.rake +201 -0
  81. data/ext/packaging/tasks/clean.rake +5 -0
  82. data/ext/packaging/tasks/deb.rake +108 -0
  83. data/ext/packaging/tasks/doc.rake +20 -0
  84. data/ext/packaging/tasks/fetch.rake +18 -0
  85. data/ext/packaging/tasks/gem.rake +68 -0
  86. data/ext/packaging/tasks/ips.rake +80 -0
  87. data/ext/packaging/tasks/mock.rake +126 -0
  88. data/ext/packaging/tasks/pe_deb.rake +9 -0
  89. data/ext/packaging/tasks/pe_remote.rake +45 -0
  90. data/ext/packaging/tasks/pe_rpm.rake +21 -0
  91. data/ext/packaging/tasks/pe_ship.rake +30 -0
  92. data/ext/packaging/tasks/pe_sign.rake +27 -0
  93. data/ext/packaging/tasks/pe_sles.rake +96 -0
  94. data/ext/packaging/tasks/release.rake +73 -0
  95. data/ext/packaging/tasks/remote_build.rake +78 -0
  96. data/ext/packaging/tasks/rpm.rake +52 -0
  97. data/ext/packaging/tasks/ship.rake +78 -0
  98. data/ext/packaging/tasks/sign.rake +82 -0
  99. data/ext/packaging/tasks/tag.rake +8 -0
  100. data/ext/packaging/tasks/tar.rake +68 -0
  101. data/ext/packaging/tasks/template.rake +13 -0
  102. data/ext/packaging/tasks/update.rake +16 -0
  103. data/ext/packaging/tasks/version.rake +21 -0
  104. data/ext/project_data.yaml +24 -0
  105. data/{conf/redhat/puppet.spec → ext/redhat/puppet.spec.erb} +18 -10
  106. data/install.rb +8 -8
  107. data/lib/puppet.rb +2 -6
  108. data/lib/puppet/agent/locker.rb +2 -0
  109. data/lib/puppet/application.rb +1 -1
  110. data/lib/puppet/application/agent.rb +1 -1
  111. data/lib/puppet/application/apply.rb +1 -1
  112. data/lib/puppet/application/cert.rb +5 -6
  113. data/lib/puppet/application/describe.rb +1 -1
  114. data/lib/puppet/application/device.rb +1 -1
  115. data/lib/puppet/application/doc.rb +1 -1
  116. data/lib/puppet/application/filebucket.rb +1 -1
  117. data/lib/puppet/application/inspect.rb +1 -1
  118. data/lib/puppet/application/kick.rb +1 -1
  119. data/lib/puppet/application/master.rb +1 -1
  120. data/lib/puppet/application/resource.rb +1 -1
  121. data/lib/puppet/defaults.rb +21 -3
  122. data/lib/puppet/external/dot.rb +1 -1
  123. data/lib/puppet/face/help/global.erb +1 -1
  124. data/lib/puppet/face/module/install.rb +1 -1
  125. data/lib/puppet/face/module/list.rb +1 -1
  126. data/lib/puppet/face/module/uninstall.rb +1 -1
  127. data/lib/puppet/face/node/clean.rb +23 -18
  128. data/lib/puppet/face/parser.rb +11 -2
  129. data/lib/puppet/file_collection.rb +16 -27
  130. data/lib/puppet/file_collection/lookup.rb +6 -16
  131. data/lib/puppet/file_serving/base.rb +4 -4
  132. data/lib/puppet/indirector/catalog/static_compiler.rb +3 -4
  133. data/lib/puppet/indirector/certificate/disabled_ca.rb +22 -0
  134. data/lib/puppet/indirector/certificate_request/disabled_ca.rb +22 -0
  135. data/lib/puppet/indirector/certificate_revocation_list/disabled_ca.rb +22 -0
  136. data/lib/puppet/indirector/face.rb +2 -2
  137. data/lib/puppet/indirector/key/disabled_ca.rb +22 -0
  138. data/lib/puppet/indirector/node/exec.rb +13 -1
  139. data/lib/puppet/indirector/request.rb +4 -0
  140. data/lib/puppet/metatype/manager.rb +17 -10
  141. data/lib/puppet/network/authstore.rb +1 -1
  142. data/lib/puppet/network/rights.rb +1 -2
  143. data/lib/puppet/node/environment.rb +1 -0
  144. data/lib/puppet/parameter/value.rb +9 -3
  145. data/lib/puppet/parser/ast.rb +1 -4
  146. data/lib/puppet/parser/files.rb +1 -1
  147. data/lib/puppet/parser/functions.rb +68 -22
  148. data/lib/puppet/parser/functions/create_resources.rb +2 -3
  149. data/lib/puppet/parser/functions/shellquote.rb +21 -25
  150. data/lib/puppet/parser/lexer.rb +40 -6
  151. data/lib/puppet/parser/relationship.rb +3 -1
  152. data/lib/puppet/parser/resource.rb +2 -3
  153. data/lib/puppet/parser/resource/param.rb +3 -5
  154. data/lib/puppet/parser/scope.rb +7 -4
  155. data/lib/puppet/property.rb +5 -3
  156. data/lib/puppet/provider.rb +5 -5
  157. data/lib/puppet/provider/aixobject.rb +1 -1
  158. data/lib/puppet/provider/augeas/augeas.rb +1 -1
  159. data/lib/puppet/provider/exec/windows.rb +1 -1
  160. data/lib/puppet/provider/file/windows.rb +10 -29
  161. data/lib/puppet/provider/group/groupadd.rb +2 -3
  162. data/lib/puppet/provider/group/ldap.rb +1 -1
  163. data/lib/puppet/provider/group/windows_adsi.rb +1 -1
  164. data/lib/puppet/provider/ldap.rb +5 -1
  165. data/lib/puppet/provider/nameservice.rb +3 -3
  166. data/lib/puppet/provider/nameservice/directoryservice.rb +2 -2
  167. data/lib/puppet/provider/package/gem.rb +6 -2
  168. data/lib/puppet/provider/package/portage.rb +4 -2
  169. data/lib/puppet/provider/parsedfile.rb +1 -1
  170. data/lib/puppet/provider/scheduled_task/win32_taskscheduler.rb +2 -2
  171. data/lib/puppet/provider/service/base.rb +2 -41
  172. data/lib/puppet/provider/service/daemontools.rb +1 -1
  173. data/lib/puppet/provider/service/launchd.rb +1 -1
  174. data/lib/puppet/provider/service/redhat.rb +6 -5
  175. data/lib/puppet/provider/service/runit.rb +1 -1
  176. data/lib/puppet/provider/service/service.rb +43 -0
  177. data/lib/puppet/provider/service/windows.rb +1 -8
  178. data/lib/puppet/provider/user/user_role_add.rb +2 -1
  179. data/lib/puppet/provider/user/useradd.rb +8 -3
  180. data/lib/puppet/provider/user/windows_adsi.rb +12 -1
  181. data/lib/puppet/provider/zone/solaris.rb +1 -1
  182. data/lib/puppet/rails/inventory_node.rb +26 -13
  183. data/lib/puppet/reports.rb +1 -1
  184. data/lib/puppet/resource.rb +20 -5
  185. data/lib/puppet/resource/status.rb +1 -1
  186. data/lib/puppet/ssl/certificate_authority.rb +2 -0
  187. data/lib/puppet/ssl/host.rb +31 -6
  188. data/lib/puppet/test/test_helper.rb +3 -1
  189. data/lib/puppet/transaction/event.rb +1 -1
  190. data/lib/puppet/transaction/report.rb +2 -2
  191. data/lib/puppet/type.rb +30 -25
  192. data/lib/puppet/type/augeas.rb +1 -1
  193. data/lib/puppet/type/cron.rb +2 -2
  194. data/lib/puppet/type/exec.rb +6 -6
  195. data/lib/puppet/type/file.rb +5 -15
  196. data/lib/puppet/type/file/content.rb +1 -1
  197. data/lib/puppet/type/file/ensure.rb +1 -1
  198. data/lib/puppet/type/file/mode.rb +1 -1
  199. data/lib/puppet/type/file/selcontext.rb +6 -2
  200. data/lib/puppet/type/file/source.rb +1 -1
  201. data/lib/puppet/type/mount.rb +1 -1
  202. data/lib/puppet/type/package.rb +1 -1
  203. data/lib/puppet/type/schedule.rb +1 -1
  204. data/lib/puppet/type/scheduled_task.rb +1 -1
  205. data/lib/puppet/type/tidy.rb +1 -1
  206. data/lib/puppet/type/whit.rb +16 -9
  207. data/lib/puppet/util.rb +27 -11
  208. data/lib/puppet/util/adsi.rb +25 -23
  209. data/lib/puppet/util/autoload.rb +1 -1
  210. data/lib/puppet/util/classgen.rb +1 -1
  211. data/lib/puppet/util/feature.rb +3 -1
  212. data/lib/puppet/util/fileparsing.rb +9 -9
  213. data/lib/puppet/util/filetype.rb +55 -40
  214. data/lib/puppet/util/instance_loader.rb +5 -5
  215. data/lib/puppet/util/instrumentation.rb +3 -5
  216. data/lib/puppet/util/log_paths.rb +1 -3
  217. data/lib/puppet/util/monkey_patches.rb +34 -8
  218. data/lib/puppet/util/platform.rb +7 -0
  219. data/lib/puppet/util/posix.rb +3 -3
  220. data/lib/puppet/util/provider_features.rb +2 -3
  221. data/lib/puppet/util/rdoc.rb +4 -3
  222. data/lib/puppet/util/reference.rb +1 -1
  223. data/lib/puppet/util/selinux.rb +31 -36
  224. data/lib/puppet/util/tagging.rb +28 -6
  225. data/lib/puppet/util/windows.rb +1 -0
  226. data/lib/puppet/util/windows/error.rb +1 -1
  227. data/lib/puppet/util/windows/process.rb +3 -3
  228. data/lib/puppet/util/windows/security.rb +9 -46
  229. data/lib/puppet/util/windows/sid.rb +96 -0
  230. data/lib/puppet/util/windows/user.rb +65 -2
  231. data/lib/puppet/util/zaml.rb +109 -59
  232. data/lib/puppet/version.rb +18 -0
  233. data/spec/fixtures/unit/util/filetype/aixtab_output +44 -0
  234. data/spec/fixtures/unit/util/filetype/suntab_output +9 -0
  235. data/spec/integration/defaults_spec.rb +26 -7
  236. data/spec/integration/parser/functions_spec.rb +0 -4
  237. data/spec/integration/util/file_locking_spec.rb +1 -1
  238. data/spec/integration/util/windows/security_spec.rb +3 -23
  239. data/spec/lib/puppet_spec/files.rb +3 -3
  240. data/spec/shared_contexts/platform.rb +8 -0
  241. data/spec/spec_helper.rb +6 -1
  242. data/spec/unit/application/queue_spec.rb +2 -1
  243. data/spec/unit/configurer_spec.rb +1 -1
  244. data/spec/unit/face/{instrumentation_data.rb → instrumentation_data_spec.rb} +0 -0
  245. data/spec/unit/face/{instrumentation_listener.rb → instrumentation_listener_spec.rb} +0 -0
  246. data/spec/unit/face/{instrumentation_probe.rb → instrumentation_probe_spec.rb} +0 -0
  247. data/spec/unit/indirector/catalog/static_compiler_spec.rb +194 -0
  248. data/spec/unit/indirector/certificate/disabled_ca_spec.rb +33 -0
  249. data/spec/unit/indirector/certificate_request/disabled_ca_spec.rb +33 -0
  250. data/spec/unit/indirector/certificate_revocation_list/disabled_ca_spec.rb +33 -0
  251. data/spec/unit/indirector/key/disabled_ca_spec.rb +33 -0
  252. data/spec/unit/indirector/request_spec.rb +22 -0
  253. data/spec/unit/network/http/webrick_spec.rb +0 -7
  254. data/spec/unit/node/environment_spec.rb +8 -8
  255. data/spec/unit/parser/ast_spec.rb +0 -5
  256. data/spec/unit/parser/collector_spec.rb +1 -0
  257. data/spec/unit/parser/files_spec.rb +2 -2
  258. data/spec/unit/parser/functions/create_resources_spec.rb +3 -4
  259. data/spec/unit/parser/functions/require_spec.rb +0 -6
  260. data/spec/unit/parser/functions/shellquote_spec.rb +0 -5
  261. data/spec/unit/parser/functions/template_spec.rb +6 -1
  262. data/spec/unit/parser/functions_spec.rb +73 -23
  263. data/spec/unit/parser/lexer_spec.rb +133 -8
  264. data/spec/unit/parser/relationship_spec.rb +24 -0
  265. data/spec/unit/parser/resource_spec.rb +0 -4
  266. data/spec/unit/parser/scope_spec.rb +2 -2
  267. data/spec/unit/property_spec.rb +21 -1
  268. data/spec/unit/provider/exec/posix_spec.rb +7 -6
  269. data/spec/unit/provider/file/windows_spec.rb +29 -29
  270. data/spec/unit/provider/group/groupadd_spec.rb +36 -30
  271. data/spec/unit/provider/group/windows_adsi_spec.rb +2 -2
  272. data/spec/unit/provider/package/gem_spec.rb +12 -0
  273. data/spec/unit/provider/scheduled_task/win32_taskscheduler_spec.rb +14 -11
  274. data/spec/unit/provider/service/redhat_spec.rb +11 -1
  275. data/spec/unit/provider/service/windows_spec.rb +19 -0
  276. data/spec/unit/provider/user/ldap_spec.rb +22 -8
  277. data/spec/unit/provider/user/user_role_add_spec.rb +12 -0
  278. data/spec/unit/provider/user/useradd_spec.rb +146 -118
  279. data/spec/unit/provider/user/windows_adsi_spec.rb +24 -2
  280. data/spec/unit/puppet_spec.rb +10 -0
  281. data/spec/unit/resource/status_spec.rb +1 -1
  282. data/spec/unit/resource_spec.rb +73 -0
  283. data/spec/unit/ssl/certificate_authority_spec.rb +25 -1
  284. data/spec/unit/ssl/host_spec.rb +73 -27
  285. data/spec/unit/ssl/key_spec.rb +0 -4
  286. data/spec/unit/transaction/event_spec.rb +1 -1
  287. data/spec/unit/type/exec_spec.rb +1 -1
  288. data/spec/unit/type/file/content_spec.rb +6 -4
  289. data/spec/unit/type/file/{ctime.rb → ctime_spec.rb} +0 -0
  290. data/spec/unit/type/file/{mtime.rb → mtime_spec.rb} +0 -0
  291. data/spec/unit/type/file/{type.rb → type_spec.rb} +0 -0
  292. data/spec/unit/type/file_spec.rb +2 -12
  293. data/spec/unit/type/host_spec.rb +14 -5
  294. data/spec/unit/type/mount_spec.rb +8 -0
  295. data/spec/unit/type/scheduled_task_spec.rb +2 -2
  296. data/spec/unit/util/adsi_spec.rb +23 -8
  297. data/spec/unit/util/command_line_spec.rb +11 -2
  298. data/spec/unit/util/feature_spec.rb +12 -1
  299. data/spec/unit/util/filetype_spec.rb +161 -55
  300. data/spec/unit/util/log_spec.rb +1 -1
  301. data/spec/unit/util/monkey_patches_spec.rb +7 -0
  302. data/spec/unit/util/rdoc_spec.rb +8 -2
  303. data/spec/unit/util/selinux_spec.rb +24 -32
  304. data/spec/unit/util/windows/sid_spec.rb +100 -0
  305. data/spec/unit/util/zaml_spec.rb +165 -25
  306. data/spec/unit/util_spec.rb +3 -9
  307. data/spec/watchr.rb +2 -6
  308. data/tasks/rake/gem.rake +4 -2
  309. data/tasks/rake/sign.rake +1 -1
  310. data/test/language/parser.rb +1 -0
  311. data/test/language/scope.rb +0 -5
  312. data/test/language/snippets.rb +1 -2
  313. data/test/lib/puppettest.rb +16 -27
  314. data/test/lib/puppettest/parsertesting.rb +0 -1
  315. data/test/network/authstore.rb +2 -4
  316. data/test/puppet/defaults.rb +0 -4
  317. data/test/util/fileparsing.rb +2 -6
  318. metadata +1706 -1617
  319. data/conf/osx/preflight +0 -24
  320. data/spec/spec.opts +0 -4
  321. data/spec/unit/file_collection/lookup_spec.rb +0 -45
  322. data/spec/unit/file_collection_spec.rb +0 -52
  323. data/tasks/rake/apple.rake +0 -176
  324. data/test/puppet/errortest.rb +0 -19
@@ -1,242 +1,65 @@
1
- Checklist/Outline (The short version)
2
- =================================================
3
-
4
- * Getting Started:
5
- - Make sure you have a [Redmine account](http://projects.puppetlabs.com)
6
- - Submit a ticket for your issue, assuming one does not already exist.
7
- - Decide what to base your work off of
8
- * `2.6.x`: security fixes only
9
- * `2.7.x`: bug fixes only
10
- * `3.x`: new features that are not breaking changes
11
- * `master`: new features that are breaking changes
12
-
13
- * Making Changes:
14
- - Make sure you have a [GitHub account](https://github.com/signup/free)
15
- - Fork the repository on GitHub
16
- - Make commits of logical units.
17
- - Check for unnecessary whitespace with "git diff --check" before committing.
18
- - Make sure your commit messages are in the proper format
19
- - Make sure you have added the necessary tests for your changes
20
- - Run _all_ the tests to assure nothing else was accidentally broken
21
-
22
- * Submitting Changes:
23
- - Sign the [Contributor License Agreement](https://projects.puppetlabs.com/contributor_licenses/sign)
24
- - Push your changes to a topic branch in your fork of the repository.
25
- - Submit a pull request to the repository in the puppetlabs organization.
26
- - Update your Redmine ticket
27
-
28
- The long version
29
- ================
30
-
31
- 0. Create a Redmine ticket for the change you'd like to make.
32
-
33
- It's very important that there be a Redmine ticket for the change
34
- you are making. Considering the number of contributions which are
35
- submitted, it is crucial that we know we can find the ticket on Redmine.
36
-
37
- Before making a ticket however, be sure that one does not already exist.
38
- You can do this by searching Redmine or by trying a Google search which
39
- includes `sites:projects.puppetlabs.com` in addition to some of the keywords
40
- related to your issue.
41
-
42
- If you do not find a ticket that that accurately describes the work
43
- you're going to be doing, go ahead and create one. But be sure to
44
- look for related tickets and add them to the 'related tickets' section.
45
-
46
- 1. Decide what to base your work on.
47
-
48
- In general, you should always base your work on the oldest
49
- branch that your change is relevant to, and it will be
50
- eventually merged up. Currently, branches will be merged up as
51
- follows:
52
- 2.6.x => 2.7.x => 3.x => master
53
-
54
- Currently, this is how you should decide where to target your changes:
55
-
56
- The absolute earliest place something should be targeted is at `2.6.x`,
57
- and these should _only_ be security fixes. Anything else must be
58
- targeted at a later branch.
59
-
60
- A bug fix should be based off the the earliest place where it is
61
- relevant. If it first appears in `2.7.x`, then it should be
62
- targeted here and eventually merged up to `3.x` and master.
63
-
64
- New features which are _backwards compatible_ should be targeted
65
- at the next release, which currently is `3.x`.
66
-
67
- New features that are _breaking changes_ should be targeted at
68
- `master`.
69
-
70
- Part of deciding what to what your work should be based off of includes naming
71
- your topic branch to reflect this. Your branch name should have the following
72
- format:
73
- `ticket/target_branch/ticket_number_short_description_of_issuee`
74
-
75
- For example, if you are fixing a bug relating to the ssl spec, which has Redmine
76
- ticket number 12345, then your branch should be named:
77
- `ticket/2.7.x/12345_fix_ssl_spec_tests`
78
-
79
- There is a good chance that if you submit a pull request _from_ master _to_ master,
80
- Puppet Labs developers will suspect that you're not sure about the process. This is
81
- why clear naming of branches and basing your work off the right place will be
82
- extremely helpful in ensuring that your submission is reviewed and merged. Often times
83
- if your change is targeted at the wrong place, we will bounce it back to you and wait
84
- to review it until it has been retargeted.
85
-
86
- 2. Make separate commits for logically separate changes.
87
-
88
- Please break your commits down into logically consistent units
89
- which include new or changed tests relevent to the rest of the
90
- change. The goal of doing this is to make the diff easier to
91
- read for whoever is reviewing your code. In general, the easier
92
- your diff is to read, the more likely someone will be happy to
93
- review it and get it into the code base.
94
-
95
- If you're going to refactor a piece of code, please do so as a
96
- separate commit from your feature or bug fix changes.
97
-
98
- It's crucial that your changes include tests to make
99
- sure the bug isn't re-introduced, and that the feature isn't
100
- accidentally broken.
101
-
102
- Describe the technical detail of the change(s). If your
103
- description starts to get too long, that's a good sign that you
104
- probably need to split up your commit into more finely grained
105
- pieces.
106
-
107
- Commits which plainly describe the the things which help
108
- reviewers check the patch and future developers understand the
109
- code are much more likely to be merged in with a minimum of
110
- bike-shedding or requested changes. Ideally, the commit message
111
- would include information, and be in a form suitable for
112
- inclusion in the release notes for the version of Puppet that
113
- includes them.
114
-
115
- Please also check that you are not introducing any trailing
116
- whitespaces or other "whitespace errors". You can do this by
117
- running "git diff --check" on your changes before you commit.
118
-
119
- When writing commit messages, please be sure they meet
120
- [these standards](https://github.com/erlang/otp/wiki/Writing-good-commit-messages), and please include the ticket number in your
121
- short summary. It should look something like this: `(#12345) Fix this issue in Puppet`
122
-
123
- 3. Sign the Contributor License Agreement
124
-
125
- Before we can accept your changes, we do need a signed Puppet
126
- Labs Contributor License Agreement (CLA).
127
-
128
- You can access the CLA via the
129
- [Contributor License Agreement link](https://projects.puppetlabs.com/contributor_licenses/sign)
130
- in the top menu bar of our Redmine instance. Once you've signed
131
- the CLA, a badge will show up next to your name on the
132
- [Puppet Project Overview Page](http://projects.puppetlabs.com/projects/puppet?jump=welcome),
133
- and your name will be listed under "Contributor License Signers"
134
- section.
135
-
136
- If you have any questions about the CLA, please feel free to
137
- contact Puppet Labs via email at cla-submissions@puppetlabs.com.
138
-
139
- 4. Sending your patches
140
-
141
- To submit your changes via a GitHub pull request, you must
142
- have them on a topic branch, instead of directly on "master"
143
- or one of the release, or RC branches. It makes things much easier
144
- to keep track of, especially if you decide to work on another thing
145
- before your first change is merged in.
146
-
147
- GitHub has some pretty good
148
- [general documentation](http://help.github.com/) on using
149
- their site. They also have documentation on
150
- [creating pull requests](http://help.github.com/send-pull-requests/).
151
-
152
- In general, after pushing your topic branch up to your
153
- repository on GitHub, you'll switch to the branch in the
154
- GitHub UI and click "Pull Request" towards the top of the page
155
- in order to open a pull request.
156
-
157
- You'll want to make sure that you have the appropriate
158
- destination branch in the repository under the puppetlabs
159
- organization. This should be the same branch that you based
160
- your changes off of.
161
-
162
- 5. Update the related Redmine ticket.
163
-
164
- You should update the Redmine ticket associated
165
- with the change you submitted to include the location of your branch
166
- on the `branch` field of the ticket, and change the status to
167
- "In Topic Branch Pending Review", along with any other commentary
168
- you may wish to make.
169
-
170
- How to track the status of your change after it's been submitted
171
- ================================================================
172
-
173
- Shortly after opening a pull request, there should be an automatic
174
- email sent via GitHub. This notification is used to let the Puppet
175
- development community know about your requested change to give them a
176
- chance to review, test, and comment on the change(s).
177
-
178
- We do our best to comment on or merge submitted changes within a about week.
179
- However, if there hasn't been any commentary on the pull request or
180
- mailed patches, and it hasn't been merged in after a week, then feel
181
- free to ask for an update by replying on the mailing list to the
182
- automatic notification or mailed patches. It probably wasn't
183
- intentional, and probably just slipped through the cracks.
184
-
185
- Additional Resources
186
- ====================
187
-
188
- * [Getting additional help](http://projects.puppetlabs.com/projects/puppet/wiki/Getting_Help)
189
-
190
- * [Writing tests](http://projects.puppetlabs.com/projects/puppet/wiki/Development_Writing_Tests)
191
-
1
+ # How to contribute
2
+
3
+ Third-party patches are essential for keeping puppet great. We simply can't
4
+ access the huge number of platforms and myriad configurations for running
5
+ puppet. We want to keep it as easy as possible to contribute changes that
6
+ get things working in your environment. There are a few guidelines that we
7
+ need contributors to follow so that we can have a chance of keeping on
8
+ top of things.
9
+
10
+ ## Getting Started
11
+
12
+ * Make sure you have a [Redmine account](http://projects.puppetlabs.com)
13
+ * Make sure you have a [GitHub account](https://github.com/signup/free)
14
+ * Submit a ticket for your issue, assuming one does not already exist.
15
+ * Clearly describe the issue including steps to reproduce when it is a bug.
16
+ * Make sure you fill in the earliest version that you know has the issue.
17
+ * Fork the repository on GitHub
18
+
19
+ ## Making Changes
20
+
21
+ * Create a topic branch from where you want to base your work.
22
+ * This is usually the master branch.
23
+ * Only target release branches if you are certain your fix must be on that
24
+ branch.
25
+ * To quickly create a topic branch based on master; `git branch
26
+ fix/master/my_contribution master` then checkout the new branch with `git
27
+ checkout fix/master/my_contribution`. Please avoid working directly on the
28
+ `master` branch.
29
+ * Make commits of logical units.
30
+ * Check for unnecessary whitespace with `git diff --check` before committing.
31
+ * Make sure your commit messages are in the proper format.
32
+
33
+ ````
34
+ (#99999) Make the example in CONTRIBUTING imperative and concrete
35
+
36
+ Without this patch applied the example commit message in the CONTRIBUTING
37
+ document is not a concrete example. This is a problem because the
38
+ contributor is left to imagine what the commit message should look like
39
+ based on a description rather than an example. This patch fixes the
40
+ problem by making the example concrete and imperative.
41
+
42
+ The first line is a real life imperative statement with a ticket number
43
+ from our issue tracker. The body describes the behavior without the patch,
44
+ why this is a problem, and how the patch fixes the problem when applied.
45
+ ````
46
+
47
+ * Make sure you have added the necessary tests for your changes.
48
+ * Run _all_ the tests to assure nothing else was accidentally broken.
49
+
50
+ ## Submitting Changes
51
+
52
+ * Sign the [Contributor License Agreement](https://projects.puppetlabs.com/contributor_licenses/sign).
53
+ * Push your changes to a topic branch in your fork of the repository.
54
+ * Submit a pull request to the repository in the puppetlabs organization.
55
+ * Update your Redmine ticket to mark that you have submitted code and are ready for it to be reviewed.
56
+ * Include a link to the pull request in the ticket
57
+
58
+ # Additional Resources
59
+
60
+ * [More information on contributing](http://links.puppetlabs.com/contribute-to-puppet)
192
61
  * [Bug tracker (Redmine)](http://projects.puppetlabs.com)
193
-
194
62
  * [Contributor License Agreement](https://projects.puppetlabs.com/contributor_licenses/sign)
195
-
196
63
  * [General GitHub documentation](http://help.github.com/)
197
-
198
64
  * [GitHub pull request documentation](http://help.github.com/send-pull-requests/)
199
-
200
- If you have commit access to the repository
201
- ===========================================
202
-
203
- Even if you have commit access to the repository, you'll still need to
204
- go through the process above, and have someone else review and merge
205
- in your changes. The rule is that all changes must be reviewed by a
206
- developer on the project (that didn't write the code) to ensure that
207
- all changes go through a code review process.
208
-
209
- Having someone other than the author of the topic branch recorded as
210
- performing the merge is the record that they performed the code
211
- review.
212
-
213
- * Merging topic branches
214
-
215
- When merging code from a topic branch into the integration branch
216
- (Ex: master, 2.7.x, 1.6.x, etc.), there should always be a merge
217
- commit. You can accomplish this by always providing the `--no-ff`
218
- flag to `git merge`.
219
-
220
- git merge --no-ff --log tickets/master/1234-fix-something-broken
221
-
222
- The reason for always forcing this merge commit is that it
223
- provides a consistent way to look up what changes & commits were
224
- in a topic branch, whether that topic branch had one, or 500
225
- commits. For example, if the merge commit had an abbreviated
226
- SHA-1 of `coffeebad`, then you could use the following `git log`
227
- invocation to show you which commits it brought in:
228
-
229
- git log coffeebad^1..coffeebad^2
230
-
231
- The following would show you which changes were made on the topic
232
- branch:
233
-
234
- git diff coffeebad^1...coffeebad^2
235
-
236
- Because we _always_ merge the topic branch into the integration
237
- branch the first parent (`^1`) of a merge commit will be the most
238
- recent commit on the integration branch from just before we merged
239
- in the topic, and the second parent (`^2`) will always be the most
240
- recent commit that was made in the topic branch. This also serves
241
- as the record of who performed the code review, as mentioned
242
- above.
65
+ * #puppet-dev IRC channel on freenode.org
data/Gemfile ADDED
@@ -0,0 +1,32 @@
1
+ source :rubygems
2
+
3
+ gemspec
4
+
5
+ group(:development, :test) do
6
+ gem "facter", "~> 1.6.4", :require => false
7
+ gem "rack", "~> 1.4.1", :require => false
8
+ gem "rspec", "~> 2.10.0", :require => false
9
+ gem "mocha", "~> 0.10.5", :require => false
10
+ end
11
+
12
+ platforms :mswin, :mingw do
13
+ # See http://jenkins.puppetlabs.com/ for current Gem listings for the Windows
14
+ # CI Jobs.
15
+ gem "sys-admin", "~> 1.5.6", :require => false
16
+ gem "win32-api", "~> 1.4.8", :require => false
17
+ gem "win32-dir", "~> 0.3.7", :require => false
18
+ gem "win32-eventlog", "~> 0.5.3", :require => false
19
+ gem "win32-process", "~> 0.6.5", :require => false
20
+ gem "win32-security", "~> 0.1.4", :require => false
21
+ gem "win32-service", "~> 0.7.2", :require => false
22
+ gem "win32-taskscheduler", "~> 0.2.2", :require => false
23
+ gem "win32console", "~> 1.3.2", :require => false
24
+ gem "windows-api", "~> 0.4.1", :require => false
25
+ gem "windows-pr", "~> 1.2.1", :require => false
26
+ end
27
+
28
+ if File.exists? "#{__FILE__}.local"
29
+ eval(File.read("#{__FILE__}.local"), binding)
30
+ end
31
+
32
+ # vim:filetype=ruby
@@ -0,0 +1,44 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ puppet (2.7.19)
5
+ facter (~> 1.5)
6
+
7
+ GEM
8
+ remote: http://rubygems.org/
9
+ specs:
10
+ diff-lcs (1.1.3)
11
+ facter (1.6.11)
12
+ metaclass (0.0.1)
13
+ mocha (0.10.5)
14
+ metaclass (~> 0.0.1)
15
+ rack (1.4.1)
16
+ rspec (2.10.0)
17
+ rspec-core (~> 2.10.0)
18
+ rspec-expectations (~> 2.10.0)
19
+ rspec-mocks (~> 2.10.0)
20
+ rspec-core (2.10.1)
21
+ rspec-expectations (2.10.0)
22
+ diff-lcs (~> 1.1.3)
23
+ rspec-mocks (2.10.1)
24
+
25
+ PLATFORMS
26
+ ruby
27
+
28
+ DEPENDENCIES
29
+ facter (~> 1.6.4)
30
+ mocha (~> 0.10.5)
31
+ puppet!
32
+ rack (~> 1.4.1)
33
+ rspec (~> 2.10.0)
34
+ sys-admin (~> 1.5.6)
35
+ win32-api (~> 1.4.8)
36
+ win32-dir (~> 0.3.7)
37
+ win32-eventlog (~> 0.5.3)
38
+ win32-process (~> 0.6.5)
39
+ win32-security (~> 0.1.4)
40
+ win32-service (~> 0.7.2)
41
+ win32-taskscheduler (~> 0.2.2)
42
+ win32console (~> 1.3.2)
43
+ windows-api (~> 0.4.1)
44
+ windows-pr (~> 1.2.1)
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  Puppet - Automating Configuration Management.
2
2
 
3
- Copyright (C) 2011 Puppet Labs Inc
3
+ Copyright (C) 2005-2012 Puppet Labs Inc
4
4
 
5
5
  Puppet Labs can be contacted at: info@puppetlabs.com
6
6
 
@@ -3,6 +3,203 @@
3
3
  This file is intended to provide a place for developers and contributors to
4
4
  document what other developers need to know about changes made to Puppet.
5
5
 
6
+ # Use of RVM considered dangerous #
7
+
8
+ Use of RVM in production situations, e.g. running CI tests against this
9
+ repository, is considered dangerous. The reason we consider RVM to be
10
+ dangerous is because the default behavior of RVM is to hijack the builtin
11
+ behavior of the shell, causing Gemfile files to be loaded and evaluated when
12
+ the shell changes directories into the project root.
13
+
14
+ This behavior causes the CI Job execution environment that runs with `set -e`
15
+ to be incompatible with RVM.
16
+
17
+ We work around this issue by disabling the per-project RC file parsing using
18
+
19
+ if ! grep -qx rvm_project_rvmrc=0 ~/.rvmrc; then
20
+ echo rvm_project_rvmrc=0 >> ~/.rvmrc
21
+ fi
22
+
23
+ When we setup CI nodes, but this is not standard or expected behavior.
24
+
25
+ Please consider rbenv instead of rvm. The default behavior of rvm is difficult
26
+ to maintain with `set -e` shell environments.
27
+
28
+ # Two Types of Catalog
29
+
30
+ When working on subsystems of Puppet that deal with the catalog it is important
31
+ to be aware of the two different types of Catalog. I often ran into this when
32
+ working in Professional Services when I built a small tool to diff two catalogs
33
+ to determine if an upgrade in Puppet produces the same configuration catalogs.
34
+ As a developer I've run into this difference while working on spec tests for
35
+ the static compiler and working on spec tests for types and providers.
36
+
37
+ The two different types of catalog becomes relevant when writing spec tests
38
+ because we frequently need to wire up a fake catalog so that we can exercise
39
+ types, providers, or terminii that filter the catalog.
40
+
41
+ The two different types of catalogs are so-called "resource" catalogs and "RAL"
42
+ (resource abstraction layer) catalogs. At a high level, the resource catalog
43
+ is the in-memory object we serialize and transfer around the network. The
44
+ compiler terminus is expected to produce a resource catalog. The agent takes a
45
+ resource catalog and converts it into a RAL catalog. The RAL catalog is what
46
+ is used to apply the configuration model to the system.
47
+
48
+ Resource dependency information is most easily obtained from a RAL catalog by
49
+ walking the graph instance produced by the `relationship_graph` method.
50
+
51
+ ## Resource Catalog
52
+
53
+ If you're writing spec tests for something that deals with a catalog "server
54
+ side," a new catalog terminus for example, then you'll be dealing with a
55
+ resource catalog. You can produce a resource catalog suitable for spec tests
56
+ using something like this:
57
+
58
+ let(:catalog) do
59
+ catalog = Puppet::Resource::Catalog.new("node-name-val") # NOT certname!
60
+ rsrc = Puppet::Resource.new("file", "sshd_config",
61
+ :parameters => {
62
+ :ensure => 'file',
63
+ :source => 'puppet:///modules/filetest/sshd_config',
64
+ }
65
+ )
66
+ rsrc.file = 'site.pp'
67
+ rsrc.line = 21
68
+ catalog.add_resource(rsrc)
69
+ end
70
+
71
+ The resources in this catalog may be accessed using `catalog.resources`.
72
+ Resource dependencies are not easily walked using a resource catalog however.
73
+ To walk the dependency tree convert the catalog to a RAL catalog as described
74
+ in
75
+
76
+ ## RAL Catalog
77
+
78
+ The resource catalog may be converted to a RAL catalog using `catalog.to_ral`.
79
+ The RAL catalog contains `Puppet::Type` instances instead of `Puppet::Resource`
80
+ instances as is the case with the resource catalog.
81
+
82
+ One very useful feature of the RAL catalog are the methods to work with
83
+ resource relationships. For example:
84
+
85
+ irb> catalog = catalog.to_ral
86
+ irb> graph = catalog.relationship_graph
87
+ irb> pp graph.edges
88
+ [{ Notify[alpha] => File[/tmp/file_20.txt] },
89
+ { Notify[alpha] => File[/tmp/file_21.txt] },
90
+ { Notify[alpha] => File[/tmp/file_22.txt] },
91
+ { Notify[alpha] => File[/tmp/file_23.txt] },
92
+ { Notify[alpha] => File[/tmp/file_24.txt] },
93
+ { Notify[alpha] => File[/tmp/file_25.txt] },
94
+ { Notify[alpha] => File[/tmp/file_26.txt] },
95
+ { Notify[alpha] => File[/tmp/file_27.txt] },
96
+ { Notify[alpha] => File[/tmp/file_28.txt] },
97
+ { Notify[alpha] => File[/tmp/file_29.txt] },
98
+ { File[/tmp/file_20.txt] => Notify[omega] },
99
+ { File[/tmp/file_21.txt] => Notify[omega] },
100
+ { File[/tmp/file_22.txt] => Notify[omega] },
101
+ { File[/tmp/file_23.txt] => Notify[omega] },
102
+ { File[/tmp/file_24.txt] => Notify[omega] },
103
+ { File[/tmp/file_25.txt] => Notify[omega] },
104
+ { File[/tmp/file_26.txt] => Notify[omega] },
105
+ { File[/tmp/file_27.txt] => Notify[omega] },
106
+ { File[/tmp/file_28.txt] => Notify[omega] },
107
+ { File[/tmp/file_29.txt] => Notify[omega] }]
108
+
109
+ If the `relationship_graph` method is throwing exceptions at you, there's a
110
+ good chance the catalog is not a RAL catalog.
111
+
112
+ ## Settings Catalog ##
113
+
114
+ Be aware that Puppet creates a mini catalog and applies this catalog locally to
115
+ manage file resource from the settings. This behavior made it difficult and
116
+ time consuming to track down a race condition in
117
+ [2888](http://projects.puppetlabs.com/issues/2888).
118
+
119
+ Even more surprising, the `File[puppetdlockfile]` resource is only added to the
120
+ settings catalog if the file exists on disk. This caused the race condition as
121
+ it will exist when a separate process holds the lock while applying the
122
+ catalog.
123
+
124
+ It may be sufficient to simply be aware of the settings catalog and the
125
+ potential for race conditions it presents. An effective way to be reasonably
126
+ sure and track down the problem is to wrap the File.open method like so:
127
+
128
+ # We're wrapping ourselves around the File.open method.
129
+ # As described at: http://goo.gl/lDsv6
130
+ class File
131
+ WHITELIST = [ /pidlock.rb:39/ ]
132
+
133
+ class << self
134
+ alias xxx_orig_open open
135
+ end
136
+
137
+ def self.open(name, *rest, &block)
138
+ # Check the whitelist for any "good" File.open calls against the #
139
+ puppetdlock file
140
+ white_listed = caller(0).find do |line|
141
+ JJM_WHITELIST.find { |re| re.match(line) }
142
+ end
143
+
144
+ # If you drop into IRB here, take a look at your caller, it might be
145
+ # the ghost in the machine you're looking for.
146
+ binding.pry if name =~ /puppetdlock/ and not white_listed
147
+ xxx_orig_open(name, *rest, &block)
148
+ end
149
+ end
150
+
151
+ The settings catalog is populated by the `Puppet::Util::Settings#to\_catalog`
152
+ method.
153
+
154
+ # Ruby Dependencies #
155
+
156
+ Puppet is considered an Application as it relates to the recommendation of
157
+ adding a Gemfile.lock file to the repository and the information published at
158
+ [Clarifying the Roles of the .gemspec and
159
+ Gemfile](http://yehudakatz.com/2010/12/16/clarifying-the-roles-of-the-gemspec-and-gemfile/)
160
+
161
+ To install the dependencies run: `bundle install` to install the dependencies.
162
+
163
+ A checkout of the source repository should be used in a way that provides
164
+ puppet as a gem rather than a simple Ruby library. The parent directory should
165
+ be set along the `GEM_PATH`, preferably before other tools such as RVM that
166
+ manage gemsets using `GEM_PATH`.
167
+
168
+ For example, Puppet checked out into `/workspace/src/puppet` using `git
169
+ checkout https://github.com/puppetlabs/puppet` in `/workspace/src` can be used
170
+ with the following actions. The trick is to symlink `gems` to `src`.
171
+
172
+ $ cd /workspace
173
+ $ ln -s src gems
174
+ $ mkdir specifications
175
+ $ pushd specifications; ln -s ../gems/puppet/puppet.gemspec; popd
176
+ $ export GEM_PATH="/workspace:${GEM_PATH}"
177
+ $ gem list puppet
178
+
179
+ This should list out
180
+
181
+ puppet (2.7.19)
182
+
183
+ ## Bundler ##
184
+
185
+ With a source checkout of Puppet properly setup as a gem, dependencies can be
186
+ installed using [Bundler](http://gembundler.com/)
187
+
188
+ $ bundle install
189
+ Fetching gem metadata from http://rubygems.org/........
190
+ Using diff-lcs (1.1.3)
191
+ Installing facter (1.6.11)
192
+ Using metaclass (0.0.1)
193
+ Using mocha (0.10.5)
194
+ Using puppet (2.7.19) from source at /workspace/puppet-2.7.x/src/puppet
195
+ Using rack (1.4.1)
196
+ Using rspec-core (2.10.1)
197
+ Using rspec-expectations (2.10.0)
198
+ Using rspec-mocks (2.10.1)
199
+ Using rspec (2.10.0)
200
+ Using bundler (1.1.5)
201
+ Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
202
+
6
203
  # UTF-8 Handling #
7
204
 
8
205
  As Ruby 1.9 becomes more commonly used with Puppet, developers should be aware
@@ -89,10 +286,10 @@ Puppet directly from source without using install.rb or copying files around.
89
286
  ## Common Issues ##
90
287
 
91
288
  * Don't assume file paths start with '/', as that is not a valid path on
92
- Windows. Use Puppet::Util.absolute_path? to validate that a path is fully
289
+ Windows. Use Puppet::Util.absolute\_path? to validate that a path is fully
93
290
  qualified.
94
291
 
95
- * Use File.expand_path('/tmp') in tests to generate a fully qualified path
292
+ * Use File.expand\_path('/tmp') in tests to generate a fully qualified path
96
293
  that is valid on POSIX and Windows. In the latter case, the current working
97
294
  directory will be used to expand the path.
98
295
 
@@ -108,11 +305,11 @@ Puppet directly from source without using install.rb or copying files around.
108
305
 
109
306
  IO.open(path, 'rb')
110
307
 
111
- * Don't assume file paths are separated by ':'. Use File::PATH_SEPARATOR
308
+ * Don't assume file paths are separated by ':'. Use `File::PATH_SEPARATOR`
112
309
  instead, which is ':' on POSIX and ';' on Windows.
113
310
 
114
- * On Windows, File::SEPARATOR is '/', and File::ALT_SEPARATOR is '\'. On
115
- POSIX systems, File::ALT_SEPARATOR is nil. In general, use '/' as the
311
+ * On Windows, File::SEPARATOR is '/', and `File::ALT_SEPARATOR` is '\'. On
312
+ POSIX systems, `File::ALT_SEPARATOR` is nil. In general, use '/' as the
116
313
  separator as most Windows APIs, e.g. CreateFile, accept both types of
117
314
  separators.
118
315
 
@@ -123,4 +320,102 @@ Puppet directly from source without using install.rb or copying files around.
123
320
  * Don't assume 'C' drive. Use environment variables to look these up:
124
321
 
125
322
  "#{ENV['windir']}/system32/netsh.exe"
323
+
324
+ # Determining the Puppet Version
325
+
326
+ If you need to programmatically work with the Puppet version, please use the
327
+ following:
328
+
329
+ require 'puppet/version'
330
+ # Get the version baked into the sourcecode:
331
+ version = Puppet.version
332
+ # Set the version (e.g. in a Rakefile based on `git describe`)
333
+ Puppet.version = '2.3.4'
334
+
335
+ Please do not monkey patch the constant `Puppet::PUPPETVERSION` or obtain the
336
+ version using the constant. The only supported way to set and get the Puppet
337
+ version is through the accessor methods.
338
+
339
+ # Static Compiler
340
+
341
+ The static compiler was added to Puppet in the 2.7.0 release.
342
+ [1](http://links.puppetlabs.com/static-compiler-announce)
343
+
344
+ The static compiler is intended to provide a configuration catalog that
345
+ requires a minimal amount of network communication in order to apply the
346
+ catalog to the system. As implemented in Puppet 2.7.x and Puppet 3.0.x this
347
+ intention takes the form of replacing all of the source parameters of File
348
+ resources with a content parameter containing an address in the form of a
349
+ checksum. The expected behavior is that the process applying the catalog to
350
+ the node will retrieve the file content from the FileBucket instead of the
351
+ FileServer.
352
+
353
+ The high level approach can be described as follows. The `StaticCompiler` is a
354
+ terminus that inserts itself between the "normal" compiler terminus and the
355
+ request. The static compiler takes the resource catalog produced by the
356
+ compiler and filters all File resources. Any file resource that contains a
357
+ source parameter with a value starting with 'puppet://' is filtered in the
358
+ following way in a "standard" single master / networked agents deployment
359
+ scenario:
360
+
361
+ 1. The content, owner, group, and mode values are retrieved from th
362
+ FileServer by the master.
363
+ 2. The file content is stored in the file bucket on the master.
364
+ 3. The source parameter value is stripped from the File resource.
365
+ 4. The content parameter value is set in the File resource using the form
366
+ '{XXX}1234567890' which can be thought of as a content address indexed by
367
+ checksum.
368
+ 5. The owner, group and mode values are set in the File resource if they are
369
+ not already set.
370
+ 6. The filtered catalog is returned in the response.
371
+
372
+ In addition to the catalog terminus, the process requesting the catalog needs
373
+ to obtain the file content. The default behavior of `puppet agent` is to
374
+ obtain file contents from the local client bucket. The method we expect users
375
+ to employ to reconfigure the agent to use the server bucket is to declare the
376
+ `Filebucket[puppet]` resource with the address of the master. For example:
377
+
378
+ node default {
379
+ filebucket { puppet:
380
+ server => $server,
381
+ path => false,
382
+ }
383
+ class { filetest: }
384
+ }
385
+
386
+ This special filebucket resource named "puppet" will cause the agent to fetch
387
+ file contents specified by checksum from the remote filebucket instead of the
388
+ default clientbucket.
389
+
390
+ ## Quick start
391
+
392
+ Create a module that recursively downloads something. The jeffmccune-filetest
393
+ module will recursively copy the rubygems source tree.
394
+
395
+ $ puppet module install jeffmccune-filetest
396
+
397
+ Start the master with the StaticCompiler turned on:
398
+
399
+ $ puppet master \
400
+ --catalog_terminus=static_compiler \
401
+ --verbose \
402
+ --no-daemonize
403
+
404
+ Add the special Filebucket[puppet] resource:
405
+
406
+ # site.pp
407
+ node default {
408
+ filebucket { puppet: server => $server, path => false }
409
+ class { filetest: }
410
+ }
411
+
412
+ Get the static catalog:
413
+
414
+ $ puppet agent --test
415
+
416
+ You should expect all file metadata to be contained in the catalog, including a
417
+ checksum representing the content. When managing an out of sync file resource,
418
+ the real contents should be fetched from the server instead of the
419
+ clientbucket.
420
+
126
421
  EOF