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,114 @@
1
+ module Puppet
2
+ require 'puppet/file_bucket/dipper'
3
+
4
+ newtype(:filebucket) do
5
+ @doc = "A repository for backing up files. If no filebucket is
6
+ defined, then files will be backed up in their current directory,
7
+ but the filebucket can be either a host- or site-global repository
8
+ for backing up. It stores files and returns the MD5 sum, which
9
+ can later be used to retrieve the file if restoration becomes
10
+ necessary. A filebucket does not do any work itself; instead,
11
+ it can be specified as the value of *backup* in a **file** object.
12
+
13
+ Currently, filebuckets are only useful for manual retrieval of
14
+ accidentally removed files (e.g., you look in the log for the md5 sum
15
+ and retrieve the file with that sum from the filebucket), but when
16
+ transactions are fully supported filebuckets will be used to undo
17
+ transactions.
18
+
19
+ You will normally want to define a single filebucket for your
20
+ whole network and then use that as the default backup location:
21
+
22
+ # Define the bucket
23
+ filebucket { 'main':
24
+ server => puppet,
25
+ path => false,
26
+ # Due to a known issue, path must be set to false for remote filebuckets.
27
+ }
28
+
29
+ # Specify it as the default target
30
+ File { backup => main }
31
+
32
+ Puppetmaster servers create a filebucket by default, so this will
33
+ work in a default configuration."
34
+
35
+ newparam(:name) do
36
+ desc "The name of the filebucket."
37
+ isnamevar
38
+ end
39
+
40
+ newparam(:server) do
41
+ desc "The server providing the remote filebucket. If this is not
42
+ specified then *path* is checked. If it is set, then the
43
+ bucket is local. Otherwise the puppetmaster server specified
44
+ in the config or at the commandline is used.
45
+
46
+ Due to a known issue, you currently must set the `path` attribute to
47
+ false if you wish to specify a `server` attribute."
48
+ defaultto { Puppet[:server] }
49
+ end
50
+
51
+ newparam(:port) do
52
+ desc "The port on which the remote server is listening.
53
+ Defaults to the normal Puppet port, %s." % Puppet[:masterport]
54
+
55
+ defaultto { Puppet[:masterport] }
56
+ end
57
+
58
+ newparam(:path) do
59
+ desc "The path to the local filebucket. If this is
60
+ unset, then the bucket is remote. The parameter *server* must
61
+ can be specified to set the remote server."
62
+
63
+ defaultto { Puppet[:clientbucketdir] }
64
+
65
+ validate do |value|
66
+ if value.is_a? Array
67
+ raise ArgumentError, "You can only have one filebucket path"
68
+ end
69
+
70
+ if value.is_a? String and not Puppet::Util.absolute_path?(value)
71
+ raise ArgumentError, "Filebucket paths must be absolute"
72
+ end
73
+
74
+ true
75
+ end
76
+ end
77
+
78
+ # Create a default filebucket.
79
+ def self.mkdefaultbucket
80
+ new(:name => "puppet", :path => Puppet[:clientbucketdir])
81
+ end
82
+
83
+ def bucket
84
+ mkbucket unless defined?(@bucket)
85
+ @bucket
86
+ end
87
+
88
+ private
89
+
90
+ def mkbucket
91
+ # Default is a local filebucket, if no server is given.
92
+ # If the default path has been removed, too, then
93
+ # the puppetmaster is used as default server
94
+
95
+ type = "local"
96
+ args = {}
97
+ if self[:path]
98
+ args[:Path] = self[:path]
99
+ else
100
+ args[:Server] = self[:server]
101
+ args[:Port] = self[:port]
102
+ end
103
+
104
+ begin
105
+ @bucket = Puppet::FileBucket::Dipper.new(args)
106
+ rescue => detail
107
+ puts detail.backtrace if Puppet[:trace]
108
+ self.fail("Could not create #{type} filebucket: #{detail}")
109
+ end
110
+
111
+ @bucket.name = self.name
112
+ end
113
+ end
114
+ end
@@ -0,0 +1,149 @@
1
+ require 'etc'
2
+ require 'facter'
3
+ require 'puppet/property/keyvalue'
4
+
5
+ module Puppet
6
+ newtype(:group) do
7
+ @doc = "Manage groups. On most platforms this can only create groups.
8
+ Group membership must be managed on individual users.
9
+
10
+ On some platforms such as OS X, group membership is managed as an
11
+ attribute of the group, not the user record. Providers must have
12
+ the feature 'manages_members' to manage the 'members' property of
13
+ a group record."
14
+
15
+ feature :manages_members,
16
+ "For directories where membership is an attribute of groups not users."
17
+
18
+ feature :manages_aix_lam,
19
+ "The provider can manage AIX Loadable Authentication Module (LAM) system."
20
+
21
+ feature :system_groups,
22
+ "The provider allows you to create system groups with lower GIDs."
23
+
24
+ ensurable do
25
+ desc "Create or remove the group."
26
+
27
+ newvalue(:present) do
28
+ provider.create
29
+ end
30
+
31
+ newvalue(:absent) do
32
+ provider.delete
33
+ end
34
+ end
35
+
36
+ newproperty(:gid) do
37
+ desc "The group ID. Must be specified numerically. If no group ID is
38
+ specified when creating a new group, then one will be chosen
39
+ automatically according to local system standards. This will likely
40
+ result in the same group having different GIDs on different systems,
41
+ which is not recommended.
42
+
43
+ On Windows, this property is read-only and will return the group's security
44
+ identifier (SID)."
45
+
46
+ def retrieve
47
+ provider.gid
48
+ end
49
+
50
+ def sync
51
+ if self.should == :absent
52
+ raise Puppet::DevError, "GID cannot be deleted"
53
+ else
54
+ provider.gid = self.should
55
+ end
56
+ end
57
+
58
+ munge do |gid|
59
+ case gid
60
+ when String
61
+ if gid =~ /^[-0-9]+$/
62
+ gid = Integer(gid)
63
+ else
64
+ self.fail "Invalid GID #{gid}"
65
+ end
66
+ when Symbol
67
+ unless gid == :absent
68
+ self.devfail "Invalid GID #{gid}"
69
+ end
70
+ end
71
+
72
+ return gid
73
+ end
74
+ end
75
+
76
+ newproperty(:members, :array_matching => :all, :required_features => :manages_members) do
77
+ desc "The members of the group. For directory services where group
78
+ membership is stored in the group objects, not the users."
79
+
80
+ def change_to_s(currentvalue, newvalue)
81
+ currentvalue = currentvalue.join(",") if currentvalue != :absent
82
+ newvalue = newvalue.join(",")
83
+ super(currentvalue, newvalue)
84
+ end
85
+ end
86
+
87
+ newparam(:auth_membership) do
88
+ desc "whether the provider is authoritative for group membership."
89
+ defaultto true
90
+ end
91
+
92
+ newparam(:name) do
93
+ desc "The group name. While naming limitations vary by operating system,
94
+ it is advisable to restrict names to the lowest common denominator,
95
+ which is a maximum of 8 characters beginning with a letter.
96
+
97
+ Note that Puppet considers group names to be case-sensitive, regardless
98
+ of the platform's own rules; be sure to always use the same case when
99
+ referring to a given group."
100
+ isnamevar
101
+ end
102
+
103
+ newparam(:allowdupe, :boolean => true) do
104
+ desc "Whether to allow duplicate GIDs. Defaults to `false`."
105
+
106
+ newvalues(:true, :false)
107
+
108
+ defaultto false
109
+ end
110
+
111
+ newparam(:ia_load_module, :required_features => :manages_aix_lam) do
112
+ desc "The name of the I&A module to use to manage this user"
113
+ end
114
+
115
+ newproperty(:attributes, :parent => Puppet::Property::KeyValue, :required_features => :manages_aix_lam) do
116
+ desc "Specify group AIX attributes in an array of `key=value` pairs."
117
+
118
+ def membership
119
+ :attribute_membership
120
+ end
121
+
122
+ def delimiter
123
+ " "
124
+ end
125
+
126
+ validate do |value|
127
+ raise ArgumentError, "Attributes value pairs must be separated by an =" unless value.include?("=")
128
+ end
129
+ end
130
+
131
+ newparam(:attribute_membership) do
132
+ desc "Whether specified attribute value pairs should be treated as the only attributes
133
+ of the user or whether they should merely
134
+ be treated as the minimum list."
135
+
136
+ newvalues(:inclusive, :minimum)
137
+
138
+ defaultto :minimum
139
+ end
140
+
141
+ newparam(:system, :boolean => true) do
142
+ desc "Whether the group is a system group with lower GID."
143
+
144
+ newvalues(:true, :false)
145
+
146
+ defaultto false
147
+ end
148
+ end
149
+ end
@@ -0,0 +1,87 @@
1
+ require 'puppet/property/ordered_list'
2
+
3
+ module Puppet
4
+ newtype(:host) do
5
+ ensurable
6
+
7
+ newproperty(:ip) do
8
+ desc "The host's IP address, IPv4 or IPv6."
9
+
10
+
11
+ def valid_v4?(addr)
12
+ if /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/ =~ addr
13
+ return $~.captures.all? {|i| i = i.to_i; i >= 0 and i <= 255 }
14
+ end
15
+ return false
16
+ end
17
+
18
+ def valid_v6?(addr)
19
+ # http://forums.dartware.com/viewtopic.php?t=452
20
+ # ...and, yes, it is this hard. Doing it programatically is harder.
21
+ return true if addr =~ /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/
22
+
23
+ return false
24
+ end
25
+
26
+ validate do |value|
27
+ return true if valid_v4?(value) or valid_v6?(value)
28
+ raise Puppet::Error, "Invalid IP address #{value.inspect}"
29
+ end
30
+ end
31
+
32
+ # for now we use OrderedList to indicate that the order does matter.
33
+ newproperty(:host_aliases, :parent => Puppet::Property::OrderedList) do
34
+ desc "Any aliases the host might have. Multiple values must be
35
+ specified as an array."
36
+
37
+ def delimiter
38
+ " "
39
+ end
40
+
41
+ def inclusive?
42
+ true
43
+ end
44
+
45
+ validate do |value|
46
+ raise Puppet::Error, "Host aliases cannot include whitespace" if value =~ /\s/
47
+ raise Puppet::Error, "Host alias cannot be an empty string. Use an empty array to delete all host_aliases " if value =~ /^\s*$/
48
+ end
49
+
50
+ end
51
+
52
+ newproperty(:comment) do
53
+ desc "A comment that will be attached to the line with a # character."
54
+ end
55
+
56
+ newproperty(:target) do
57
+ desc "The file in which to store service information. Only used by
58
+ those providers that write to disk. On most systems this defaults to `/etc/hosts`."
59
+
60
+ defaultto { if @resource.class.defaultprovider.ancestors.include?(Puppet::Provider::ParsedFile)
61
+ @resource.class.defaultprovider.default_target
62
+ else
63
+ nil
64
+ end
65
+ }
66
+ end
67
+
68
+ newparam(:name) do
69
+ desc "The host name."
70
+
71
+ isnamevar
72
+
73
+ validate do |value|
74
+ # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
75
+ x = value.split('.').each do |hostpart|
76
+ unless hostpart =~ /^([\d\w]+|[\d\w][\d\w\-]+[\d\w])$/
77
+ raise Puppet::Error, "Invalid host name"
78
+ end
79
+ end
80
+ end
81
+ end
82
+
83
+ @doc = "Installs and manages host entries. For most systems, these
84
+ entries will just be in `/etc/hosts`, but some systems (notably OS X)
85
+ will have different solutions."
86
+ end
87
+ end
@@ -0,0 +1,112 @@
1
+ #
2
+ # Manages an interface on a given router or switch
3
+ #
4
+
5
+ require 'puppet/util/network_device/ipcalc'
6
+
7
+ Puppet::Type.newtype(:interface) do
8
+
9
+ @doc = "This represents a router or switch interface. It is possible to manage
10
+ interface mode (access or trunking, native vlan and encapsulation) and
11
+ switchport characteristics (speed, duplex)."
12
+
13
+ apply_to_device
14
+
15
+ ensurable do
16
+ defaultvalues
17
+
18
+ aliasvalue :shutdown, :absent
19
+ aliasvalue :no_shutdown, :present
20
+
21
+ defaultto { :no_shutdown }
22
+ end
23
+
24
+ newparam(:name) do
25
+ desc "The interface's name."
26
+ end
27
+
28
+ newparam(:device_url) do
29
+ desc "The URL at which the router or switch can be reached."
30
+ end
31
+
32
+ newproperty(:description) do
33
+ desc "Interface description."
34
+
35
+ defaultto { @resource[:name] }
36
+ end
37
+
38
+ newproperty(:speed) do
39
+ desc "Interface speed."
40
+ newvalues(:auto, /^\d+/)
41
+ end
42
+
43
+ newproperty(:duplex) do
44
+ desc "Interface duplex."
45
+ newvalues(:auto, :full, :half)
46
+ end
47
+
48
+ newproperty(:native_vlan) do
49
+ desc "Interface native vlan (for access mode only)."
50
+ newvalues(/^\d+/)
51
+ end
52
+
53
+ newproperty(:encapsulation) do
54
+ desc "Interface switchport encapsulation."
55
+ newvalues(:none, :dot1q, :isl )
56
+ end
57
+
58
+ newproperty(:mode) do
59
+ desc "Interface switchport mode."
60
+ newvalues(:access, :trunk)
61
+ end
62
+
63
+ newproperty(:allowed_trunk_vlans) do
64
+ desc "Allowed list of Vlans that this trunk can forward."
65
+ newvalues(:all, /./)
66
+ end
67
+
68
+ newproperty(:etherchannel) do
69
+ desc "Channel group this interface is part of."
70
+ newvalues(/^\d+/)
71
+ end
72
+
73
+ newproperty(:ipaddress, :array_matching => :all) do
74
+ include Puppet::Util::NetworkDevice::IPCalc
75
+
76
+ desc "IP Address of this interface. Note that it might not be possible to set
77
+ an interface IP address; it depends on the interface type and device type.
78
+
79
+ Valid format of ip addresses are:
80
+
81
+ * IPV4, like 127.0.0.1
82
+ * IPV4/prefixlength like 127.0.1.1/24
83
+ * IPV6/prefixlength like FE80::21A:2FFF:FE30:ECF0/128
84
+ * an optional suffix for IPV6 addresses from this list: `eui-64`, `link-local`
85
+
86
+ It is also possible to supply an array of values.
87
+ "
88
+
89
+ validate do |values|
90
+ values = [values] unless values.is_a?(Array)
91
+ values.each do |value|
92
+ self.fail "Invalid interface ip address" unless parse(value.gsub(/\s*(eui-64|link-local)\s*$/,''))
93
+ end
94
+ end
95
+
96
+ munge do |value|
97
+ option = value =~ /eui-64|link-local/i ? value.gsub(/^.*?\s*(eui-64|link-local)\s*$/,'\1') : nil
98
+ [parse(value.gsub(/\s*(eui-64|link-local)\s*$/,'')), option].flatten
99
+ end
100
+
101
+ def value_to_s(value)
102
+ value = [value] unless value.is_a?(Array)
103
+ value.map{ |v| "#{v[1].to_s}/#{v[0]} #{v[2]}"}.join(",")
104
+ end
105
+
106
+ def change_to_s(currentvalue, newvalue)
107
+ currentvalue = value_to_s(currentvalue) if currentvalue != :absent
108
+ newvalue = value_to_s(newvalue)
109
+ super(currentvalue, newvalue)
110
+ end
111
+ end
112
+ end
@@ -0,0 +1,88 @@
1
+ # Plug-in type for handling k5login files
2
+ require 'puppet/util'
3
+
4
+ Puppet::Type.newtype(:k5login) do
5
+ @doc = "Manage the `.k5login` file for a user. Specify the full path to
6
+ the `.k5login` file as the name, and an array of principals as the
7
+ `principals` attribute."
8
+
9
+ ensurable
10
+
11
+ # Principals that should exist in the file
12
+ newproperty(:principals, :array_matching => :all) do
13
+ desc "The principals present in the `.k5login` file. This should be specified as an array."
14
+ end
15
+
16
+ # The path/name of the k5login file
17
+ newparam(:path) do
18
+ isnamevar
19
+ desc "The path to the `.k5login` file to manage. Must be fully qualified."
20
+
21
+ validate do |value|
22
+ unless absolute_path?(value)
23
+ raise Puppet::Error, "File paths must be fully qualified."
24
+ end
25
+ end
26
+ end
27
+
28
+ # To manage the mode of the file
29
+ newproperty(:mode) do
30
+ desc "The desired permissions mode of the `.k5login` file. Defaults to `644`."
31
+ defaultto { "644" }
32
+ end
33
+
34
+ provide(:k5login) do
35
+ desc "The k5login provider is the only provider for the k5login
36
+ type."
37
+
38
+ # Does this file exist?
39
+ def exists?
40
+ File.exists?(@resource[:name])
41
+ end
42
+
43
+ # create the file
44
+ def create
45
+ write(@resource.should(:principals))
46
+ should_mode = @resource.should(:mode)
47
+ unless self.mode == should_mode
48
+ self.mode = should_mode
49
+ end
50
+ end
51
+
52
+ # remove the file
53
+ def destroy
54
+ File.unlink(@resource[:name])
55
+ end
56
+
57
+ # Return the principals
58
+ def principals(dummy_argument=:work_arround_for_ruby_GC_bug)
59
+ if File.exists?(@resource[:name])
60
+ File.readlines(@resource[:name]).collect { |line| line.chomp }
61
+ else
62
+ :absent
63
+ end
64
+ end
65
+
66
+ # Write the principals out to the k5login file
67
+ def principals=(value)
68
+ write(value)
69
+ end
70
+
71
+ # Return the mode as an octal string, not as an integer
72
+ def mode
73
+ "%o" % (File.stat(@resource[:name]).mode & 007777)
74
+ end
75
+
76
+ # Set the file mode, converting from a string to an integer.
77
+ def mode=(value)
78
+ File.chmod(Integer("0#{value}"), @resource[:name])
79
+ end
80
+
81
+ private
82
+ def write(value)
83
+ Puppet::Util.replace_file(@resource[:name], 0644) do |f|
84
+ f.puts value
85
+ end
86
+ end
87
+ end
88
+ end