puppet 0.24.4 → 0.24.5

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 (316) hide show
  1. data/CHANGELOG +170 -0
  2. data/Rakefile +6 -4
  3. data/bin/filebucket +3 -2
  4. data/bin/puppet +7 -4
  5. data/bin/puppetca +32 -14
  6. data/bin/puppetd +12 -34
  7. data/bin/puppetmasterd +3 -2
  8. data/bin/puppetrun +5 -43
  9. data/bin/ralsh +2 -2
  10. data/conf/debian/README.source +2 -0
  11. data/conf/debian/TODO.Debian +1 -0
  12. data/conf/debian/changelog +257 -0
  13. data/conf/debian/compat +1 -0
  14. data/conf/debian/control +45 -0
  15. data/conf/debian/copyright +17 -0
  16. data/conf/debian/docs +1 -0
  17. data/conf/debian/fileserver.conf +12 -0
  18. data/conf/debian/puppet.NEWS +63 -0
  19. data/conf/debian/puppet.conf +8 -0
  20. data/conf/debian/puppet.dirs +7 -0
  21. data/conf/debian/puppet.files +6 -0
  22. data/conf/debian/puppet.init +64 -0
  23. data/conf/debian/puppet.logrotate +11 -0
  24. data/conf/debian/puppet.postinst +9 -0
  25. data/conf/debian/puppet.postrm +21 -0
  26. data/conf/debian/puppet.preinst +25 -0
  27. data/conf/debian/puppetmaster.files +4 -0
  28. data/conf/debian/puppetmaster.init +58 -0
  29. data/conf/debian/rules +115 -0
  30. data/conf/debian/watch +2 -0
  31. data/conf/gentoo/init.d/puppet +1 -1
  32. data/conf/gentoo/init.d/puppetmaster +32 -31
  33. data/conf/redhat/client.init +10 -2
  34. data/conf/redhat/puppet.spec +4 -1
  35. data/conf/redhat/server.init +9 -1
  36. data/examples/{code/allatonce → allatonce} +0 -0
  37. data/examples/{code/assignments → assignments} +0 -0
  38. data/examples/{code/components → components} +0 -0
  39. data/examples/{root/etc → etc}/init.d/sleeper +0 -0
  40. data/examples/{root/etc → etc}/otherfile +0 -0
  41. data/examples/{root/etc → etc}/puppet/fileserver.conf +0 -0
  42. data/examples/{root/etc → etc}/puppet/namespaceauth.conf +0 -0
  43. data/examples/{root/etc → etc}/puppet/puppet.conf +0 -0
  44. data/examples/{root/etc → etc}/puppet/tagmail.conf +0 -0
  45. data/examples/{code/execs → execs} +0 -0
  46. data/examples/{code/file.bl → file.bl} +0 -0
  47. data/examples/{code/filedefaults → filedefaults} +0 -0
  48. data/examples/{code/fileparsing → fileparsing} +0 -0
  49. data/examples/{code/filerecursion → filerecursion} +0 -0
  50. data/examples/{code/functions → functions} +0 -0
  51. data/examples/{code/groups → groups} +0 -0
  52. data/examples/{code/head → head} +0 -0
  53. data/examples/{code/importing → importing} +0 -0
  54. data/examples/{code/mac_automount.pp → mac_automount.pp} +0 -0
  55. data/examples/{code/mac_dscl.pp → mac_dscl.pp} +0 -0
  56. data/examples/{code/mac_dscl_revert.pp → mac_dscl_revert.pp} +0 -0
  57. data/examples/{code/mac_netinfo.pp → mac_netinfo.pp} +0 -0
  58. data/examples/{code/mac_pkgdmg.pp → mac_pkgdmg.pp} +0 -0
  59. data/examples/{code/modules → modules}/sample-module.pp +0 -0
  60. data/examples/{code/modules → modules}/sample-module/README.txt +0 -0
  61. data/examples/{code/modules → modules}/sample-module/lib/puppet/parser/functions/hostname_to_dn.rb +0 -0
  62. data/examples/{code/modules → modules}/sample-module/manifests/init.pp +0 -0
  63. data/examples/{code/modules → modules}/sample-module/templates/sample.erb +0 -0
  64. data/examples/{code/nodes → nodes} +0 -0
  65. data/examples/{code/one → one} +0 -0
  66. data/examples/{code/relationships → relationships} +0 -0
  67. data/examples/{code/selectors → selectors} +0 -0
  68. data/examples/{code/simpletests → simpletests} +0 -0
  69. data/examples/{code/svncommit → svncommit} +0 -0
  70. data/ext/autotest/Rakefile +8 -0
  71. data/ext/autotest/config +43 -0
  72. data/ext/autotest/readme.rst +16 -0
  73. data/{examples/root → ext}/bin/sleeper +1 -1
  74. data/ext/emacs/puppet-mode.el +246 -184
  75. data/ext/ldap/puppet.schema +7 -2
  76. data/ext/module_puppet +4 -3
  77. data/ext/nagios/check_puppet.rb +117 -0
  78. data/ext/puppetlast +40 -0
  79. data/install.rb +12 -3
  80. data/lib/puppet.rb +1 -44
  81. data/lib/puppet/defaults.rb +23 -10
  82. data/lib/puppet/dsl.rb +2 -2
  83. data/lib/puppet/executables/client/certhandler.rb +77 -0
  84. data/lib/puppet/external/nagios.rb +1 -1
  85. data/lib/puppet/external/nagios/base.rb +60 -46
  86. data/lib/puppet/file_serving/indirection_hooks.rb +4 -2
  87. data/lib/puppet/file_serving/metadata.rb +0 -9
  88. data/lib/puppet/file_serving/terminus_helper.rb +4 -4
  89. data/lib/puppet/indirector.rb +26 -28
  90. data/lib/puppet/indirector/catalog/compiler.rb +6 -28
  91. data/lib/puppet/indirector/checksum/file.rb +2 -2
  92. data/lib/puppet/indirector/direct_file_server.rb +7 -7
  93. data/lib/puppet/indirector/envelope.rb +13 -0
  94. data/lib/puppet/indirector/exec.rb +2 -2
  95. data/lib/puppet/indirector/facts/facter.rb +2 -2
  96. data/lib/puppet/indirector/file.rb +17 -14
  97. data/lib/puppet/indirector/file_metadata/file.rb +2 -2
  98. data/lib/puppet/indirector/file_server.rb +14 -14
  99. data/lib/puppet/indirector/indirection.rb +113 -48
  100. data/lib/puppet/indirector/ldap.rb +13 -25
  101. data/lib/puppet/indirector/memory.rb +7 -7
  102. data/lib/puppet/indirector/module_files.rb +14 -14
  103. data/lib/puppet/indirector/node/exec.rb +3 -10
  104. data/lib/puppet/indirector/node/ldap.rb +138 -41
  105. data/lib/puppet/indirector/node/plain.rb +1 -8
  106. data/lib/puppet/indirector/node/rest.rb +1 -1
  107. data/lib/puppet/indirector/plain.rb +2 -2
  108. data/lib/puppet/indirector/report/processor.rb +2 -2
  109. data/lib/puppet/indirector/request.rb +42 -0
  110. data/lib/puppet/indirector/rest.rb +51 -3
  111. data/lib/puppet/indirector/terminus.rb +0 -27
  112. data/lib/puppet/indirector/yaml.rb +12 -17
  113. data/lib/puppet/metatype/attributes.rb +3 -7
  114. data/lib/puppet/metatype/evaluation.rb +2 -2
  115. data/lib/puppet/module.rb +6 -2
  116. data/lib/puppet/network/client/master.rb +29 -81
  117. data/lib/puppet/network/handler/master.rb +12 -43
  118. data/lib/puppet/network/http.rb +8 -6
  119. data/lib/puppet/network/http/handler.rb +42 -32
  120. data/lib/puppet/network/http/mongrel.rb +8 -9
  121. data/lib/puppet/network/http/mongrel/rest.rb +42 -15
  122. data/lib/puppet/network/http/webrick.rb +27 -16
  123. data/lib/puppet/network/http/webrick/rest.rb +38 -14
  124. data/lib/puppet/network/http_pool.rb +3 -2
  125. data/lib/puppet/network/server.rb +24 -22
  126. data/lib/puppet/network/xmlrpc/client.rb +6 -1
  127. data/lib/puppet/node.rb +38 -79
  128. data/lib/puppet/node/catalog.rb +9 -0
  129. data/lib/puppet/node/facts.rb +9 -1
  130. data/lib/puppet/parser/ast/function.rb +1 -1
  131. data/lib/puppet/parser/collector.rb +6 -0
  132. data/lib/puppet/parser/compiler.rb +1 -1
  133. data/lib/puppet/parser/functions.rb +25 -1
  134. data/lib/puppet/parser/interpreter.rb +2 -17
  135. data/lib/puppet/parser/parser.rb +4 -4
  136. data/lib/puppet/parser/parser_support.rb +6 -2
  137. data/lib/puppet/parser/resource.rb +6 -0
  138. data/lib/puppet/parser/templatewrapper.rb +9 -0
  139. data/lib/puppet/pgraph.rb +1 -1
  140. data/lib/puppet/property.rb +0 -1
  141. data/lib/puppet/provider.rb +9 -95
  142. data/lib/puppet/provider/confine.rb +77 -0
  143. data/lib/puppet/provider/confine/exists.rb +22 -0
  144. data/lib/puppet/provider/confine/false.rb +19 -0
  145. data/lib/puppet/provider/confine/feature.rb +17 -0
  146. data/lib/puppet/provider/confine/true.rb +20 -0
  147. data/lib/puppet/provider/confine/variable.rb +42 -0
  148. data/lib/puppet/provider/confine_collection.rb +47 -0
  149. data/lib/puppet/provider/confiner.rb +20 -0
  150. data/lib/puppet/provider/cron/crontab.rb +6 -2
  151. data/lib/puppet/provider/group/groupadd.rb +1 -1
  152. data/lib/puppet/provider/group/ldap.rb +48 -0
  153. data/lib/puppet/provider/ldap.rb +137 -0
  154. data/lib/puppet/provider/nameservice.rb +1 -2
  155. data/lib/puppet/provider/nameservice/objectadd.rb +2 -5
  156. data/lib/puppet/provider/package/dpkg.rb +16 -1
  157. data/lib/puppet/provider/package/freebsd.rb +15 -4
  158. data/lib/puppet/provider/package/gem.rb +33 -12
  159. data/lib/puppet/provider/package/pkgdmg.rb +1 -60
  160. data/lib/puppet/provider/package/ports.rb +6 -1
  161. data/lib/puppet/provider/package/rpm.rb +14 -13
  162. data/lib/puppet/provider/package/urpmi.rb +3 -3
  163. data/lib/puppet/provider/service/base.rb +4 -4
  164. data/lib/puppet/provider/service/debian.rb +1 -1
  165. data/lib/puppet/provider/service/init.rb +5 -3
  166. data/lib/puppet/provider/service/redhat.rb +35 -7
  167. data/lib/puppet/provider/ssh_authorized_key/parsed.rb +69 -0
  168. data/lib/puppet/provider/user/ldap.rb +133 -0
  169. data/lib/puppet/provider/user/useradd.rb +1 -1
  170. data/lib/puppet/rails/database/001_add_created_at_to_all_tables.rb +14 -14
  171. data/lib/puppet/rails/database/schema.rb +9 -0
  172. data/lib/puppet/rails/resource.rb +1 -0
  173. data/lib/puppet/reference/providers.rb +8 -2
  174. data/lib/puppet/reference/report.rb +23 -0
  175. data/lib/puppet/reports/rrdgraph.rb +4 -2
  176. data/lib/puppet/sslcertificates/ca.rb +9 -4
  177. data/lib/puppet/sslcertificates/support.rb +26 -2
  178. data/lib/puppet/transaction.rb +11 -16
  179. data/lib/puppet/transaction/change.rb +94 -0
  180. data/lib/puppet/transaction/event.rb +21 -0
  181. data/lib/puppet/transaction/report.rb +4 -0
  182. data/lib/puppet/type.rb +0 -2
  183. data/lib/puppet/type/file/ensure.rb +0 -5
  184. data/lib/puppet/type/file/group.rb +13 -7
  185. data/lib/puppet/type/file/source.rb +8 -15
  186. data/lib/puppet/type/file/target.rb +2 -0
  187. data/lib/puppet/type/group.rb +1 -1
  188. data/lib/puppet/type/mount.rb +4 -2
  189. data/lib/puppet/type/nagios_hostescalation.rb +3 -0
  190. data/lib/puppet/type/nagios_servicegroup.rb +3 -0
  191. data/lib/puppet/type/ssh_authorized_key.rb +56 -0
  192. data/lib/puppet/type/user.rb +3 -0
  193. data/lib/puppet/type/yumrepo.rb +0 -1
  194. data/lib/puppet/util.rb +1 -1
  195. data/lib/puppet/util/ldap.rb +5 -0
  196. data/lib/puppet/util/ldap/connection.rb +69 -0
  197. data/lib/puppet/util/ldap/generator.rb +45 -0
  198. data/lib/puppet/util/ldap/manager.rb +281 -0
  199. data/lib/puppet/util/posix.rb +2 -2
  200. data/lib/puppet/util/resource_template.rb +61 -0
  201. data/lib/puppet/util/settings.rb +63 -3
  202. data/lib/puppet/util/storage.rb +4 -0
  203. data/lib/puppet/util/warnings.rb +7 -0
  204. data/man/man8/filebucket.8 +116 -0
  205. data/man/man8/pi.8 +34 -0
  206. data/man/man8/puppet.8 +78 -0
  207. data/man/man8/puppet.conf.8 +1747 -0
  208. data/man/man8/puppetca.8 +118 -0
  209. data/man/man8/puppetd.8 +184 -0
  210. data/man/man8/puppetdoc.8 +62 -0
  211. data/man/man8/puppetmasterd.8 +87 -0
  212. data/man/man8/puppetrun.8 +151 -0
  213. data/man/man8/ralsh.8 +135 -0
  214. data/test/README +24 -0
  215. data/test/certmgr/support.rb +28 -1
  216. data/test/data/failers/badclassnoparam +10 -0
  217. data/test/data/failers/badclassparam +10 -0
  218. data/test/data/failers/badcompnoparam +9 -0
  219. data/test/data/failers/badcompparam +9 -0
  220. data/test/data/failers/badtypeparam +3 -0
  221. data/test/data/failers/noobjectrvalue +1 -0
  222. data/test/data/providers/cron/crontab.allthree +17 -0
  223. data/test/data/providers/cron/crontab.envNcomment +12 -0
  224. data/test/data/providers/cron/crontab.envNname +11 -0
  225. data/test/data/providers/cron/crontab.multirecords +12 -0
  226. data/test/data/providers/cron/crontab_collections.yaml +44 -0
  227. data/test/data/providers/cron/crontab_multiple_with_env.yaml +54 -0
  228. data/test/data/providers/cron/crontab_sample_records.yaml +272 -0
  229. data/test/data/providers/cron/examples/freebsd +2 -0
  230. data/test/data/providers/cron/examples/one +14 -0
  231. data/test/data/providers/cron/examples/openbsd +20 -0
  232. data/test/data/providers/package/testpackages.yaml +65 -0
  233. data/test/data/providers/ssh_authorized_key/parsed/authorized_keys +5 -0
  234. data/test/data/reports/1.yaml +108 -0
  235. data/test/data/reports/2.yaml +108 -0
  236. data/test/data/reports/tagmail_failers.conf +3 -0
  237. data/test/data/reports/tagmail_passers.conf +30 -0
  238. data/test/data/snippets/aliastest.pp +16 -0
  239. data/test/data/snippets/argumentdefaults +14 -0
  240. data/test/data/snippets/casestatement.pp +58 -0
  241. data/test/data/snippets/classheirarchy.pp +15 -0
  242. data/test/data/snippets/classincludes.pp +17 -0
  243. data/test/data/snippets/classpathtest +11 -0
  244. data/test/data/snippets/collection.pp +10 -0
  245. data/test/data/snippets/collection_within_virtual_definitions.pp +20 -0
  246. data/test/data/snippets/componentmetaparams.pp +11 -0
  247. data/test/data/snippets/componentrequire.pp +8 -0
  248. data/test/data/snippets/deepclassheirarchy.pp +23 -0
  249. data/test/data/snippets/defineoverrides.pp +17 -0
  250. data/test/data/snippets/emptyclass.pp +9 -0
  251. data/test/data/snippets/emptyexec.pp +3 -0
  252. data/test/data/snippets/falsevalues.pp +3 -0
  253. data/test/data/snippets/filecreate +11 -0
  254. data/test/data/snippets/fqdefinition.pp +5 -0
  255. data/test/data/snippets/fqparents.pp +11 -0
  256. data/test/data/snippets/implicititeration +15 -0
  257. data/test/data/snippets/multipleinstances +7 -0
  258. data/test/data/snippets/multisubs.pp +13 -0
  259. data/test/data/snippets/namevartest +9 -0
  260. data/test/data/snippets/scopetest +13 -0
  261. data/test/data/snippets/selectorvalues.pp +42 -0
  262. data/test/data/snippets/simpledefaults +5 -0
  263. data/test/data/snippets/simpleselector +38 -0
  264. data/test/data/snippets/singleary.pp +19 -0
  265. data/test/data/snippets/singlequote.pp +11 -0
  266. data/test/data/snippets/singleselector.pp +22 -0
  267. data/test/data/snippets/subclass_name_duplication.pp +11 -0
  268. data/test/data/snippets/tag.pp +9 -0
  269. data/test/data/snippets/tagged.pp +35 -0
  270. data/test/data/snippets/virtualresources.pp +14 -0
  271. data/test/data/types/hosts/1 +3 -0
  272. data/test/data/types/hosts/2 +13 -0
  273. data/test/data/types/hosts/solaris +5 -0
  274. data/test/data/types/mailalias/file1 +183 -0
  275. data/test/data/types/mount/freebsd.fstab +7 -0
  276. data/test/data/types/mount/linux.fstab +11 -0
  277. data/test/data/types/mount/solaris.fstab +11 -0
  278. data/test/data/types/port/1 +533 -0
  279. data/test/data/types/port/darwin +11866 -0
  280. data/test/data/types/ssh_authorized_key/1 +2 -0
  281. data/test/data/types/sshkey/1 +21 -0
  282. data/test/data/types/yumrepos/fedora-devel.repo +26 -0
  283. data/test/data/types/yumrepos/fedora.repo +9 -0
  284. data/test/language/parser.rb +8 -1
  285. data/test/lib/puppettest/runnable_test.rb +3 -0
  286. data/test/lib/puppettest/support/utils.rb +1 -1
  287. data/test/lib/rake/puppet_testtask.rb +3 -0
  288. data/test/lib/stubba.rb +1 -1
  289. data/test/network/client/ca.rb +1 -0
  290. data/test/network/client/master.rb +13 -127
  291. data/test/network/handler/master.rb +61 -80
  292. data/test/other/provider.rb +0 -45
  293. data/test/other/transactions.rb +53 -15
  294. data/test/rails/host.rb +0 -37
  295. data/test/ral/providers/cron/crontab.rb +32 -3
  296. data/test/ral/providers/provider.rb +28 -7
  297. data/test/ral/type/filesources.rb +2 -18
  298. data/test/ral/type/sshkey.rb +0 -1
  299. data/test/ral/type/user.rb +6 -0
  300. data/test/test +241 -0
  301. metadata +289 -113
  302. data/examples/root/etc/configfile +0 -0
  303. data/examples/root/etc/debian-passwd +0 -29
  304. data/examples/root/etc/debian-syslog.conf +0 -71
  305. data/lib/puppet/event.rb +0 -28
  306. data/lib/puppet/network/handler/configuration.rb +0 -184
  307. data/lib/puppet/network/http/mongrel/xmlrpc.rb +0 -4
  308. data/lib/puppet/network/http/webrick/xmlrpc.rb +0 -4
  309. data/lib/puppet/propertychange.rb +0 -141
  310. data/lib/puppet/provider/interface/redhat.rb +0 -250
  311. data/lib/puppet/provider/interface/sunos.rb +0 -133
  312. data/lib/puppet/type/interface.rb +0 -60
  313. data/lib/puppet/util/variables.rb +0 -38
  314. data/test/network/handler/configuration.rb +0 -160
  315. data/test/other/propertychange.rb +0 -140
  316. data/test/util/loadedfile.rb +0 -121
