puppet-parse 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (742) hide show
  1. data/.travis.yml +0 -5
  2. data/README.md +1 -3
  3. data/lib/puppet-parse/version.rb +1 -1
  4. data/lib/puppet-parse.rb +2 -2
  5. data/lib/vendor/puppet/agent/locker.rb +46 -0
  6. data/lib/vendor/puppet/agent.rb +99 -0
  7. data/lib/vendor/puppet/application/agent.rb +489 -0
  8. data/lib/vendor/puppet/application/apply.rb +266 -0
  9. data/lib/vendor/puppet/application/ca.rb +5 -0
  10. data/lib/vendor/puppet/application/catalog.rb +4 -0
  11. data/lib/vendor/puppet/application/cert.rb +240 -0
  12. data/lib/vendor/puppet/application/certificate.rb +13 -0
  13. data/lib/vendor/puppet/application/certificate_request.rb +4 -0
  14. data/lib/vendor/puppet/application/certificate_revocation_list.rb +4 -0
  15. data/lib/vendor/puppet/application/config.rb +4 -0
  16. data/lib/vendor/puppet/application/describe.rb +256 -0
  17. data/lib/vendor/puppet/application/device.rb +242 -0
  18. data/lib/vendor/puppet/application/doc.rb +275 -0
  19. data/lib/vendor/puppet/application/face_base.rb +264 -0
  20. data/lib/vendor/puppet/application/facts.rb +4 -0
  21. data/lib/vendor/puppet/application/file.rb +4 -0
  22. data/lib/vendor/puppet/application/filebucket.rb +191 -0
  23. data/lib/vendor/puppet/application/help.rb +4 -0
  24. data/lib/vendor/puppet/application/indirection_base.rb +4 -0
  25. data/lib/vendor/puppet/application/inspect.rb +191 -0
  26. data/lib/vendor/puppet/application/instrumentation_data.rb +4 -0
  27. data/lib/vendor/puppet/application/instrumentation_listener.rb +4 -0
  28. data/lib/vendor/puppet/application/instrumentation_probe.rb +4 -0
  29. data/lib/vendor/puppet/application/key.rb +4 -0
  30. data/lib/vendor/puppet/application/kick.rb +351 -0
  31. data/lib/vendor/puppet/application/man.rb +4 -0
  32. data/lib/vendor/puppet/application/master.rb +263 -0
  33. data/lib/vendor/puppet/application/module.rb +11 -0
  34. data/lib/vendor/puppet/application/node.rb +4 -0
  35. data/lib/vendor/puppet/application/parser.rb +5 -0
  36. data/lib/vendor/puppet/application/plugin.rb +3 -0
  37. data/lib/vendor/puppet/application/queue.rb +161 -0
  38. data/lib/vendor/puppet/application/report.rb +4 -0
  39. data/lib/vendor/puppet/application/resource.rb +237 -0
  40. data/lib/vendor/puppet/application/resource_type.rb +4 -0
  41. data/lib/vendor/puppet/application/secret_agent.rb +6 -0
  42. data/lib/vendor/puppet/application/status.rb +4 -0
  43. data/lib/vendor/puppet/application.rb +421 -0
  44. data/lib/vendor/puppet/configurer/downloader.rb +86 -0
  45. data/lib/vendor/puppet/configurer/fact_handler.rb +56 -0
  46. data/lib/vendor/puppet/configurer/plugin_handler.rb +37 -0
  47. data/lib/vendor/puppet/configurer.rb +249 -0
  48. data/lib/vendor/puppet/daemon.rb +200 -0
  49. data/lib/vendor/puppet/defaults.rb +970 -0
  50. data/lib/vendor/puppet/dsl/resource_api.rb +120 -0
  51. data/lib/vendor/puppet/dsl/resource_type_api.rb +34 -0
  52. data/lib/vendor/puppet/dsl.rb +7 -0
  53. data/lib/vendor/puppet/error.rb +43 -0
  54. data/lib/vendor/puppet/external/base64.rb +19 -0
  55. data/lib/vendor/puppet/external/dot.rb +326 -0
  56. data/lib/vendor/puppet/external/lock.rb +63 -0
  57. data/lib/vendor/puppet/external/nagios/base.rb +472 -0
  58. data/lib/vendor/puppet/external/nagios/grammar.ry +185 -0
  59. data/lib/vendor/puppet/external/nagios/makefile +9 -0
  60. data/lib/vendor/puppet/external/nagios/parser.rb +775 -0
  61. data/lib/vendor/puppet/external/nagios.rb +48 -0
  62. data/lib/vendor/puppet/external/pson/common.rb +370 -0
  63. data/lib/vendor/puppet/external/pson/pure/generator.rb +401 -0
  64. data/lib/vendor/puppet/external/pson/pure/parser.rb +264 -0
  65. data/lib/vendor/puppet/external/pson/pure.rb +77 -0
  66. data/lib/vendor/puppet/external/pson/version.rb +8 -0
  67. data/lib/vendor/puppet/face/ca.rb +242 -0
  68. data/lib/vendor/puppet/face/catalog/select.rb +49 -0
  69. data/lib/vendor/puppet/face/catalog.rb +131 -0
  70. data/lib/vendor/puppet/face/certificate.rb +148 -0
  71. data/lib/vendor/puppet/face/certificate_request.rb +53 -0
  72. data/lib/vendor/puppet/face/certificate_revocation_list.rb +58 -0
  73. data/lib/vendor/puppet/face/config.rb +45 -0
  74. data/lib/vendor/puppet/face/facts.rb +81 -0
  75. data/lib/vendor/puppet/face/file/download.rb +54 -0
  76. data/lib/vendor/puppet/face/file/store.rb +21 -0
  77. data/lib/vendor/puppet/face/file.rb +47 -0
  78. data/lib/vendor/puppet/face/help/action.erb +53 -0
  79. data/lib/vendor/puppet/face/help/face.erb +79 -0
  80. data/lib/vendor/puppet/face/help/global.erb +19 -0
  81. data/lib/vendor/puppet/face/help/man.erb +136 -0
  82. data/lib/vendor/puppet/face/help.rb +131 -0
  83. data/lib/vendor/puppet/face/instrumentation_data.rb +28 -0
  84. data/lib/vendor/puppet/face/instrumentation_listener.rb +96 -0
  85. data/lib/vendor/puppet/face/instrumentation_probe.rb +77 -0
  86. data/lib/vendor/puppet/face/key.rb +15 -0
  87. data/lib/vendor/puppet/face/man.rb +93 -0
  88. data/lib/vendor/puppet/face/module/build.rb +37 -0
  89. data/lib/vendor/puppet/face/module/changes.rb +38 -0
  90. data/lib/vendor/puppet/face/module/generate.rb +42 -0
  91. data/lib/vendor/puppet/face/module/install.rb +174 -0
  92. data/lib/vendor/puppet/face/module/list.rb +285 -0
  93. data/lib/vendor/puppet/face/module/search.rb +88 -0
  94. data/lib/vendor/puppet/face/module/uninstall.rb +86 -0
  95. data/lib/vendor/puppet/face/module/upgrade.rb +84 -0
  96. data/lib/vendor/puppet/face/module.rb +17 -0
  97. data/lib/vendor/puppet/face/node/clean.rb +156 -0
  98. data/lib/vendor/puppet/face/node.rb +43 -0
  99. data/lib/vendor/puppet/face/parser.rb +51 -0
  100. data/lib/vendor/puppet/face/plugin.rb +55 -0
  101. data/lib/vendor/puppet/face/report.rb +56 -0
  102. data/lib/vendor/puppet/face/resource.rb +53 -0
  103. data/lib/vendor/puppet/face/resource_type.rb +81 -0
  104. data/lib/vendor/puppet/face/secret_agent.rb +54 -0
  105. data/lib/vendor/puppet/face/status.rb +53 -0
  106. data/lib/vendor/puppet/face.rb +12 -0
  107. data/lib/vendor/puppet/feature/base.rb +67 -0
  108. data/lib/vendor/puppet/feature/eventlog.rb +6 -0
  109. data/lib/vendor/puppet/feature/pson.rb +6 -0
  110. data/lib/vendor/puppet/feature/rack.rb +24 -0
  111. data/lib/vendor/puppet/feature/rails.rb +30 -0
  112. data/lib/vendor/puppet/feature/rubygems.rb +3 -0
  113. data/lib/vendor/puppet/feature/selinux.rb +3 -0
  114. data/lib/vendor/puppet/feature/ssh.rb +4 -0
  115. data/lib/vendor/puppet/feature/stomp.rb +6 -0
  116. data/lib/vendor/puppet/feature/zlib.rb +6 -0
  117. data/lib/vendor/puppet/file_bucket/dipper.rb +107 -0
  118. data/lib/vendor/puppet/file_bucket/file.rb +55 -0
  119. data/lib/vendor/puppet/file_bucket.rb +4 -0
  120. data/lib/vendor/puppet/file_collection/lookup.rb +10 -0
  121. data/lib/vendor/puppet/file_collection.rb +19 -0
  122. data/lib/vendor/puppet/file_serving/base.rb +88 -0
  123. data/lib/vendor/puppet/file_serving/configuration/parser.rb +115 -0
  124. data/lib/vendor/puppet/file_serving/configuration.rb +122 -0
  125. data/lib/vendor/puppet/file_serving/content.rb +45 -0
  126. data/lib/vendor/puppet/file_serving/fileset.rb +173 -0
  127. data/lib/vendor/puppet/file_serving/metadata.rb +155 -0
  128. data/lib/vendor/puppet/file_serving/mount/file.rb +121 -0
  129. data/lib/vendor/puppet/file_serving/mount/modules.rb +24 -0
  130. data/lib/vendor/puppet/file_serving/mount/plugins.rb +26 -0
  131. data/lib/vendor/puppet/file_serving/mount.rb +39 -0
  132. data/lib/vendor/puppet/file_serving/terminus_helper.rb +21 -0
  133. data/lib/vendor/puppet/file_serving/terminus_selector.rb +28 -0
  134. data/lib/vendor/puppet/file_serving.rb +3 -0
  135. data/lib/vendor/puppet/forge/cache.rb +55 -0
  136. data/lib/vendor/puppet/forge/repository.rb +102 -0
  137. data/lib/vendor/puppet/forge.rb +98 -0
  138. data/lib/vendor/puppet/indirector/active_record.rb +28 -0
  139. data/lib/vendor/puppet/indirector/catalog/active_record.rb +41 -0
  140. data/lib/vendor/puppet/indirector/catalog/compiler.rb +153 -0
  141. data/lib/vendor/puppet/indirector/catalog/queue.rb +5 -0
  142. data/lib/vendor/puppet/indirector/catalog/rest.rb +6 -0
  143. data/lib/vendor/puppet/indirector/catalog/static_compiler.rb +136 -0
  144. data/lib/vendor/puppet/indirector/catalog/store_configs.rb +5 -0
  145. data/lib/vendor/puppet/indirector/catalog/yaml.rb +22 -0
  146. data/lib/vendor/puppet/indirector/certificate/ca.rb +9 -0
  147. data/lib/vendor/puppet/indirector/certificate/disabled_ca.rb +22 -0
  148. data/lib/vendor/puppet/indirector/certificate/file.rb +9 -0
  149. data/lib/vendor/puppet/indirector/certificate/rest.rb +15 -0
  150. data/lib/vendor/puppet/indirector/certificate_request/ca.rb +22 -0
  151. data/lib/vendor/puppet/indirector/certificate_request/disabled_ca.rb +22 -0
  152. data/lib/vendor/puppet/indirector/certificate_request/file.rb +8 -0
  153. data/lib/vendor/puppet/indirector/certificate_request/rest.rb +9 -0
  154. data/lib/vendor/puppet/indirector/certificate_revocation_list/ca.rb +8 -0
  155. data/lib/vendor/puppet/indirector/certificate_revocation_list/disabled_ca.rb +22 -0
  156. data/lib/vendor/puppet/indirector/certificate_revocation_list/file.rb +8 -0
  157. data/lib/vendor/puppet/indirector/certificate_revocation_list/rest.rb +9 -0
  158. data/lib/vendor/puppet/indirector/certificate_status/file.rb +82 -0
  159. data/lib/vendor/puppet/indirector/certificate_status/rest.rb +10 -0
  160. data/lib/vendor/puppet/indirector/certificate_status.rb +4 -0
  161. data/lib/vendor/puppet/indirector/code.rb +6 -0
  162. data/lib/vendor/puppet/indirector/couch.rb +78 -0
  163. data/lib/vendor/puppet/indirector/direct_file_server.rb +19 -0
  164. data/lib/vendor/puppet/indirector/envelope.rb +11 -0
  165. data/lib/vendor/puppet/indirector/exec.rb +48 -0
  166. data/lib/vendor/puppet/indirector/face.rb +137 -0
  167. data/lib/vendor/puppet/indirector/facts/active_record.rb +36 -0
  168. data/lib/vendor/puppet/indirector/facts/couch.rb +31 -0
  169. data/lib/vendor/puppet/indirector/facts/facter.rb +96 -0
  170. data/lib/vendor/puppet/indirector/facts/inventory_active_record.rb +100 -0
  171. data/lib/vendor/puppet/indirector/facts/inventory_service.rb +20 -0
  172. data/lib/vendor/puppet/indirector/facts/memory.rb +9 -0
  173. data/lib/vendor/puppet/indirector/facts/network_device.rb +25 -0
  174. data/lib/vendor/puppet/indirector/facts/rest.rb +8 -0
  175. data/lib/vendor/puppet/indirector/facts/store_configs.rb +5 -0
  176. data/lib/vendor/puppet/indirector/facts/yaml.rb +82 -0
  177. data/lib/vendor/puppet/indirector/file_bucket_file/file.rb +136 -0
  178. data/lib/vendor/puppet/indirector/file_bucket_file/rest.rb +8 -0
  179. data/lib/vendor/puppet/indirector/file_bucket_file/selector.rb +49 -0
  180. data/lib/vendor/puppet/indirector/file_content/file.rb +7 -0
  181. data/lib/vendor/puppet/indirector/file_content/file_server.rb +7 -0
  182. data/lib/vendor/puppet/indirector/file_content/rest.rb +7 -0
  183. data/lib/vendor/puppet/indirector/file_content/selector.rb +30 -0
  184. data/lib/vendor/puppet/indirector/file_content.rb +5 -0
  185. data/lib/vendor/puppet/indirector/file_metadata/file.rb +22 -0
  186. data/lib/vendor/puppet/indirector/file_metadata/file_server.rb +7 -0
  187. data/lib/vendor/puppet/indirector/file_metadata/rest.rb +7 -0
  188. data/lib/vendor/puppet/indirector/file_metadata/selector.rb +30 -0
  189. data/lib/vendor/puppet/indirector/file_metadata.rb +5 -0
  190. data/lib/vendor/puppet/indirector/file_server.rb +65 -0
  191. data/lib/vendor/puppet/indirector/indirection.rb +323 -0
  192. data/lib/vendor/puppet/indirector/instrumentation_data/local.rb +19 -0
  193. data/lib/vendor/puppet/indirector/instrumentation_data/rest.rb +5 -0
  194. data/lib/vendor/puppet/indirector/instrumentation_data.rb +3 -0
  195. data/lib/vendor/puppet/indirector/instrumentation_listener/local.rb +23 -0
  196. data/lib/vendor/puppet/indirector/instrumentation_listener/rest.rb +5 -0
  197. data/lib/vendor/puppet/indirector/instrumentation_listener.rb +3 -0
  198. data/lib/vendor/puppet/indirector/instrumentation_probe/local.rb +24 -0
  199. data/lib/vendor/puppet/indirector/instrumentation_probe/rest.rb +5 -0
  200. data/lib/vendor/puppet/indirector/instrumentation_probe.rb +3 -0
  201. data/lib/vendor/puppet/indirector/inventory/yaml.rb +81 -0
  202. data/lib/vendor/puppet/indirector/key/ca.rb +12 -0
  203. data/lib/vendor/puppet/indirector/key/disabled_ca.rb +22 -0
  204. data/lib/vendor/puppet/indirector/key/file.rb +42 -0
  205. data/lib/vendor/puppet/indirector/ldap.rb +78 -0
  206. data/lib/vendor/puppet/indirector/memory.rb +21 -0
  207. data/lib/vendor/puppet/indirector/node/active_record.rb +13 -0
  208. data/lib/vendor/puppet/indirector/node/exec.rb +60 -0
  209. data/lib/vendor/puppet/indirector/node/ldap.rb +256 -0
  210. data/lib/vendor/puppet/indirector/node/memory.rb +10 -0
  211. data/lib/vendor/puppet/indirector/node/plain.rb +19 -0
  212. data/lib/vendor/puppet/indirector/node/rest.rb +7 -0
  213. data/lib/vendor/puppet/indirector/node/store_configs.rb +5 -0
  214. data/lib/vendor/puppet/indirector/node/yaml.rb +7 -0
  215. data/lib/vendor/puppet/indirector/plain.rb +9 -0
  216. data/lib/vendor/puppet/indirector/queue.rb +81 -0
  217. data/lib/vendor/puppet/indirector/report/processor.rb +61 -0
  218. data/lib/vendor/puppet/indirector/report/rest.rb +7 -0
  219. data/lib/vendor/puppet/indirector/report/yaml.rb +11 -0
  220. data/lib/vendor/puppet/indirector/request.rb +204 -0
  221. data/lib/vendor/puppet/indirector/resource/active_record.rb +93 -0
  222. data/lib/vendor/puppet/indirector/resource/ral.rb +53 -0
  223. data/lib/vendor/puppet/indirector/resource/rest.rb +5 -0
  224. data/lib/vendor/puppet/indirector/resource/store_configs.rb +3 -0
  225. data/lib/vendor/puppet/indirector/resource_type/parser.rb +43 -0
  226. data/lib/vendor/puppet/indirector/resource_type/rest.rb +7 -0
  227. data/lib/vendor/puppet/indirector/resource_type.rb +5 -0
  228. data/lib/vendor/puppet/indirector/rest.rb +166 -0
  229. data/lib/vendor/puppet/indirector/run/local.rb +8 -0
  230. data/lib/vendor/puppet/indirector/run/rest.rb +6 -0
  231. data/lib/vendor/puppet/indirector/ssl_file.rb +178 -0
  232. data/lib/vendor/puppet/indirector/status/local.rb +7 -0
  233. data/lib/vendor/puppet/indirector/status/rest.rb +5 -0
  234. data/lib/vendor/puppet/indirector/status.rb +3 -0
  235. data/lib/vendor/puppet/indirector/store_configs.rb +30 -0
  236. data/lib/vendor/puppet/indirector/terminus.rb +145 -0
  237. data/lib/vendor/puppet/indirector/yaml.rb +75 -0
  238. data/lib/vendor/puppet/indirector.rb +57 -0
  239. data/lib/vendor/puppet/interface/action.rb +322 -0
  240. data/lib/vendor/puppet/interface/action_builder.rb +74 -0
  241. data/lib/vendor/puppet/interface/action_manager.rb +74 -0
  242. data/lib/vendor/puppet/interface/documentation.rb +230 -0
  243. data/lib/vendor/puppet/interface/face_collection.rb +128 -0
  244. data/lib/vendor/puppet/interface/option.rb +127 -0
  245. data/lib/vendor/puppet/interface/option_builder.rb +67 -0
  246. data/lib/vendor/puppet/interface/option_manager.rb +68 -0
  247. data/lib/vendor/puppet/interface.rb +161 -0
  248. data/lib/vendor/puppet/metatype/manager.rb +141 -0
  249. data/lib/vendor/puppet/module.rb +314 -0
  250. data/lib/vendor/puppet/module_tool/applications/application.rb +82 -0
  251. data/lib/vendor/puppet/module_tool/applications/builder.rb +91 -0
  252. data/lib/vendor/puppet/module_tool/applications/checksummer.rb +56 -0
  253. data/lib/vendor/puppet/module_tool/applications/generator.rb +141 -0
  254. data/lib/vendor/puppet/module_tool/applications/installer.rb +183 -0
  255. data/lib/vendor/puppet/module_tool/applications/searcher.rb +15 -0
  256. data/lib/vendor/puppet/module_tool/applications/uninstaller.rb +107 -0
  257. data/lib/vendor/puppet/module_tool/applications/unpacker.rb +67 -0
  258. data/lib/vendor/puppet/module_tool/applications/upgrader.rb +109 -0
  259. data/lib/vendor/puppet/module_tool/applications.rb +15 -0
  260. data/lib/vendor/puppet/module_tool/checksums.rb +52 -0
  261. data/lib/vendor/puppet/module_tool/contents_description.rb +82 -0
  262. data/lib/vendor/puppet/module_tool/dependency.rb +24 -0
  263. data/lib/vendor/puppet/module_tool/errors/base.rb +15 -0
  264. data/lib/vendor/puppet/module_tool/errors/installer.rb +90 -0
  265. data/lib/vendor/puppet/module_tool/errors/shared.rb +115 -0
  266. data/lib/vendor/puppet/module_tool/errors/uninstaller.rb +45 -0
  267. data/lib/vendor/puppet/module_tool/errors/upgrader.rb +72 -0
  268. data/lib/vendor/puppet/module_tool/errors.rb +9 -0
  269. data/lib/vendor/puppet/module_tool/metadata.rb +141 -0
  270. data/lib/vendor/puppet/module_tool/modulefile.rb +75 -0
  271. data/lib/vendor/puppet/module_tool/shared_behaviors.rb +161 -0
  272. data/lib/vendor/puppet/module_tool/skeleton/templates/generator/Modulefile.erb +11 -0
  273. data/lib/vendor/puppet/module_tool/skeleton/templates/generator/README.erb +16 -0
  274. data/lib/vendor/puppet/module_tool/skeleton/templates/generator/manifests/init.pp.erb +41 -0
  275. data/lib/vendor/puppet/module_tool/skeleton/templates/generator/spec/spec_helper.rb +17 -0
  276. data/lib/vendor/puppet/module_tool/skeleton/templates/generator/tests/init.pp.erb +11 -0
  277. data/lib/vendor/puppet/module_tool/skeleton.rb +34 -0
  278. data/lib/vendor/puppet/module_tool.rb +99 -0
  279. data/lib/vendor/puppet/network/authconfig.rb +174 -0
  280. data/lib/vendor/puppet/network/authorization.rb +76 -0
  281. data/lib/vendor/puppet/network/authstore.rb +267 -0
  282. data/lib/vendor/puppet/network/client_request.rb +29 -0
  283. data/lib/vendor/puppet/network/format.rb +111 -0
  284. data/lib/vendor/puppet/network/format_handler.rb +181 -0
  285. data/lib/vendor/puppet/network/formats.rb +171 -0
  286. data/lib/vendor/puppet/network/handler/ca.rb +61 -0
  287. data/lib/vendor/puppet/network/handler/filebucket.rb +53 -0
  288. data/lib/vendor/puppet/network/handler/fileserver.rb +732 -0
  289. data/lib/vendor/puppet/network/handler/master.rb +87 -0
  290. data/lib/vendor/puppet/network/handler/report.rb +82 -0
  291. data/lib/vendor/puppet/network/handler/runner.rb +33 -0
  292. data/lib/vendor/puppet/network/handler/status.rb +18 -0
  293. data/lib/vendor/puppet/network/handler.rb +50 -0
  294. data/lib/vendor/puppet/network/http/api/v1.rb +83 -0
  295. data/lib/vendor/puppet/network/http/api.rb +4 -0
  296. data/lib/vendor/puppet/network/http/compression.rb +114 -0
  297. data/lib/vendor/puppet/network/http/handler.rb +247 -0
  298. data/lib/vendor/puppet/network/http/mongrel/rest.rb +99 -0
  299. data/lib/vendor/puppet/network/http/mongrel.rb +55 -0
  300. data/lib/vendor/puppet/network/http/rack/httphandler.rb +16 -0
  301. data/lib/vendor/puppet/network/http/rack/rest.rb +100 -0
  302. data/lib/vendor/puppet/network/http/rack/xmlrpc.rb +65 -0
  303. data/lib/vendor/puppet/network/http/rack.rb +65 -0
  304. data/lib/vendor/puppet/network/http/webrick/rest.rb +81 -0
  305. data/lib/vendor/puppet/network/http/webrick.rb +141 -0
  306. data/lib/vendor/puppet/network/http.rb +15 -0
  307. data/lib/vendor/puppet/network/http_pool.rb +57 -0
  308. data/lib/vendor/puppet/network/http_server/mongrel.rb +129 -0
  309. data/lib/vendor/puppet/network/http_server.rb +3 -0
  310. data/lib/vendor/puppet/network/rest_authconfig.rb +102 -0
  311. data/lib/vendor/puppet/network/rest_authorization.rb +23 -0
  312. data/lib/vendor/puppet/network/rest_controller.rb +2 -0
  313. data/lib/vendor/puppet/network/rights.rb +275 -0
  314. data/lib/vendor/puppet/network/server.rb +164 -0
  315. data/lib/vendor/puppet/network/xmlrpc/processor.rb +86 -0
  316. data/lib/vendor/puppet/network/xmlrpc/server.rb +19 -0
  317. data/lib/vendor/puppet/network/xmlrpc/webrick_servlet.rb +114 -0
  318. data/lib/vendor/puppet/network.rb +3 -0
  319. data/lib/vendor/puppet/node/environment.rb +216 -0
  320. data/lib/vendor/puppet/node/facts.rb +99 -0
  321. data/lib/vendor/puppet/node/inventory.rb +7 -0
  322. data/lib/vendor/puppet/node.rb +120 -0
  323. data/lib/vendor/puppet/parameter/path.rb +34 -0
  324. data/lib/vendor/puppet/parameter/value.rb +69 -0
  325. data/lib/vendor/puppet/parameter/value_collection.rb +143 -0
  326. data/lib/vendor/puppet/parameter.rb +316 -0
  327. data/lib/vendor/puppet/parser/ast/arithmetic_operator.rb +39 -0
  328. data/lib/vendor/puppet/parser/ast/astarray.rb +50 -0
  329. data/lib/vendor/puppet/parser/ast/asthash.rb +37 -0
  330. data/lib/vendor/puppet/parser/ast/boolean_operator.rb +46 -0
  331. data/lib/vendor/puppet/parser/ast/branch.rb +37 -0
  332. data/lib/vendor/puppet/parser/ast/caseopt.rb +52 -0
  333. data/lib/vendor/puppet/parser/ast/casestatement.rb +44 -0
  334. data/lib/vendor/puppet/parser/ast/collection.rb +49 -0
  335. data/lib/vendor/puppet/parser/ast/collexpr.rb +57 -0
  336. data/lib/vendor/puppet/parser/ast/comparison_operator.rb +38 -0
  337. data/lib/vendor/puppet/parser/ast/definition.rb +17 -0
  338. data/lib/vendor/puppet/parser/ast/else.rb +22 -0
  339. data/lib/vendor/puppet/parser/ast/function.rb +50 -0
  340. data/lib/vendor/puppet/parser/ast/hostclass.rb +29 -0
  341. data/lib/vendor/puppet/parser/ast/ifstatement.rb +34 -0
  342. data/lib/vendor/puppet/parser/ast/in_operator.rb +24 -0
  343. data/lib/vendor/puppet/parser/ast/leaf.rb +221 -0
  344. data/lib/vendor/puppet/parser/ast/match_operator.rb +28 -0
  345. data/lib/vendor/puppet/parser/ast/minus.rb +23 -0
  346. data/lib/vendor/puppet/parser/ast/node.rb +20 -0
  347. data/lib/vendor/puppet/parser/ast/nop.rb +11 -0
  348. data/lib/vendor/puppet/parser/ast/not.rb +19 -0
  349. data/lib/vendor/puppet/parser/ast/relationship.rb +47 -0
  350. data/lib/vendor/puppet/parser/ast/resource.rb +74 -0
  351. data/lib/vendor/puppet/parser/ast/resource_defaults.rb +24 -0
  352. data/lib/vendor/puppet/parser/ast/resource_instance.rb +9 -0
  353. data/lib/vendor/puppet/parser/ast/resource_override.rb +67 -0
  354. data/lib/vendor/puppet/parser/ast/resource_reference.rb +28 -0
  355. data/lib/vendor/puppet/parser/ast/resourceparam.rb +29 -0
  356. data/lib/vendor/puppet/parser/ast/selector.rb +44 -0
  357. data/lib/vendor/puppet/parser/ast/tag.rb +24 -0
  358. data/lib/vendor/puppet/parser/ast/top_level_construct.rb +4 -0
  359. data/lib/vendor/puppet/parser/ast/vardef.rb +33 -0
  360. data/lib/vendor/puppet/parser/ast.rb +139 -0
  361. data/lib/vendor/puppet/parser/collector.rb +176 -0
  362. data/lib/vendor/puppet/parser/compiler.rb +476 -0
  363. data/lib/vendor/puppet/parser/files.rb +88 -0
  364. data/lib/vendor/puppet/parser/functions/create_resources.rb +75 -0
  365. data/lib/vendor/puppet/parser/functions/defined.rb +49 -0
  366. data/lib/vendor/puppet/parser/functions/extlookup.rb +152 -0
  367. data/lib/vendor/puppet/parser/functions/fail.rb +4 -0
  368. data/lib/vendor/puppet/parser/functions/file.rb +23 -0
  369. data/lib/vendor/puppet/parser/functions/fqdn_rand.rb +13 -0
  370. data/lib/vendor/puppet/parser/functions/generate.rb +37 -0
  371. data/lib/vendor/puppet/parser/functions/include.rb +24 -0
  372. data/lib/vendor/puppet/parser/functions/inline_template.rb +21 -0
  373. data/lib/vendor/puppet/parser/functions/md5.rb +5 -0
  374. data/lib/vendor/puppet/parser/functions/realize.rb +14 -0
  375. data/lib/vendor/puppet/parser/functions/regsubst.rb +119 -0
  376. data/lib/vendor/puppet/parser/functions/require.rb +57 -0
  377. data/lib/vendor/puppet/parser/functions/search.rb +7 -0
  378. data/lib/vendor/puppet/parser/functions/sha1.rb +5 -0
  379. data/lib/vendor/puppet/parser/functions/shellquote.rb +61 -0
  380. data/lib/vendor/puppet/parser/functions/split.rb +29 -0
  381. data/lib/vendor/puppet/parser/functions/sprintf.rb +39 -0
  382. data/lib/vendor/puppet/parser/functions/tag.rb +6 -0
  383. data/lib/vendor/puppet/parser/functions/tagged.rb +18 -0
  384. data/lib/vendor/puppet/parser/functions/template.rb +23 -0
  385. data/lib/vendor/puppet/parser/functions/versioncmp.rb +37 -0
  386. data/lib/vendor/puppet/parser/functions.rb +165 -0
  387. data/lib/vendor/puppet/parser/grammar.ra +771 -0
  388. data/lib/vendor/puppet/parser/lexer.rb +617 -0
  389. data/lib/vendor/puppet/parser/makefile +8 -0
  390. data/lib/vendor/puppet/parser/parser.rb +2421 -0
  391. data/lib/vendor/puppet/parser/parser_support.rb +211 -0
  392. data/lib/vendor/puppet/parser/relationship.rb +62 -0
  393. data/lib/vendor/puppet/parser/resource/param.rb +25 -0
  394. data/lib/vendor/puppet/parser/resource.rb +341 -0
  395. data/lib/vendor/puppet/parser/scope.rb +497 -0
  396. data/lib/vendor/puppet/parser/templatewrapper.rb +115 -0
  397. data/lib/vendor/puppet/parser/type_loader.rb +172 -0
  398. data/lib/vendor/puppet/parser/yaml_trimmer.rb +9 -0
  399. data/lib/vendor/puppet/parser.rb +4 -0
  400. data/lib/vendor/puppet/property/ensure.rb +92 -0
  401. data/lib/vendor/puppet/property/keyvalue.rb +86 -0
  402. data/lib/vendor/puppet/property/list.rb +75 -0
  403. data/lib/vendor/puppet/property/ordered_list.rb +22 -0
  404. data/lib/vendor/puppet/property.rb +373 -0
  405. data/lib/vendor/puppet/provider/aixobject.rb +393 -0
  406. data/lib/vendor/puppet/provider/augeas/augeas.rb +418 -0
  407. data/lib/vendor/puppet/provider/cisco.rb +9 -0
  408. data/lib/vendor/puppet/provider/computer/computer.rb +20 -0
  409. data/lib/vendor/puppet/provider/confine/exists.rb +19 -0
  410. data/lib/vendor/puppet/provider/confine/false.rb +19 -0
  411. data/lib/vendor/puppet/provider/confine/feature.rb +17 -0
  412. data/lib/vendor/puppet/provider/confine/true.rb +20 -0
  413. data/lib/vendor/puppet/provider/confine/variable.rb +59 -0
  414. data/lib/vendor/puppet/provider/confine.rb +80 -0
  415. data/lib/vendor/puppet/provider/confine_collection.rb +50 -0
  416. data/lib/vendor/puppet/provider/confiner.rb +16 -0
  417. data/lib/vendor/puppet/provider/cron/crontab.rb +200 -0
  418. data/lib/vendor/puppet/provider/exec/posix.rb +39 -0
  419. data/lib/vendor/puppet/provider/exec/shell.rb +25 -0
  420. data/lib/vendor/puppet/provider/exec/windows.rb +56 -0
  421. data/lib/vendor/puppet/provider/exec.rb +84 -0
  422. data/lib/vendor/puppet/provider/file/posix.rb +135 -0
  423. data/lib/vendor/puppet/provider/file/windows.rb +88 -0
  424. data/lib/vendor/puppet/provider/group/aix.rb +141 -0
  425. data/lib/vendor/puppet/provider/group/directoryservice.rb +12 -0
  426. data/lib/vendor/puppet/provider/group/groupadd.rb +29 -0
  427. data/lib/vendor/puppet/provider/group/ldap.rb +45 -0
  428. data/lib/vendor/puppet/provider/group/pw.rb +48 -0
  429. data/lib/vendor/puppet/provider/group/windows_adsi.rb +54 -0
  430. data/lib/vendor/puppet/provider/host/parsed.rb +44 -0
  431. data/lib/vendor/puppet/provider/interface/base.rb +0 -0
  432. data/lib/vendor/puppet/provider/interface/cisco.rb +27 -0
  433. data/lib/vendor/puppet/provider/ldap.rb +137 -0
  434. data/lib/vendor/puppet/provider/macauthorization/macauthorization.rb +313 -0
  435. data/lib/vendor/puppet/provider/mailalias/aliases.rb +44 -0
  436. data/lib/vendor/puppet/provider/maillist/mailman.rb +108 -0
  437. data/lib/vendor/puppet/provider/mcx/mcxcontent.rb +166 -0
  438. data/lib/vendor/puppet/provider/mount/parsed.rb +124 -0
  439. data/lib/vendor/puppet/provider/mount.rb +46 -0
  440. data/lib/vendor/puppet/provider/naginator.rb +63 -0
  441. data/lib/vendor/puppet/provider/nameservice/directoryservice.rb +652 -0
  442. data/lib/vendor/puppet/provider/nameservice/objectadd.rb +33 -0
  443. data/lib/vendor/puppet/provider/nameservice/pw.rb +21 -0
  444. data/lib/vendor/puppet/provider/nameservice.rb +276 -0
  445. data/lib/vendor/puppet/provider/network_device.rb +68 -0
  446. data/lib/vendor/puppet/provider/package/aix.rb +128 -0
  447. data/lib/vendor/puppet/provider/package/appdmg.rb +109 -0
  448. data/lib/vendor/puppet/provider/package/apple.rb +47 -0
  449. data/lib/vendor/puppet/provider/package/apt.rb +111 -0
  450. data/lib/vendor/puppet/provider/package/aptitude.rb +29 -0
  451. data/lib/vendor/puppet/provider/package/aptrpm.rb +83 -0
  452. data/lib/vendor/puppet/provider/package/blastwave.rb +111 -0
  453. data/lib/vendor/puppet/provider/package/dpkg.rb +155 -0
  454. data/lib/vendor/puppet/provider/package/fink.rb +81 -0
  455. data/lib/vendor/puppet/provider/package/freebsd.rb +49 -0
  456. data/lib/vendor/puppet/provider/package/gem.rb +127 -0
  457. data/lib/vendor/puppet/provider/package/hpux.rb +44 -0
  458. data/lib/vendor/puppet/provider/package/macports.rb +105 -0
  459. data/lib/vendor/puppet/provider/package/msi.rb +141 -0
  460. data/lib/vendor/puppet/provider/package/nim.rb +35 -0
  461. data/lib/vendor/puppet/provider/package/openbsd.rb +112 -0
  462. data/lib/vendor/puppet/provider/package/pacman.rb +94 -0
  463. data/lib/vendor/puppet/provider/package/pip.rb +111 -0
  464. data/lib/vendor/puppet/provider/package/pkg.rb +112 -0
  465. data/lib/vendor/puppet/provider/package/pkgdmg.rb +123 -0
  466. data/lib/vendor/puppet/provider/package/pkgutil.rb +174 -0
  467. data/lib/vendor/puppet/provider/package/portage.rb +124 -0
  468. data/lib/vendor/puppet/provider/package/ports.rb +94 -0
  469. data/lib/vendor/puppet/provider/package/portupgrade.rb +241 -0
  470. data/lib/vendor/puppet/provider/package/rpm.rb +132 -0
  471. data/lib/vendor/puppet/provider/package/rug.rb +52 -0
  472. data/lib/vendor/puppet/provider/package/sun.rb +154 -0
  473. data/lib/vendor/puppet/provider/package/sunfreeware.rb +9 -0
  474. data/lib/vendor/puppet/provider/package/up2date.rb +41 -0
  475. data/lib/vendor/puppet/provider/package/urpmi.rb +59 -0
  476. data/lib/vendor/puppet/provider/package/yum.rb +106 -0
  477. data/lib/vendor/puppet/provider/package/yumhelper.py +129 -0
  478. data/lib/vendor/puppet/provider/package/zypper.rb +84 -0
  479. data/lib/vendor/puppet/provider/package.rb +28 -0
  480. data/lib/vendor/puppet/provider/parsedfile.rb +374 -0
  481. data/lib/vendor/puppet/provider/port/parsed.rb +173 -0
  482. data/lib/vendor/puppet/provider/scheduled_task/win32_taskscheduler.rb +565 -0
  483. data/lib/vendor/puppet/provider/selboolean/getsetsebool.rb +47 -0
  484. data/lib/vendor/puppet/provider/selmodule/semodule.rb +134 -0
  485. data/lib/vendor/puppet/provider/service/base.rb +105 -0
  486. data/lib/vendor/puppet/provider/service/bsd.rb +49 -0
  487. data/lib/vendor/puppet/provider/service/daemontools.rb +194 -0
  488. data/lib/vendor/puppet/provider/service/debian.rb +68 -0
  489. data/lib/vendor/puppet/provider/service/freebsd.rb +139 -0
  490. data/lib/vendor/puppet/provider/service/gentoo.rb +54 -0
  491. data/lib/vendor/puppet/provider/service/init.rb +140 -0
  492. data/lib/vendor/puppet/provider/service/launchd.rb +303 -0
  493. data/lib/vendor/puppet/provider/service/openrc.rb +69 -0
  494. data/lib/vendor/puppet/provider/service/redhat.rb +76 -0
  495. data/lib/vendor/puppet/provider/service/runit.rb +103 -0
  496. data/lib/vendor/puppet/provider/service/service.rb +43 -0
  497. data/lib/vendor/puppet/provider/service/smf.rb +104 -0
  498. data/lib/vendor/puppet/provider/service/src.rb +86 -0
  499. data/lib/vendor/puppet/provider/service/systemd.rb +64 -0
  500. data/lib/vendor/puppet/provider/service/upstart.rb +347 -0
  501. data/lib/vendor/puppet/provider/service/windows.rb +106 -0
  502. data/lib/vendor/puppet/provider/ssh_authorized_key/parsed.rb +88 -0
  503. data/lib/vendor/puppet/provider/sshkey/parsed.rb +37 -0
  504. data/lib/vendor/puppet/provider/user/aix.rb +357 -0
  505. data/lib/vendor/puppet/provider/user/directoryservice.rb +86 -0
  506. data/lib/vendor/puppet/provider/user/hpux.rb +31 -0
  507. data/lib/vendor/puppet/provider/user/ldap.rb +129 -0
  508. data/lib/vendor/puppet/provider/user/pw.rb +101 -0
  509. data/lib/vendor/puppet/provider/user/user_role_add.rb +207 -0
  510. data/lib/vendor/puppet/provider/user/useradd.rb +127 -0
  511. data/lib/vendor/puppet/provider/user/windows_adsi.rb +99 -0
  512. data/lib/vendor/puppet/provider/vlan/cisco.rb +28 -0
  513. data/lib/vendor/puppet/provider/zfs/solaris.rb +45 -0
  514. data/lib/vendor/puppet/provider/zone/solaris.rb +260 -0
  515. data/lib/vendor/puppet/provider/zpool/solaris.rb +116 -0
  516. data/lib/vendor/puppet/provider.rb +290 -0
  517. data/lib/vendor/puppet/rails/benchmark.rb +63 -0
  518. data/lib/vendor/puppet/rails/database/001_add_created_at_to_all_tables.rb +13 -0
  519. data/lib/vendor/puppet/rails/database/002_remove_duplicated_index_on_all_tables.rb +13 -0
  520. data/lib/vendor/puppet/rails/database/003_add_environment_to_host.rb +9 -0
  521. data/lib/vendor/puppet/rails/database/004_add_inventory_service_tables.rb +36 -0
  522. data/lib/vendor/puppet/rails/database/schema.rb +131 -0
  523. data/lib/vendor/puppet/rails/fact_name.rb +6 -0
  524. data/lib/vendor/puppet/rails/fact_value.rb +8 -0
  525. data/lib/vendor/puppet/rails/host.rb +258 -0
  526. data/lib/vendor/puppet/rails/inventory_fact.rb +5 -0
  527. data/lib/vendor/puppet/rails/inventory_node.rb +43 -0
  528. data/lib/vendor/puppet/rails/param_name.rb +25 -0
  529. data/lib/vendor/puppet/rails/param_value.rb +74 -0
  530. data/lib/vendor/puppet/rails/puppet_tag.rb +10 -0
  531. data/lib/vendor/puppet/rails/resource.rb +231 -0
  532. data/lib/vendor/puppet/rails/resource_tag.rb +26 -0
  533. data/lib/vendor/puppet/rails/source_file.rb +8 -0
  534. data/lib/vendor/puppet/rails.rb +132 -0
  535. data/lib/vendor/puppet/rb_tree_map.rb +388 -0
  536. data/lib/vendor/puppet/reference/configuration.rb +69 -0
  537. data/lib/vendor/puppet/reference/function.rb +17 -0
  538. data/lib/vendor/puppet/reference/indirection.rb +32 -0
  539. data/lib/vendor/puppet/reference/metaparameter.rb +43 -0
  540. data/lib/vendor/puppet/reference/network.rb +39 -0
  541. data/lib/vendor/puppet/reference/providers.rb +119 -0
  542. data/lib/vendor/puppet/reference/report.rb +23 -0
  543. data/lib/vendor/puppet/reference/type.rb +116 -0
  544. data/lib/vendor/puppet/relationship.rb +95 -0
  545. data/lib/vendor/puppet/reports/http.rb +25 -0
  546. data/lib/vendor/puppet/reports/log.rb +14 -0
  547. data/lib/vendor/puppet/reports/rrdgraph.rb +128 -0
  548. data/lib/vendor/puppet/reports/store.rb +74 -0
  549. data/lib/vendor/puppet/reports/tagmail.rb +179 -0
  550. data/lib/vendor/puppet/reports.rb +49 -0
  551. data/lib/vendor/puppet/resource/catalog.rb +661 -0
  552. data/lib/vendor/puppet/resource/status.rb +79 -0
  553. data/lib/vendor/puppet/resource/type.rb +344 -0
  554. data/lib/vendor/puppet/resource/type_collection.rb +215 -0
  555. data/lib/vendor/puppet/resource/type_collection_helper.rb +7 -0
  556. data/lib/vendor/puppet/resource.rb +467 -0
  557. data/lib/vendor/puppet/run.rb +77 -0
  558. data/lib/vendor/puppet/simple_graph.rb +550 -0
  559. data/lib/vendor/puppet/ssl/base.rb +86 -0
  560. data/lib/vendor/puppet/ssl/certificate.rb +40 -0
  561. data/lib/vendor/puppet/ssl/certificate_authority/interface.rb +182 -0
  562. data/lib/vendor/puppet/ssl/certificate_authority.rb +374 -0
  563. data/lib/vendor/puppet/ssl/certificate_factory.rb +166 -0
  564. data/lib/vendor/puppet/ssl/certificate_request.rb +149 -0
  565. data/lib/vendor/puppet/ssl/certificate_revocation_list.rb +84 -0
  566. data/lib/vendor/puppet/ssl/host.rb +365 -0
  567. data/lib/vendor/puppet/ssl/inventory.rb +54 -0
  568. data/lib/vendor/puppet/ssl/key.rb +56 -0
  569. data/lib/vendor/puppet/ssl.rb +8 -0
  570. data/lib/vendor/puppet/status.rb +28 -0
  571. data/lib/vendor/puppet/test/test_helper.rb +141 -0
  572. data/lib/vendor/puppet/transaction/event.rb +66 -0
  573. data/lib/vendor/puppet/transaction/event_manager.rb +115 -0
  574. data/lib/vendor/puppet/transaction/report.rb +200 -0
  575. data/lib/vendor/puppet/transaction/resource_harness.rb +178 -0
  576. data/lib/vendor/puppet/transaction.rb +493 -0
  577. data/lib/vendor/puppet/transportable.rb +248 -0
  578. data/lib/vendor/puppet/type/augeas.rb +218 -0
  579. data/lib/vendor/puppet/type/component.rb +85 -0
  580. data/lib/vendor/puppet/type/computer.rb +66 -0
  581. data/lib/vendor/puppet/type/cron.rb +421 -0
  582. data/lib/vendor/puppet/type/exec.rb +520 -0
  583. data/lib/vendor/puppet/type/file/checksum.rb +33 -0
  584. data/lib/vendor/puppet/type/file/content.rb +230 -0
  585. data/lib/vendor/puppet/type/file/ctime.rb +18 -0
  586. data/lib/vendor/puppet/type/file/ensure.rb +172 -0
  587. data/lib/vendor/puppet/type/file/group.rb +41 -0
  588. data/lib/vendor/puppet/type/file/mode.rb +148 -0
  589. data/lib/vendor/puppet/type/file/mtime.rb +17 -0
  590. data/lib/vendor/puppet/type/file/owner.rb +44 -0
  591. data/lib/vendor/puppet/type/file/selcontext.rb +123 -0
  592. data/lib/vendor/puppet/type/file/source.rb +195 -0
  593. data/lib/vendor/puppet/type/file/target.rb +87 -0
  594. data/lib/vendor/puppet/type/file/type.rb +19 -0
  595. data/lib/vendor/puppet/type/file.rb +829 -0
  596. data/lib/vendor/puppet/type/filebucket.rb +114 -0
  597. data/lib/vendor/puppet/type/group.rb +149 -0
  598. data/lib/vendor/puppet/type/host.rb +87 -0
  599. data/lib/vendor/puppet/type/interface.rb +112 -0
  600. data/lib/vendor/puppet/type/k5login.rb +88 -0
  601. data/lib/vendor/puppet/type/macauthorization.rb +167 -0
  602. data/lib/vendor/puppet/type/mailalias.rb +48 -0
  603. data/lib/vendor/puppet/type/maillist.rb +62 -0
  604. data/lib/vendor/puppet/type/mcx.rb +99 -0
  605. data/lib/vendor/puppet/type/mount.rb +241 -0
  606. data/lib/vendor/puppet/type/nagios_command.rb +3 -0
  607. data/lib/vendor/puppet/type/nagios_contact.rb +3 -0
  608. data/lib/vendor/puppet/type/nagios_contactgroup.rb +3 -0
  609. data/lib/vendor/puppet/type/nagios_host.rb +3 -0
  610. data/lib/vendor/puppet/type/nagios_hostdependency.rb +3 -0
  611. data/lib/vendor/puppet/type/nagios_hostescalation.rb +3 -0
  612. data/lib/vendor/puppet/type/nagios_hostextinfo.rb +3 -0
  613. data/lib/vendor/puppet/type/nagios_hostgroup.rb +3 -0
  614. data/lib/vendor/puppet/type/nagios_service.rb +3 -0
  615. data/lib/vendor/puppet/type/nagios_servicedependency.rb +3 -0
  616. data/lib/vendor/puppet/type/nagios_serviceescalation.rb +3 -0
  617. data/lib/vendor/puppet/type/nagios_serviceextinfo.rb +3 -0
  618. data/lib/vendor/puppet/type/nagios_servicegroup.rb +3 -0
  619. data/lib/vendor/puppet/type/nagios_timeperiod.rb +3 -0
  620. data/lib/vendor/puppet/type/notify.rb +44 -0
  621. data/lib/vendor/puppet/type/package.rb +357 -0
  622. data/lib/vendor/puppet/type/port.rb +119 -0
  623. data/lib/vendor/puppet/type/resources.rb +131 -0
  624. data/lib/vendor/puppet/type/router.rb +17 -0
  625. data/lib/vendor/puppet/type/schedule.rb +360 -0
  626. data/lib/vendor/puppet/type/scheduled_task.rb +166 -0
  627. data/lib/vendor/puppet/type/selboolean.rb +26 -0
  628. data/lib/vendor/puppet/type/selmodule.rb +59 -0
  629. data/lib/vendor/puppet/type/service.rb +221 -0
  630. data/lib/vendor/puppet/type/ssh_authorized_key.rb +112 -0
  631. data/lib/vendor/puppet/type/sshkey.rb +72 -0
  632. data/lib/vendor/puppet/type/stage.rb +19 -0
  633. data/lib/vendor/puppet/type/tidy.rb +333 -0
  634. data/lib/vendor/puppet/type/user.rb +524 -0
  635. data/lib/vendor/puppet/type/vlan.rb +26 -0
  636. data/lib/vendor/puppet/type/whit.rb +34 -0
  637. data/lib/vendor/puppet/type/yumrepo.rb +361 -0
  638. data/lib/vendor/puppet/type/zfs.rb +146 -0
  639. data/lib/vendor/puppet/type/zone.rb +492 -0
  640. data/lib/vendor/puppet/type/zpool.rb +91 -0
  641. data/lib/vendor/puppet/type.rb +1979 -0
  642. data/lib/vendor/puppet/util/adsi.rb +296 -0
  643. data/lib/vendor/puppet/util/autoload/file_cache.rb +92 -0
  644. data/lib/vendor/puppet/util/autoload.rb +158 -0
  645. data/lib/vendor/puppet/util/backups.rb +87 -0
  646. data/lib/vendor/puppet/util/cacher.rb +80 -0
  647. data/lib/vendor/puppet/util/checksums.rb +143 -0
  648. data/lib/vendor/puppet/util/classgen.rb +209 -0
  649. data/lib/vendor/puppet/util/colors.rb +128 -0
  650. data/lib/vendor/puppet/util/command_line.rb +185 -0
  651. data/lib/vendor/puppet/util/constant_inflector.rb +15 -0
  652. data/lib/vendor/puppet/util/diff.rb +77 -0
  653. data/lib/vendor/puppet/util/docs.rb +123 -0
  654. data/lib/vendor/puppet/util/errors.rb +63 -0
  655. data/lib/vendor/puppet/util/execution.rb +20 -0
  656. data/lib/vendor/puppet/util/execution_stub.rb +26 -0
  657. data/lib/vendor/puppet/util/feature.rb +83 -0
  658. data/lib/vendor/puppet/util/file_locking.rb +47 -0
  659. data/lib/vendor/puppet/util/fileparsing.rb +373 -0
  660. data/lib/vendor/puppet/util/filetype.rb +296 -0
  661. data/lib/vendor/puppet/util/graph.rb +27 -0
  662. data/lib/vendor/puppet/util/inifile.rb +203 -0
  663. data/lib/vendor/puppet/util/inline_docs.rb +26 -0
  664. data/lib/vendor/puppet/util/instance_loader.rb +81 -0
  665. data/lib/vendor/puppet/util/instrumentation/data.rb +34 -0
  666. data/lib/vendor/puppet/util/instrumentation/indirection_probe.rb +29 -0
  667. data/lib/vendor/puppet/util/instrumentation/instrumentable.rb +143 -0
  668. data/lib/vendor/puppet/util/instrumentation/listener.rb +60 -0
  669. data/lib/vendor/puppet/util/instrumentation/listeners/log.rb +29 -0
  670. data/lib/vendor/puppet/util/instrumentation/listeners/performance.rb +30 -0
  671. data/lib/vendor/puppet/util/instrumentation.rb +171 -0
  672. data/lib/vendor/puppet/util/ldap/connection.rb +74 -0
  673. data/lib/vendor/puppet/util/ldap/generator.rb +42 -0
  674. data/lib/vendor/puppet/util/ldap/manager.rb +279 -0
  675. data/lib/vendor/puppet/util/ldap.rb +2 -0
  676. data/lib/vendor/puppet/util/loadedfile.rb +61 -0
  677. data/lib/vendor/puppet/util/log/destination.rb +49 -0
  678. data/lib/vendor/puppet/util/log/destinations.rb +268 -0
  679. data/lib/vendor/puppet/util/log.rb +275 -0
  680. data/lib/vendor/puppet/util/log_paths.rb +22 -0
  681. data/lib/vendor/puppet/util/logging.rb +51 -0
  682. data/lib/vendor/puppet/util/metaid.rb +21 -0
  683. data/lib/vendor/puppet/util/methodhelper.rb +32 -0
  684. data/lib/vendor/puppet/util/metric.rb +186 -0
  685. data/lib/vendor/puppet/util/monkey_patches.rb +243 -0
  686. data/lib/vendor/puppet/util/nagios_maker.rb +60 -0
  687. data/lib/vendor/puppet/util/network_device/base.rb +27 -0
  688. data/lib/vendor/puppet/util/network_device/cisco/device.rb +257 -0
  689. data/lib/vendor/puppet/util/network_device/cisco/facts.rb +72 -0
  690. data/lib/vendor/puppet/util/network_device/cisco/interface.rb +82 -0
  691. data/lib/vendor/puppet/util/network_device/cisco.rb +4 -0
  692. data/lib/vendor/puppet/util/network_device/config.rb +92 -0
  693. data/lib/vendor/puppet/util/network_device/ipcalc.rb +68 -0
  694. data/lib/vendor/puppet/util/network_device/transport/base.rb +26 -0
  695. data/lib/vendor/puppet/util/network_device/transport/ssh.rb +121 -0
  696. data/lib/vendor/puppet/util/network_device/transport/telnet.rb +42 -0
  697. data/lib/vendor/puppet/util/network_device/transport.rb +3 -0
  698. data/lib/vendor/puppet/util/network_device.rb +17 -0
  699. data/lib/vendor/puppet/util/package.rb +31 -0
  700. data/lib/vendor/puppet/util/pidlock.rb +117 -0
  701. data/lib/vendor/puppet/util/platform.rb +22 -0
  702. data/lib/vendor/puppet/util/plugins.rb +82 -0
  703. data/lib/vendor/puppet/util/posix.rb +137 -0
  704. data/lib/vendor/puppet/util/provider_features.rb +168 -0
  705. data/lib/vendor/puppet/util/pson.rb +13 -0
  706. data/lib/vendor/puppet/util/queue/stomp.rb +60 -0
  707. data/lib/vendor/puppet/util/queue.rb +96 -0
  708. data/lib/vendor/puppet/util/rails/cache_accumulator.rb +65 -0
  709. data/lib/vendor/puppet/util/rails/collection_merger.rb +17 -0
  710. data/lib/vendor/puppet/util/rails/reference_serializer.rb +32 -0
  711. data/lib/vendor/puppet/util/rdoc.rb +87 -0
  712. data/lib/vendor/puppet/util/reference.rb +124 -0
  713. data/lib/vendor/puppet/util/resource_template.rb +61 -0
  714. data/lib/vendor/puppet/util/retryaction.rb +48 -0
  715. data/lib/vendor/puppet/util/run_mode.rb +82 -0
  716. data/lib/vendor/puppet/util/selinux.rb +211 -0
  717. data/lib/vendor/puppet/util/settings/boolean_setting.rb +30 -0
  718. data/lib/vendor/puppet/util/settings/file_setting.rb +135 -0
  719. data/lib/vendor/puppet/util/settings/setting.rb +94 -0
  720. data/lib/vendor/puppet/util/settings.rb +926 -0
  721. data/lib/vendor/puppet/util/storage.rb +96 -0
  722. data/lib/vendor/puppet/util/subclass_loader.rb +82 -0
  723. data/lib/vendor/puppet/util/suidmanager.rb +173 -0
  724. data/lib/vendor/puppet/util/symbolic_file_mode.rb +140 -0
  725. data/lib/vendor/puppet/util/tagging.rb +78 -0
  726. data/lib/vendor/puppet/util/terminal.rb +16 -0
  727. data/lib/vendor/puppet/util/user_attr.rb +21 -0
  728. data/lib/vendor/puppet/util/warnings.rb +29 -0
  729. data/lib/vendor/puppet/util/windows/error.rb +16 -0
  730. data/lib/vendor/puppet/util/windows/file.rb +27 -0
  731. data/lib/vendor/puppet/util/windows/process.rb +33 -0
  732. data/lib/vendor/puppet/util/windows/security.rb +622 -0
  733. data/lib/vendor/puppet/util/windows/sid.rb +96 -0
  734. data/lib/vendor/puppet/util/windows/user.rb +106 -0
  735. data/lib/vendor/puppet/util/windows.rb +8 -0
  736. data/lib/vendor/puppet/util/zaml.rb +407 -0
  737. data/lib/vendor/puppet/util.rb +646 -0
  738. data/lib/vendor/puppet/version.rb +18 -0
  739. data/lib/vendor/puppet.rb +125 -0
  740. data/lib/vendor/semver.rb +124 -0
  741. data/puppet-parse.gemspec +2 -8
  742. metadata +812 -94