data/CHANGELOG CHANGED
@@ -1,3 +1,173 @@
1
+ 0.24.5
2
+ You can now select the encoding format when transferring the catalog,
3
+ with 'yaml' still being the default but 'marshal' being an option.
4
+ This is because testing has shown drastic performance differences
5
+ between the two, with up to 70% of compile time being spent
6
+ in YAML code. Use the 'catalog_format' setting to choose your format,
7
+ and the setting must be set on the client.
8
+
9
+ Fixed #1431 - Provider confines must now specify similar tests in one call.
10
+ I.e., you can't do confine :operatingsystem => %w{a b} and then
11
+ confine :operatingsystem => %w{b c}; you'd need to do them in one command.
12
+ This now-obsolete behaviour does not seem to be used anywhere.
13
+ The fix for #1431 is actually just removing the tests that exposed
14
+ this change; the change happened when I refactored how confines work.
15
+
16
+ Updated /spec/unit/rails.rb test
17
+
18
+ Fix #1426 - services on redhat are restarted again and status is
19
+ called from the Red Hat provider
20
+
21
+ Fixed #1414 - Return code from waitpid now right shifted 8 bits
22
+
23
+ Fixed #174 - a native type type for managing ssh authorized_keys
24
+ files is available.
25
+
26
+ Further moves from the examples directory and ext directory
27
+
28
+ Fixed #1397 One line fix, fail instead of log
29
+
30
+ Moved debian to conf and updated examples directory
31
+
32
+ Fixed #1368 - updated Red Hat init scripts
33
+
34
+ Added message referencing ReductiveLabs build library
35
+
36
+ Fixed #1396 - Added sha1 function from DavidS to core
37
+
38
+ Fixed #1399 - the ldap user provider now knows it can manage
39
+ passwords.
40
+
41
+ Fixed #1272 - if you provide a group name as the gid to an ldap
42
+ user, the name will be converted to a gid. Note that this only
43
+ looks up ldap groups, at this point; if you want to set an ldap
44
+ user's primary group to a local group, you have to specify the GID.
45
+
46
+ Fixed #1226 - gems can now specify source repositories.
47
+
48
+ Fixed #1232 - the rundir no longer specifies a user/group,
49
+ and there are now client- and server-specific yaml directories.
50
+
51
+ Fixed 1240 - puppet will function more like puppetd if graphing
52
+ or reporting are enabled.
53
+
54
+ Fixed #1231 - Exceptions during initialization should now be clearer.
55
+
56
+ Fixed #1006 - puppetrun --class works again. I added the class
57
+ membership testing to the Ldap node terminus, and added tests,
58
+ so it shouldn't break again.
59
+
60
+ Fixed #1114 - Facts in plugin directories should now be autoloaded,
61
+ as long as you're using Facter 1.5.
62
+
63
+ Fixed #1195 - Updated Gentoo init scripts
64
+
65
+ Fixed #1367 - Updated Rakefile for new daily builds
66
+
67
+ Fixed #1370 - removed test/util/loadedfile.rb tests
68
+
69
+ Fixed #1221 - aliases to titles now work for resources.
70
+
71
+ Fixed #1012 - templates in the templatedir are preferred to module templates.
72
+
73
+ Fixed #707 - special '@reboot'-style cron jobs work again.
74
+
75
+ Fixed #1360 - allowdupe works on groups again.
76
+
77
+ Fixed #1369 - the init service provider now supports HP-UX.
78
+
79
+ Removed support for the 'node_name' setting in LDAP and external node
80
+ lookups.
81
+
82
+ Also removed support for 'default' nodes in external nodes.
83
+ LDAP nodes now use the certificate name, the short name, and 'default',
84
+ but external nodes just use the certificate name and any custom terminus
85
+ types will use just the certificate name.
86
+
87
+ Fixing #1168 (for 0.24.x) -- automatically downcasing the fqdn.
88
+ Also requiring that passed in certnames be downcased; the setting
89
+ system isn't currently flexible enough to automatically downcase
90
+ it for the user.
91
+
92
+ Adding a ResourceTemplate class for using templates directly
93
+ within resources (i.e., client-side templates). This would really
94
+ only be used for composite resources that pass the results of the
95
+ template on to generated resources.
96
+
97
+ Exporting or collecting resources no longer raises an exception
98
+ when no storeconfigs is enabled, it just produces a warning.
99
+
100
+ Always using the cert name to store yaml files, which fixes #1178.
101
+ The Master handler previously provided the support for the :node_name
102
+ setting, and that functionality has now been moved into the Node
103
+ class. At the same time, the names to search through have been
104
+ changed somewhat: Previously, the certificate name and the
105
+ hostname were both used for searching, but now, the cert name
106
+ is always searched first (unless node_name == facter), but only
107
+ the Facter hostname, domain, and fqdn are used otherwise. We no
108
+ longer split the cert name, only the hostname/domain/fqdn.
109
+
110
+ Fixing transaction support for prefetching generated resources.
111
+
112
+ Adding support for settings within the existing Facter provider confines.
113
+
114
+ Moving all confine code out of the Provider class, and fixing #1197.
115
+ Created a Confiner module for the Provider class methods, enhanced
116
+ the interface between it and the Confine class to make sure binary
117
+ paths are searched for fresh each time.
118
+
119
+ Modified the 'factpath' setting to automatically configure
120
+ Facter to load facts there if a new enough version of
121
+ Facter is used.
122
+
123
+ Crontab provider: fix a parse error when a line begins with a space
124
+ character (fixes #1216)
125
+
126
+ Instead of deleting the init scripts (with --del) we should simply
127
+ disable it with chkconfig service off, and respectfully do the same
128
+ for enable => true;
129
+
130
+ Added ldap providers for users and groups.
131
+
132
+ Added support for the --all option to puppetca --clean. If
133
+ puppetca --clean --all is issued then all client certificates
134
+ are removed.
135
+
136
+ Resources now return the 'should' value for properties from
137
+ the [] accessor method (they previously threw an exception when
138
+ this method was used with properties). This shouldn't have any
139
+ affect functionally; it just makes the method equivalent to 'should'
140
+ for properties, but it works for all attribute types now.
141
+
142
+ Modified the 'master' handler to use the Catalog class to
143
+ compile node configurations, rather than using the Configuration
144
+ handler, which was never used directly. I removed the Configuration
145
+ handler as a result.
146
+
147
+ Modified the 'master' handler (responsible for sending configurations
148
+ to clients) to always return Time.now as its compile date, so
149
+ configurations will always get recompiled.
150
+
151
+ Fixed #1184 -- definitions now autoload correctly all of the time.
152
+
153
+ Removed the code from the client that tries to avoid recompiling
154
+ the catalog. The client will now always recompile, assuming it
155
+ can reach the server. It will still use the cached config if
156
+ there's a failure.
157
+
158
+ Fixing #1173 -- classes and definitions can now have the same
159
+ name as a directory with no failures.
160
+
161
+ Saving new facts now expires any cached node information.
162
+
163
+ Switching how caching is handled, so that objects now all
164
+ have an expiration date associated with them. This makes it
165
+ much easier to know whether a given cached object should be used
166
+ or if it should be regenerated.
167
+
168
+ Changing the default environment to production.
169
+
170
+ 0.24.4
1
171
  Pass source to pkg_add via the PKG_PATH environment variable if
2
172
  it ends in a '/' indicating it is a directory. Allows pkg_add
3
173
  to resolve dependancies, and make it possible to specify packages
data/Rakefile CHANGED
@@ -5,7 +5,7 @@ $: << File.expand_path(File.join(File.dirname(__FILE__), 'lib'))
5
5
  begin
6
6
  require 'rake/reductive'
7
7
  rescue LoadError
8
- $stderr.puts "You must have the Reductive build library in your RUBYLIB."
8
+ $stderr.puts "You must have the Reductive build library in your RUBYLIB; see http://github.com/lak/reductive-build/tree/master."
9
9
  exit(14)
10
10
  end
11
11
 
@@ -23,11 +23,12 @@ project = Rake::RedLabProject.new("puppet") do |p|
23
23
  'lib/puppet.rb',
24
24
  'lib/puppet/**/*.rb',
25
25
  'lib/puppet/**/*.py',
26
- 'test/**/*.rb',
26
+ 'test/**/*',
27
27
  'bin/**/*',
28
28
  'ext/**/*',
29
29
  'examples/**/*',
30
- 'conf/**/*'
30
+ 'conf/**/*',
31
+ 'man/**/*'
31
32
  ]