@@ -0,0 +1,81 @@
1
+ require 'puppet/network/http/handler'
2
+ require 'resolv'
3
+ require 'webrick'
4
+
5
+ class Puppet::Network::HTTP::WEBrickREST < WEBrick::HTTPServlet::AbstractServlet
6
+
7
+ include Puppet::Network::HTTP::Handler
8
+
9
+ def initialize(server, handler)
10
+ raise ArgumentError, "server is required" unless server
11
+ super(server)
12
+ initialize_for_puppet(:server => server, :handler => handler)
13
+ end
14
+
15
+ # Retrieve the request parameters, including authentication information.
16
+ def params(request)
17
+ result = request.query
18
+ result = decode_params(result)
19
+ result.merge(client_information(request))
20
+ end
21
+
22
+ # WEBrick uses a service method to respond to requests. Simply delegate to the handler response method.
23
+ def service(request, response)
24
+ process(request, response)
25
+ end
26
+
27
+ def accept_header(request)
28
+ request["accept"]
29
+ end
30
+
31
+ def content_type_header(request)
32
+ request["content-type"]
33
+ end
34
+
35
+ def http_method(request)
36
+ request.request_method
37
+ end
38
+
39
+ def path(request)
40
+ request.path
41
+ end
42
+
43
+ def body(request)
44
+ request.body
45
+ end
46
+
47
+ # Set the specified format as the content type of the response.
48
+ def set_content_type(response, format)
49
+ response["content-type"] = format_to_mime(format)
50
+ end
51
+
52
+ def set_response(response, result, status = 200)
53
+ response.status = status
54
+ if status >= 200 and status != 304
55
+ response.body = result
56
+ response["content-length"] = result.stat.size if result.is_a?(File)
57
+ end
58
+ response.reason_phrase = result if status < 200 or status >= 300
59
+ end
60
+
61
+ # Retrieve node/cert/ip information from the request object.
62
+ def client_information(request)
63
+ result = {}
64
+ if peer = request.peeraddr and ip = peer[3]
65
+ result[:ip] = ip
66
+ end
67
+
68
+ # If they have a certificate (which will almost always be true)
69
+ # then we get the hostname from the cert, instead of via IP
70
+ # info
71
+ result[:authenticated] = false
72
+ if cert = request.client_cert and nameary = cert.subject.to_a.find { |ary| ary[0] == "CN" }
73
+ result[:node] = nameary[1]
74
+ result[:authenticated] = true
75
+ else
76
+ result[:node] = resolve_node(result)
77
+ end
78
+
79
+ result
80
+ end
81
+ end
@@ -0,0 +1,141 @@
1
+ require 'webrick'
2
+ require 'webrick/https'
3
+ require 'puppet/network/http/webrick/rest'
4
+ require 'puppet/network/xmlrpc/webrick_servlet'
5
+ require 'thread'
6
+
7
+ require 'puppet/ssl/certificate'
8
+ require 'puppet/ssl/certificate_revocation_list'
9
+
10
+ class Puppet::Network::HTTP::WEBrick
11
+ def initialize(args = {})
12
+ @listening = false
13
+ @mutex = Mutex.new
14
+ end
15
+
16
+ def self.class_for_protocol(protocol)
17
+ return Puppet::Network::HTTP::WEBrickREST if protocol.to_sym == :rest
18
+ raise "Unknown protocol [#{protocol}]."
19
+ end
20
+
21
+ def listen(args = {})
22
+ raise ArgumentError, ":protocols must be specified." if !args[:protocols] or args[:protocols].empty?
23
+ raise ArgumentError, ":address must be specified." unless args[:address]
24
+ raise ArgumentError, ":port must be specified." unless args[:port]
25
+
26
+ @protocols = args[:protocols]
27
+ @xmlrpc_handlers = args[:xmlrpc_handlers]
28
+
29
+ arguments = {:BindAddress => args[:address], :Port => args[:port]}
30
+ arguments.merge!(setup_logger)
31
+ arguments.merge!(setup_ssl)
32
+
33
+ @server = WEBrick::HTTPServer.new(arguments)
34
+ @server.listeners.each { |l| l.start_immediately = false }
35
+
36
+ setup_handlers
37
+
38
+ @mutex.synchronize do
39
+ raise "WEBrick server is already listening" if @listening
40
+ @listening = true
41
+ @thread = Thread.new {
42
+ @server.start { |sock|
43
+ raise "Client disconnected before connection could be established" unless IO.select([sock],nil,nil,6.2)
44
+ sock.accept
45
+ @server.run(sock)
46
+ }
47
+ }
48
+ sleep 0.1 until @server.status == :Running
49
+ end
50
+ end
51
+
52
+ def unlisten
53
+ @mutex.synchronize do
54
+ raise "WEBrick server is not listening" unless @listening
55
+ @server.shutdown
56
+ @thread.join
57
+ @server = nil
58
+ @listening = false
59
+ end
60
+ end
61
+
62
+ def listening?
63
+ @mutex.synchronize do
64
+ @listening
65
+ end
66
+ end
67
+
68
+ # Configure our http log file.
69
+ def setup_logger
70
+ # Make sure the settings are all ready for us.
71
+ Puppet.settings.use(:main, :ssl, Puppet[:name])
72
+
73
+ if Puppet.run_mode.master?
74
+ file = Puppet[:masterhttplog]
75
+ else
76
+ file = Puppet[:httplog]
77
+ end
78
+
79
+ # open the log manually to prevent file descriptor leak
80
+ file_io = ::File.open(file, "a+")
81
+ file_io.sync = true
82
+ if defined?(Fcntl::FD_CLOEXEC)
83
+ file_io.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC)
84
+ end
85
+
86
+ args = [file_io]
87
+ args << WEBrick::Log::DEBUG if Puppet::Util::Log.level == :debug
88
+
89
+ logger = WEBrick::Log.new(*args)
90
+ return :Logger => logger, :AccessLog => [
91
+ [logger, WEBrick::AccessLog::COMMON_LOG_FORMAT ],
92
+ [logger, WEBrick::AccessLog::REFERER_LOG_FORMAT ]
93
+ ]
94
+ end
95
+
96
+ # Add all of the ssl cert information.
97
+ def setup_ssl
98
+ results = {}
99
+
100
+ # Get the cached copy. We know it's been generated, too.
101
+ host = Puppet::SSL::Host.localhost
102
+
103
+ raise Puppet::Error, "Could not retrieve certificate for #{host.name} and not running on a valid certificate authority" unless host.certificate
104
+
105
+ results[:SSLPrivateKey] = host.key.content
106
+ results[:SSLCertificate] = host.certificate.content
107
+ results[:SSLStartImmediately] = true
108
+ results[:SSLEnable] = true
109
+
110
+ raise Puppet::Error, "Could not find CA certificate" unless Puppet::SSL::Certificate.indirection.find(Puppet::SSL::CA_NAME)
111
+
112
+ results[:SSLCACertificateFile] = Puppet[:localcacert]
113
+ results[:SSLVerifyClient] = OpenSSL::SSL::VERIFY_PEER
114
+
115
+ results[:SSLCertificateStore] = host.ssl_store
116
+
117
+ results
118
+ end
119
+
120
+ private
121
+
122
+ def setup_handlers
123
+ # Set up the new-style protocols.
124
+ klass = self.class.class_for_protocol(:rest)
125
+ @server.mount('/', klass, :this_value_is_apparently_necessary_but_unused)
126
+
127
+ # And then set up xmlrpc, if configured.
128
+ @server.mount("/RPC2", xmlrpc_servlet) if @protocols.include?(:xmlrpc) and ! @xmlrpc_handlers.empty?
129
+ end
130
+
131
+ # Create our xmlrpc servlet, which provides backward compatibility.
132
+ def xmlrpc_servlet
133
+ handlers = @xmlrpc_handlers.collect { |handler|
134
+ unless hclass = Puppet::Network::Handler.handler(handler)
135
+ raise "Invalid xmlrpc handler #{handler}"
136
+ end
137
+ hclass.new({})
138
+ }
139
+ Puppet::Network::XMLRPC::WEBrickServlet.new handlers
140
+ end
141
+ end
@@ -0,0 +1,15 @@
1
+ module Puppet::Network::HTTP
2
+ def self.server_class_by_type(kind)
3
+ case kind.to_sym
4
+ when :webrick
5
+ require 'puppet/network/http/webrick'
6
+ return Puppet::Network::HTTP::WEBrick
7
+ when :mongrel
8
+ raise ArgumentError, "Mongrel is not installed on this platform" unless Puppet.features.mongrel?
9
+ require 'puppet/network/http/mongrel'
10
+ return Puppet::Network::HTTP::Mongrel
11
+ else
12
+ raise ArgumentError, "Unknown HTTP server name [#{kind}]"
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,57 @@
1
+ require 'puppet/ssl/host'
2
+ require 'net/https'
3
+
4
+ module Puppet::Network; end
5
+
6
+ module Puppet::Network::HttpPool
7
+ # Use the global localhost instance.
8
+ def self.ssl_host
9
+ Puppet::SSL::Host.localhost
10
+ end
11
+
12
+ # Use cert information from a Puppet client to set up the http object.
13
+ def self.cert_setup(http)
14
+ if FileTest.exist?(Puppet[:hostcert]) and FileTest.exist?(Puppet[:localcacert])
15
+ http.cert_store = ssl_host.ssl_store
16
+ http.ca_file = Puppet[:localcacert]
17
+ http.cert = ssl_host.certificate.content
18
+ http.verify_mode = OpenSSL::SSL::VERIFY_PEER
19
+ http.key = ssl_host.key.content
20
+ else
21
+ # We don't have the local certificates, so we don't do any verification
22
+ # or setup at this early stage. REVISIT: Shouldn't we supply the local
23
+ # certificate details if we have them? The original code didn't.
24
+ # --daniel 2012-06-03
25
+
26
+ # Ruby 1.8 defaulted to this, but 1.9 defaults to peer verify, and we
27
+ # almost always talk to a dedicated, not-standard CA that isn't trusted
28
+ # out of the box. This forces the expected state.
29
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
30
+ end
31
+ end
32
+
33
+ # Retrieve a cached http instance if caching is enabled, else return
34
+ # a new one.
35
+ def self.http_instance(host, port, reset = false)
36
+ args = [host, port]
37
+ if Puppet[:http_proxy_host] == "none"
38
+ args << nil << nil
39
+ else
40
+ args << Puppet[:http_proxy_host] << Puppet[:http_proxy_port]
41
+ end
42
+ http = Net::HTTP.new(*args)
43
+
44
+ # Pop open the http client a little; older versions of Net::HTTP(s) didn't
45
+ # give us a reader for ca_file... Grr...
46
+ class << http; attr_accessor :ca_file; end
47
+
48
+ http.use_ssl = true
49
+ # Use configured timeout (#1176)
50
+ http.read_timeout = Puppet[:configtimeout]
51
+ http.open_timeout = Puppet[:configtimeout]
52
+
53
+ cert_setup(http)
54
+
55
+ http
56
+ end
57
+ end
@@ -0,0 +1,129 @@
1
+ #!/usr/bin/env ruby
2
+ # File: 06-11-14-mongrel_xmlrpc.rb
3
+ # Author: Manuel Holtgrewe <purestorm at ggnore.net>
4
+ #
5
+ # Copyright (c) 2006 Manuel Holtgrewe, 2007 Luke Kanies
6
+ #
7
+ # This file is based heavily on a file retrieved from
8
+ # http://ttt.ggnore.net/2006/11/15/xmlrpc-with-mongrel-and-ruby-off-rails/
9
+
10
+ require 'rubygems'
11
+ require 'mongrel'
12
+ require 'xmlrpc/server'
13
+ require 'puppet/network/xmlrpc/server'
14
+ require 'puppet/network/http_server'
15
+ require 'puppet/network/client_request'
16
+ require 'puppet/network/handler'
17
+
18
+ require 'resolv'
19
+
20
+ # This handler can be hooked into Mongrel to accept HTTP requests. After
21
+ # checking whether the request itself is sane, the handler forwards it
22
+ # to an internal instance of XMLRPC::BasicServer to process it.
23
+ #
24
+ # You can access the server by calling the Handler's "xmlrpc_server"
25
+ # attribute accessor method and add XMLRPC handlers there. For example:
26
+ #
27
+ # <pre>
28
+ # handler = XmlRpcHandler.new
29
+ # handler.xmlrpc_server.add_handler("my.add") { |a, b| a.to_i + b.to_i }
30
+ # </pre>
31
+ module Puppet::Network
32
+ class HTTPServer::Mongrel < ::Mongrel::HttpHandler
33
+ attr_reader :xmlrpc_server
34
+
35
+ def initialize(handlers)
36
+ if Puppet[:debug]
37
+ $mongrel_debug_client = true
38
+ Puppet.debug 'Mongrel client debugging enabled. [$mongrel_debug_client = true].'
39
+ end
40
+ # Create a new instance of BasicServer. We are supposed to subclass it
41
+ # but that does not make sense since we would not introduce any new
42
+ # behaviour and we have to subclass Mongrel::HttpHandler so our handler
43
+ # works for Mongrel.
44
+ @xmlrpc_server = Puppet::Network::XMLRPCServer.new
45
+ handlers.each do |name|
46
+ unless handler = Puppet::Network::Handler.handler(name)
47
+ raise ArgumentError, "Invalid handler #{name}"
48
+ end
49
+ @xmlrpc_server.add_handler(handler.interface, handler.new({}))
50
+ end
51
+ end
52
+
53
+ # This method produces the same results as XMLRPC::CGIServer.serve
54
+ # from Ruby's stdlib XMLRPC implementation.
55
+ def process(request, response)
56
+ # Make sure this has been a POST as required for XMLRPC.
57
+ request_method = request.params[Mongrel::Const::REQUEST_METHOD] || Mongrel::Const::GET
58
+ if request_method != "POST"
59
+ response.start(405) { |head, out| out.write("Method Not Allowed") }
60
+ return
61
+ end
62
+
63
+ # Make sure the user has sent text/xml data.
64
+ request_mime = request.params["CONTENT_TYPE"] || "text/plain"
65
+ if parse_content_type(request_mime).first != "text/xml"
66
+ response.start(400) { |head, out| out.write("Bad Request") }
67
+ return
68
+ end
69
+
70
+ # Make sure there is data in the body at all.
71
+ length = request.params[Mongrel::Const::CONTENT_LENGTH].to_i
72
+ if length <= 0
73
+ response.start(411) { |head, out| out.write("Length Required") }
74
+ return
75
+ end
76
+
77
+ # Check the body to be valid.
78
+ if request.body.nil? or request.body.size != length
79
+ response.start(400) { |head, out| out.write("Bad Request") }
80
+ return
81
+ end
82
+
83
+ info = client_info(request)
84
+
85
+ # All checks above passed through
86
+ response.start(200) do |head, out|
87
+ head["Content-Type"] = "text/xml; charset=utf-8"
88
+ begin
89
+ out.write(@xmlrpc_server.process(request.body, info))
90
+ rescue => detail
91
+ puts detail.backtrace
92
+ raise
93
+ end
94
+ end
95
+ end
96
+
97
+ private
98
+
99
+ def client_info(request)
100
+ params = request.params
101
+ ip = params["HTTP_X_FORWARDED_FOR"] ? params["HTTP_X_FORWARDED_FOR"].split(',').last.strip : params["REMOTE_ADDR"]
102
+ # JJM #906 The following dn.match regular expression is forgiving
103
+ # enough to match the two Distinguished Name string contents
104
+ # coming from Apache, Pound or other reverse SSL proxies.
105
+ if dn = params[Puppet[:ssl_client_header]] and dn_matchdata = dn.match(/^.*?CN\s*=\s*(.*)/)
106
+ client = dn_matchdata[1].to_str
107
+ valid = (params[Puppet[:ssl_client_verify_header]] == 'SUCCESS')
108
+ else
109
+ begin
110
+ client = Resolv.getname(ip)
111
+ rescue => detail
112
+ Puppet.err "Could not resolve #{ip}: #{detail}"
113
+ client = "unknown"
114
+ end
115
+ valid = false
116
+ end
117
+
118
+ info = Puppet::Network::ClientRequest.new(client, ip, valid)
119
+
120
+ info
121
+ end
122
+
123
+ # Taken from XMLRPC::ParseContentType
124
+ def parse_content_type(str)
125
+ a, *b = str.split(";")
126
+ return a.strip, *b
127
+ end
128
+ end
129
+ end
@@ -0,0 +1,3 @@
1
+ # Just a stub, so we can correctly scope other classes.
2
+ module Puppet::Network::HTTPServer # :nodoc:
3
+ end
@@ -0,0 +1,102 @@
1
+ require 'puppet/network/authconfig'
2
+
3
+ module Puppet
4
+ class Network::RestAuthConfig < Network::AuthConfig
5
+
6
+ extend MonitorMixin
7
+ attr_accessor :rights
8
+
9
+ DEFAULT_ACL = [
10
+ { :acl => "~ ^\/catalog\/([^\/]+)$", :method => :find, :allow => '$1', :authenticated => true },
11
+ { :acl => "~ ^\/node\/([^\/]+)$", :method => :find, :allow => '$1', :authenticated => true },
12
+ # this one will allow all file access, and thus delegate
13
+ # to fileserver.conf
14
+ { :acl => "/file" },
15
+ { :acl => "/certificate_revocation_list/ca", :method => :find, :authenticated => true },
16
+ { :acl => "/report", :method => :save, :authenticated => true },
17
+ # These allow `auth any`, because if you can do them anonymously you
18
+ # should probably also be able to do them when trusted.
19
+ { :acl => "/certificate/ca", :method => :find, :authenticated => :any },
20
+ { :acl => "/certificate/", :method => :find, :authenticated => :any },
21
+ { :acl => "/certificate_request", :method => [:find, :save], :authenticated => :any },
22
+ { :acl => "/status", :method => [:find], :authenticated => true },
23
+ ]
24
+
25
+ def self.main
26
+ synchronize do
27
+ add_acl = @main.nil?
28
+ super
29
+ @main.insert_default_acl if add_acl and !@main.exists?
30
+ end
31
+ @main
32
+ end
33
+
34
+ def allowed?(request)
35
+ Puppet.deprecation_warning "allowed? should not be called for REST authorization - use check_authorization instead"
36
+ check_authorization(request)
37
+ end
38
+
39
+ # check wether this request is allowed in our ACL
40
+ # raise an Puppet::Network::AuthorizedError if the request
41
+ # is denied.
42
+ def check_authorization(indirection, method, key, params)
43
+ read
44
+
45
+ # we're splitting the request in part because
46
+ # fail_on_deny could as well be called in the XMLRPC context
47
+ # with a ClientRequest.
48
+
49
+ if authorization_failure_exception = @rights.is_request_forbidden_and_why?(indirection, method, key, params)
50
+ Puppet.warning("Denying access: #{authorization_failure_exception}")
51
+ raise authorization_failure_exception
52
+ end
53
+ end
54
+
55
+ def initialize(file = nil, parsenow = true)
56
+ super(file || Puppet[:rest_authconfig], parsenow)
57
+
58
+ # if we didn't read a file (ie it doesn't exist)
59
+ # make sure we can create some default rights
60
+ @rights ||= Puppet::Network::Rights.new
61
+ end
62
+
63
+ def parse
64
+ super()
65
+ insert_default_acl
66
+ end
67
+
68
+ # force regular ACLs to be present
69
+ def insert_default_acl
70
+ if exists? then
71
+ reason = "none were found in '#{@file}'"
72
+ else
73
+ reason = "#{Puppet[:rest_authconfig]} doesn't exist"
74
+ end
75
+
76
+ DEFAULT_ACL.each do |acl|
77
+ unless rights[acl[:acl]]
78
+ Puppet.info "Inserting default '#{acl[:acl]}' (auth #{acl[:authenticated]}) ACL because #{reason}"
79
+ mk_acl(acl)
80
+ end
81
+ end
82
+ # queue an empty (ie deny all) right for every other path
83
+ # actually this is not strictly necessary as the rights system
84
+ # denies not explicitely allowed paths
85
+ unless rights["/"]
86
+ rights.newright("/")
87
+ rights.restrict_authenticated("/", :any)
88
+ end
89
+ end
90
+
91
+ def mk_acl(acl)
92
+ @rights.newright(acl[:acl])
93
+ @rights.allow(acl[:acl], acl[:allow] || "*")
94
+
95
+ if method = acl[:method]
96
+ method = [method] unless method.is_a?(Array)
97
+ method.each { |m| @rights.restrict_method(acl[:acl], m) }
98
+ end
99
+ @rights.restrict_authenticated(acl[:acl], acl[:authenticated]) unless acl[:authenticated].nil?
100
+ end
101
+ end
102
+ end
@@ -0,0 +1,23 @@
1
+ require 'puppet/network/client_request'
2
+ require 'puppet/network/rest_authconfig'
3
+
4
+ module Puppet::Network
5
+
6
+ module RestAuthorization
7
+
8
+
9
+ # Create our config object if necessary. If there's no configuration file
10
+ # we install our defaults
11
+ def authconfig
12
+ @authconfig ||= Puppet::Network::RestAuthConfig.main
13
+
14
+ @authconfig
15
+ end
16
+
17
+ # Verify that our client has access.
18
+ def check_authorization(indirection, method, key, params)
19
+ authconfig.check_authorization(indirection, method, key, params)
20
+ end
21
+ end
22
+ end
23
+
@@ -0,0 +1,2 @@
1
+ class Puppet::Network::RESTController # :nodoc:
2
+ end