32
33
  p.filelist.exclude("bin/pi")
33
34
 
@@ -59,6 +60,7 @@ if project.has?(:gem)
59
60
  '--main' << 'README' <<
60
61
  '--line-numbers'
61
62
  task.test_file = "test/Rakefile"
63
+ task.author = "Luke Kanies"
62
64
  end
63
65
  end
64
66
 
@@ -101,7 +103,7 @@ def daily(package)
101
103
  edir = "/tmp/daily-export"
102
104
  Dir.mkdir edir
103
105
  Dir.chdir(edir) do
104
- sh %{svn export http://reductivelabs.com/svn/#{package}/trunk #{package} >/dev/null}
106
+ sh %{git clone git://reductivelabs.com/#{package} #{package} >/dev/null}
105
107
  sh %{tar cf - #{package} | gzip -c > #{dailyfile(package)}}
106
108
  end
107
109
  FileUtils.rm_rf(edir)
@@ -163,8 +163,9 @@ end
163
163
  # Now parse the config
164
164
  Puppet.parse_config
165
165
 
166
- Puppet.genconfig
167
- Puppet.genmanifest
166
+ if Puppet.settings.print_configs?
167
+ exit(Puppet.settings.print_configs ? 0 : 1)
168
+ end
168
169
 
169
170
  begin
170
171
  if options[:local] or options[:bucket]
data/bin/puppet CHANGED
@@ -141,8 +141,9 @@ if Puppet[:config] and File.exists? Puppet[:config]
141
141
  Puppet.settings.parse(Puppet[:config])
142
142
  end
143
143
 
144
- Puppet.genconfig
145
- Puppet.genmanifest
144
+ if Puppet.settings.print_configs?
145
+ exit(Puppet.settings.print_configs ? 0 : 1)
146
+ end
146
147
 
147
148
  # If noop is set, then also enable diffs
148
149
  if Puppet[:noop]
@@ -186,7 +187,7 @@ facts = Puppet::Node::Facts.find("me")
186
187
  facts.name = facts.values["hostname"]
187
188
 
188
189
  # Find our Node
189
- node = Puppet::Node.find_by_any_name(facts.name)
190
+ node = Puppet::Node.find(facts.name)
190
191
 
191
192
  # Merge in the facts.
192
193
  node.merge(facts.values)
@@ -206,11 +207,13 @@ end
206
207
 
207
208
  begin
208
209
  # Compile our catalog
209
- catalog = Puppet::Node::Catalog.find(node)
210
+ catalog = Puppet::Node::Catalog.find(node.name, :use_node => node)
210
211
 
211
212
  # Translate it to a RAL catalog
212
213
  catalog = catalog.to_ral
213
214
 
215
+ catalog.host_config = true if Puppet[:graph] or Puppet[:report]
216
+
214
217
  catalog.finalize
215
218
 
216
219
  # And apply it
@@ -32,14 +32,16 @@
32
32
  # '--genconfig'.
33
33
  #
34
34
  # all::
35
- # Operate on all outstanding requests. Only makes sense with '--sign',
36
- # or '--list'.
35
+ # Operate on all items. Currently only makes sense with '--sign',
36
+ # '--clean', or '--list'.
37
37
  #
38
38
  # clean::
39
39
  # Remove all files related to a host from puppetca's storage. This is
40
40
  # useful when rebuilding hosts, since new certificate signing requests
41
41
  # will only be honored if puppetca does not have a copy of a signed
42
42
  # certificate for that host. The certificate of the host remains valid.
43
+ # If '--all' is specified then all host certificates, both signed and
44
+ # unsigned, will be removed.
43
45
  #
44
46
  # debug::
45
47
  # Enable full debugging.
@@ -169,8 +171,9 @@ end
169
171
  # Now parse the config
170
172
  Puppet.parse_config
171
173
 
172
- Puppet.genconfig
173
- Puppet.genmanifest
174
+ if Puppet.settings.print_configs?
175
+ exit(Puppet.settings.print_configs ? 0 : 1)
176
+ end
174
177
 
175
178
  begin
176
179
  ca = Puppet::SSLCertificates::CA.new()
@@ -213,20 +216,35 @@ when :list
213
216
  puts ca.list_signed.collect { |cert | cert.sub(/^/,"+ ") }.join("\n")
214
217
  end
215
218
  when :clean
216
- if hosts.empty?
217
- $stderr.puts "You must specify one or more hosts to clean"
219
+ if hosts.empty? and all == false
220
+ $stderr.puts "You must specify one or more hosts to clean or --all to clean all host certificates"
218
221
  exit(24)
219
222
  end
223
+
220
224
  cleaned = false
221
- hosts.each do |host|
222
- cert = ca.getclientcert(host)[0]
223
- if cert.nil?
224
- $stderr.puts "Could not find client certificate for %s" % host
225
- next
226
- end
227
- ca.clean(host)
225
+
226
+ if all
227
+ certs = ca.list
228
+ if certs.empty?
229
+ $stderr.puts "No certificates to clean"
230
+ exit(24)
231
+ end
232
+ certs.each do |c|
233
+ ca.clean(c)
234
+ end
228
235
  cleaned = true
236
+ else
237
+ hosts.each do |host|
238
+ cert = ca.getclientcert(host)[0]
239
+ if cert.nil?
240
+ $stderr.puts "Could not find client certificate for %s" % host
241
+ next
242
+ end
243
+ ca.clean(host)
244
+ cleaned = true
245
+ end
229
246
  end
247
+
230
248
  unless cleaned
231
249
  exit(27)
232
250
  end
@@ -234,7 +252,7 @@ when :sign
234
252
  to_sign = ARGV.collect { |h| h.downcase }
235
253
  unless to_sign.length > 0 or all
236
254
  $stderr.puts(
237
- "You must specify to sign all certificates or you must specify hostnames"
255
+ "You must specify one or more hosts to sign certificates for or --all to sign all certificates"
238
256
  )
239
257
  exit(24)
240
258
  end
@@ -10,7 +10,7 @@
10
10
  #
11
11
  # puppetd [-D|--daemonize|--no-daemonize] [-d|--debug] [--disable] [--enable]
12
12
  # [-h|--help] [--fqdn <host name>] [-l|--logdest syslog|<file>|console]
13
- # [-o|--onetime] [--serve <handler>] [-t|--test]
13
+ # [-o|--onetime] [--serve <handler>] [-t|--test] [--noop]
14
14
  # [-V|--version] [-v|--verbose] [-w|--waitforcert <seconds>]
15
15
  #
16
16
  # = Description
@@ -57,7 +57,7 @@
57
57
  # parameter, so you can specify '--server <servername>' as an argument.
58
58
  #
59
59
  # See the configuration file documentation at
60
- # http://reductivelabs.com/projects/puppet/reference/configref.html for
60
+ # http://reductivelabs.com/trac/puppet/wiki/ConfigurationReference for
61
61
  # the full list of acceptable parameters. A commented list of all
62
62
  # configuration options can also be generated by running puppetd with
63
63
  # '--genconfig'.
@@ -124,6 +124,10 @@
124
124
  # Enable the most common options used for testing. These are +onetime+,
125
125
  # +verbose+, +ignorecache, and +no-usecacheonfailure+.
126
126
  #
127
+ # noop::
128
+ # Use +noop+ mode where the daemon runs in a no-op or dry-run mode. This is useful
129
+ # for seeing what changes Puppet will make without actually executing the changes.
130
+ #
127
131
  # verbose::
128
132
  # Turn on verbose reporting.
129
133
  #
@@ -158,6 +162,7 @@ trap(:INT) do
158
162
  end
159
163
 
160
164
  require 'puppet'
165
+ require 'puppet/executables/client/certhandler'
161
166
  require 'puppet/network/client'
162
167
  require 'getoptlong'
163
168
 
@@ -294,8 +299,9 @@ unless options[:setdest]
294
299
  Puppet::Util::Log.newdestination(:syslog)
295
300
  end
296
301
 
297
- Puppet.genconfig
298
- Puppet.genmanifest
302
+ if Puppet.settings.print_configs?
303
+ exit(Puppet.settings.print_configs ? 0 : 1)
304
+ end
299
305
 
300
306
  # If noop is set, then also enable diffs
301
307
  if Puppet[:noop]
@@ -338,36 +344,8 @@ if Puppet[:daemonize]
338
344
  client.daemonize
339
345
  end
340
346
 
341
- unless Puppet::Network::HttpPool.read_cert
342
- # If we don't already have the certificate, then create a client to
343
- # request one. Use the special ca stuff, don't use the normal server and port.
344
- caclient = Puppet::Network::Client.ca.new()
345
- if options[:waitforcert] > 0
346
- begin
347
- while ! caclient.request_cert do
348
- Puppet.notice "Did not receive certificate"
349
- sleep options[:waitforcert]
350
- end
351
- rescue => detail
352
- Puppet.err "Could not request certificate: %s" % detail.to_s
353
- exit(23)
354
- end
355
- else
356
- unless caclient.request_cert
357
- Puppet.notice "No certificates; exiting"
358
- exit(1)
359
- end
360
- end
361
-
362
- # Now read the new cert in.
363
- if Puppet::Network::HttpPool.read_cert
364
- # If we read it in, then get rid of our existing http connection.
365
- client.recycle_connection
366
- Puppet.notice "Got signed certificate"
367
- else
368
- Puppet.err "Could not read certificates after retrieving them"
369
- exit(34)
370
- end
347
+ unless Puppet::Executables::Client::CertHandler.new(options[:waitforcert], options[:onetime]).read_retrieve
348
+ client.recycle_connection
371
349
  end
372
350
 
373
351
  objects = []
@@ -182,8 +182,9 @@ unless options[:setdest]
182
182
  Puppet::Util::Log.newdestination(:syslog)
183
183
  end
184
184
 
185
- Puppet.genconfig
186
- Puppet.genmanifest
185
+ if Puppet.settings.print_configs?
186
+ exit(Puppet.settings.print_configs ? 0 : 1)
187
+ end
187
188
 
188
189
  # A temporary solution, to at least make the master work for now.
189
190
  Puppet::Node::Facts.terminus_class = :yaml
@@ -139,51 +139,12 @@ begin
139
139
  rescue LoadError
140
140
  $stderr.puts "Failed to load ruby LDAP library. LDAP functionality will not be available"
141
141
  end
142
+
142
143
  require 'puppet'
143
144
  require 'puppet/network/client'
145
+ require 'puppet/util/ldap/connection'
144
146
  require 'getoptlong'
145
147
 
146
-
147
- # Look up all nodes matching a given class in LDAP.
148
- def ldapnodes(klass, fqdn = true)
149
- unless defined? @ldap
150
- setupldap()
151
- end
152
-
153
- hosts = []
154
-
155
- filter = nil
156
- if klass == :all
157
- filter = "objectclass=puppetclient"
158
- else
159
- filter = "puppetclass=#{klass}"
160
- end
161
- @ldap.search(Puppet[:ldapbase], 2, filter, "cn") do |entry|
162
- # Skip the default host entry
163
- if entry.dn =~ /cn=default,/
164
- $stderr.puts "Skipping default host entry"
165
- next
166
- end
167
-
168
- if fqdn
169
- hosts << entry.dn.sub("cn=",'').sub(/ou=hosts,/i, '').gsub(",dc=",".")
170
- else
171
- hosts << entry.get_values("cn")[0]
172
- end
173
- end
174
-
175
- return hosts
176
- end
177
-
178
- def setupldap
179
- begin
180
- @ldap = Puppet::Parser::Interpreter.ldap()
181
- rescue => detail
182
- $stderr.puts "Could not connect to LDAP: %s" % detail
183
- exit(34)
184
- end
185
- end
186
-
187
148
  flags = [
188
149
  [ "--all", "-a", GetoptLong::NO_ARGUMENT ],
189
150
  [ "--tag", "-t", GetoptLong::REQUIRED_ARGUMENT ],
@@ -278,11 +239,12 @@ Puppet.parse_config
278
239
 
279
240
  if Puppet[:node_terminus] = "ldap"
280
241
  if options[:all]
281
- hosts = ldapnodes(:all, options[:fqdn])
242
+ hosts = Puppet::Node.search("whatever").collect { |node| node.name }
282
243
  puts "all: %s" % hosts.join(", ")
283
244
  else
245
+ hosts = []
284
246
  classes.each do |klass|
285
- list = ldapnodes(klass, options[:fqdn])
247
+ list = Puppet::Node.search("whatever", :class => klass).collect { |node| node.name }
286
248
  puts "%s: %s" % [klass, list.join(", ")]
287
249
 
288
250
  hosts += list