corl 0.4.29 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (230) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -3
  3. data/Gemfile.lock +16 -13
  4. data/VERSION +1 -1
  5. data/bin/corl +21 -1
  6. data/bootstrap/os/ubuntu/00_base.sh +2 -2
  7. data/bootstrap/os/ubuntu/06_puppet.sh +7 -12
  8. data/bootstrap/os/ubuntu/09_nucleon.sh +1 -1
  9. data/bootstrap/os/ubuntu/10_corl.sh +1 -4
  10. data/corl.gemspec +193 -40
  11. data/lib/CORL/builder/identity.rb +68 -0
  12. data/lib/CORL/builder/package.rb +75 -0
  13. data/lib/CORL/configuration/file.rb +5 -5
  14. data/lib/CORL/machine/{aws.rb → AWS.rb} +2 -2
  15. data/lib/CORL/machine/physical.rb +1 -1
  16. data/lib/CORL/machine/rackspace.rb +1 -1
  17. data/lib/CORL/machine/vagrant.rb +2 -2
  18. data/lib/CORL/network/{default.rb → CORL.rb} +1 -1
  19. data/lib/CORL/node/{aws.rb → AWS.rb} +1 -1
  20. data/lib/CORL/node/local.rb +1 -1
  21. data/lib/CORL/node/vagrant.rb +7 -2
  22. data/lib/CORL/provisioner/puppetnode.rb +139 -131
  23. data/lib/core/build.rb +112 -0
  24. data/lib/core/facade.rb +48 -8
  25. data/lib/core/mixin/builder.rb +158 -0
  26. data/lib/core/mixin/lookup.rb +51 -20
  27. data/lib/core/mixin/machine/ssh.rb +16 -4
  28. data/lib/core/plugin/builder.rb +49 -0
  29. data/lib/core/plugin/{action.rb → cloud_action.rb} +22 -16
  30. data/lib/core/plugin/configuration.rb +9 -3
  31. data/lib/core/plugin/fog_machine.rb +3 -3
  32. data/lib/core/plugin/fog_node.rb +1 -1
  33. data/lib/core/plugin/machine.rb +2 -2
  34. data/lib/core/plugin/network.rb +39 -10
  35. data/lib/core/plugin/node.rb +95 -35
  36. data/lib/core/plugin/provisioner.rb +133 -113
  37. data/lib/core/util/puppet/resource.rb +1 -1
  38. data/lib/core/vagrant/actions/delete_cache.rb +7 -1
  39. data/lib/core/vagrant/commands/launcher.rb +2 -2
  40. data/lib/core/vagrant/config.rb +29 -2
  41. data/lib/corl.rb +9 -8
  42. data/lib/facter/corl_config_ready.rb +1 -1
  43. data/lib/facter/vagrant_exists.rb +1 -1
  44. data/lib/nucleon/action/cloud/create.rb +51 -0
  45. data/lib/nucleon/action/cloud/hiera.rb +61 -0
  46. data/lib/{CORL/action → nucleon/action/cloud}/images.rb +11 -2
  47. data/lib/nucleon/action/cloud/inspect.rb +47 -0
  48. data/lib/{CORL/action → nucleon/action/cloud}/machines.rb +11 -2
  49. data/lib/{CORL/action → nucleon/action/cloud}/regions.rb +11 -2
  50. data/lib/{CORL/action → nucleon/action/cloud}/vagrantfile.rb +11 -2
  51. data/lib/{CORL/action/ip.rb → nucleon/action/node/IP.rb} +11 -2
  52. data/lib/{CORL/action/ssh.rb → nucleon/action/node/SSH.rb} +15 -7
  53. data/lib/{CORL/action → nucleon/action/node}/authorize.rb +11 -2
  54. data/lib/{CORL/action → nucleon/action/node}/bootstrap.rb +13 -4
  55. data/lib/nucleon/action/node/build.rb +49 -0
  56. data/lib/{CORL/action → nucleon/action/node}/destroy.rb +14 -5
  57. data/lib/{CORL/action → nucleon/action/node}/exec.rb +11 -2
  58. data/lib/{CORL/action → nucleon/action/node}/facts.rb +12 -3
  59. data/lib/{CORL/action → nucleon/action/node}/image.rb +13 -4
  60. data/lib/nucleon/action/node/keypair.rb +85 -0
  61. data/lib/{CORL/action → nucleon/action/node}/lookup.rb +13 -4
  62. data/lib/{CORL/action → nucleon/action/node}/provision.rb +30 -8
  63. data/lib/{CORL/action → nucleon/action/node}/reboot.rb +13 -4
  64. data/lib/{CORL/action → nucleon/action/node}/revoke.rb +11 -2
  65. data/lib/{CORL/action → nucleon/action/node}/seed.rb +13 -4
  66. data/lib/{CORL/action → nucleon/action/node}/spawn.rb +19 -9
  67. data/lib/{CORL/action → nucleon/action/node}/start.rb +13 -4
  68. data/lib/{CORL/action → nucleon/action/node}/stop.rb +13 -4
  69. data/lib/{CORL → nucleon}/event/puppet.rb +2 -2
  70. data/lib/{CORL → nucleon}/template/environment.rb +2 -2
  71. data/lib/puppet/indirector/corl.rb +7 -4
  72. data/lib/puppet/parser/functions/corl_resources.rb +1 -0
  73. data/lib/puppet/parser/functions/global_array.rb +2 -1
  74. data/lib/puppet/parser/functions/global_hash.rb +2 -1
  75. data/lib/puppet/parser/functions/global_param.rb +2 -1
  76. data/lib/puppet/parser/functions/module_array.rb +2 -1
  77. data/lib/puppet/parser/functions/module_hash.rb +3 -2
  78. data/lib/puppet/parser/functions/module_param.rb +3 -2
  79. data/lib/puppet/parser/functions/render.rb +1 -0
  80. data/locales/en.yml +80 -0
  81. data/rdoc/site/0.4.29/CORL/Action/Authorize.html +485 -0
  82. data/rdoc/site/0.4.29/CORL/Action/Bootstrap.html +546 -0
  83. data/rdoc/site/0.4.29/CORL/Action/Build.html +396 -0
  84. data/rdoc/site/0.4.29/CORL/Action/Destroy.html +515 -0
  85. data/rdoc/site/0.4.29/CORL/Action/Exec.html +472 -0
  86. data/rdoc/site/0.4.29/CORL/Action/Facts.html +398 -0
  87. data/rdoc/site/0.4.29/CORL/Action/Image.html +515 -0
  88. data/rdoc/site/0.4.29/CORL/Action/Images.html +514 -0
  89. data/rdoc/site/0.4.29/CORL/Action/Ip.html +395 -0
  90. data/rdoc/site/0.4.29/CORL/Action/Keypair.html +494 -0
  91. data/rdoc/site/0.4.29/CORL/Action/Lookup.html +474 -0
  92. data/rdoc/site/0.4.29/CORL/Action/Machines.html +509 -0
  93. data/rdoc/site/0.4.29/CORL/Action/Provision.html +456 -0
  94. data/rdoc/site/0.4.29/CORL/Action/Reboot.html +515 -0
  95. data/rdoc/site/0.4.29/CORL/Action/Regions.html +509 -0
  96. data/rdoc/site/0.4.29/CORL/Action/Revoke.html +483 -0
  97. data/rdoc/site/0.4.29/CORL/Action/Seed.html +544 -0
  98. data/rdoc/site/0.4.29/CORL/Action/Spawn.html +616 -0
  99. data/rdoc/site/0.4.29/CORL/Action/Ssh.html +526 -0
  100. data/rdoc/site/0.4.29/CORL/Action/Start.html +515 -0
  101. data/rdoc/site/0.4.29/CORL/Action/Stop.html +515 -0
  102. data/rdoc/site/0.4.29/CORL/Action/Vagrantfile.html +457 -0
  103. data/rdoc/site/0.4.29/CORL/Action.html +360 -0
  104. data/rdoc/site/0.4.29/CORL/Configuration/File.html +1128 -0
  105. data/rdoc/site/0.4.29/CORL/Configuration.html +339 -0
  106. data/rdoc/site/0.4.29/CORL/Errors.html +339 -0
  107. data/rdoc/site/0.4.29/CORL/Event/Puppet.html +673 -0
  108. data/rdoc/site/0.4.29/CORL/Event.html +339 -0
  109. data/rdoc/site/0.4.29/CORL/Facade.html +742 -0
  110. data/rdoc/site/0.4.29/CORL/Machine/Aws.html +733 -0
  111. data/rdoc/site/0.4.29/CORL/Machine/Fog.html +1269 -0
  112. data/rdoc/site/0.4.29/CORL/Machine/Physical.html +1039 -0
  113. data/rdoc/site/0.4.29/CORL/Machine/Rackspace.html +514 -0
  114. data/rdoc/site/0.4.29/CORL/Machine/Vagrant.html +1300 -0
  115. data/rdoc/site/0.4.29/CORL/Machine.html +343 -0
  116. data/rdoc/site/0.4.29/CORL/Mixin/Action/Keypair.html +572 -0
  117. data/rdoc/site/0.4.29/CORL/Mixin/Action.html +339 -0
  118. data/rdoc/site/0.4.29/CORL/Mixin/Lookup.html +954 -0
  119. data/rdoc/site/0.4.29/CORL/Mixin/Machine/SSH.html +643 -0
  120. data/rdoc/site/0.4.29/CORL/Mixin/Machine.html +339 -0
  121. data/rdoc/site/0.4.29/CORL/Mixin/Macro/NetworkSettings.html +464 -0
  122. data/rdoc/site/0.4.29/CORL/Mixin/Macro.html +339 -0
  123. data/rdoc/site/0.4.29/CORL/Mixin.html +342 -0
  124. data/rdoc/site/0.4.29/CORL/Network/Default.html +391 -0
  125. data/rdoc/site/0.4.29/CORL/Network.html +339 -0
  126. data/rdoc/site/0.4.29/CORL/Node/Aws.html +716 -0
  127. data/rdoc/site/0.4.29/CORL/Node/Fog.html +1192 -0
  128. data/rdoc/site/0.4.29/CORL/Node/Local.html +424 -0
  129. data/rdoc/site/0.4.29/CORL/Node/Rackspace.html +709 -0
  130. data/rdoc/site/0.4.29/CORL/Node/Vagrant.html +1451 -0
  131. data/rdoc/site/0.4.29/CORL/Node.html +343 -0
  132. data/rdoc/site/0.4.29/CORL/Plugin/CloudAction.html +810 -0
  133. data/rdoc/site/0.4.29/CORL/Plugin.html +339 -0
  134. data/rdoc/site/0.4.29/CORL/Provisioner/Puppetnode.html +1095 -0
  135. data/rdoc/site/0.4.29/CORL/Provisioner.html +339 -0
  136. data/rdoc/site/0.4.29/CORL/Template/Environment.html +528 -0
  137. data/rdoc/site/0.4.29/CORL/Template.html +339 -0
  138. data/rdoc/site/0.4.29/CORL/Util/Puppet/Resource.html +1038 -0
  139. data/rdoc/site/0.4.29/CORL/Util/Puppet/ResourceGroup.html +920 -0
  140. data/rdoc/site/0.4.29/CORL/Util/Puppet.html +1087 -0
  141. data/rdoc/site/0.4.29/CORL/Util.html +341 -0
  142. data/rdoc/site/0.4.29/CORL/Vagrant/Config.html +896 -0
  143. data/rdoc/site/0.4.29/CORL/Vagrant.html +418 -0
  144. data/rdoc/site/0.4.29/CORL.html +465 -0
  145. data/rdoc/site/0.4.29/Facter/Util/Loader.html +396 -0
  146. data/rdoc/site/0.4.29/Facter/Util.html +339 -0
  147. data/rdoc/site/0.4.29/Facter.html +339 -0
  148. data/rdoc/site/0.4.29/Fog/Compute/AWS/Server.html +423 -0
  149. data/rdoc/site/0.4.29/Fog/Compute/AWS.html +345 -0
  150. data/rdoc/site/0.4.29/Fog/Compute/RackspaceV2/Server.html +408 -0
  151. data/rdoc/site/0.4.29/Fog/Compute/RackspaceV2.html +345 -0
  152. data/rdoc/site/0.4.29/Fog/Compute.html +340 -0
  153. data/rdoc/site/0.4.29/Fog.html +340 -0
  154. data/rdoc/site/0.4.29/Hiera/Backend.html +422 -0
  155. data/rdoc/site/0.4.29/Hiera/Corl_logger.html +449 -0
  156. data/rdoc/site/0.4.29/Hiera.html +346 -0
  157. data/rdoc/site/0.4.29/Nucleon/Config.html +357 -0
  158. data/rdoc/site/0.4.29/Nucleon/Plugin/Base.html +345 -0
  159. data/rdoc/site/0.4.29/Nucleon/Plugin/Configuration.html +1213 -0
  160. data/rdoc/site/0.4.29/Nucleon/Plugin/Machine.html +1279 -0
  161. data/rdoc/site/0.4.29/Nucleon/Plugin/Network.html +1425 -0
  162. data/rdoc/site/0.4.29/Nucleon/Plugin/Node.html +3715 -0
  163. data/rdoc/site/0.4.29/Nucleon/Plugin/Provisioner.html +1297 -0
  164. data/rdoc/site/0.4.29/Nucleon/Plugin.html +344 -0
  165. data/rdoc/site/0.4.29/Nucleon.html +344 -0
  166. data/rdoc/site/0.4.29/Object.html +358 -0
  167. data/rdoc/site/0.4.29/Puppet/DataBinding/Corl.html +345 -0
  168. data/rdoc/site/0.4.29/Puppet/DataBinding.html +338 -0
  169. data/rdoc/site/0.4.29/Puppet/Indirector/Corl.html +454 -0
  170. data/rdoc/site/0.4.29/Puppet/Indirector.html +338 -0
  171. data/rdoc/site/0.4.29/Puppet/Parser/Functions.html +480 -0
  172. data/rdoc/site/0.4.29/Puppet/Parser.html +338 -0
  173. data/rdoc/site/0.4.29/Puppet.html +338 -0
  174. data/rdoc/site/0.4.29/README_rdoc.html +340 -0
  175. data/rdoc/site/0.4.29/Vagrant/Config/Loader.html +399 -0
  176. data/rdoc/site/0.4.29/Vagrant/Config.html +339 -0
  177. data/rdoc/site/0.4.29/Vagrant/Vagrantfile.html +392 -0
  178. data/rdoc/site/0.4.29/Vagrant.html +346 -0
  179. data/rdoc/site/0.4.29/VagrantPlugins/CORL/Action/DeleteCache.html +396 -0
  180. data/rdoc/site/0.4.29/VagrantPlugins/CORL/Action/InitKeys.html +408 -0
  181. data/rdoc/site/0.4.29/VagrantPlugins/CORL/Action/LinkNetwork.html +406 -0
  182. data/rdoc/site/0.4.29/VagrantPlugins/CORL/Action.html +341 -0
  183. data/rdoc/site/0.4.29/VagrantPlugins/CORL/BaseAction.html +491 -0
  184. data/rdoc/site/0.4.29/VagrantPlugins/CORL/Command/Launcher.html +533 -0
  185. data/rdoc/site/0.4.29/VagrantPlugins/CORL/Command.html +339 -0
  186. data/rdoc/site/0.4.29/VagrantPlugins/CORL/Config/CORL.html +732 -0
  187. data/rdoc/site/0.4.29/VagrantPlugins/CORL/Config.html +339 -0
  188. data/rdoc/site/0.4.29/VagrantPlugins/CORL/Plugin.html +345 -0
  189. data/rdoc/site/0.4.29/VagrantPlugins/CORL/Provisioner/CORL.html +536 -0
  190. data/rdoc/site/0.4.29/VagrantPlugins/CORL/Provisioner.html +339 -0
  191. data/rdoc/site/0.4.29/VagrantPlugins/CORL.html +346 -0
  192. data/rdoc/site/0.4.29/VagrantPlugins.html +346 -0
  193. data/rdoc/site/0.4.29/created.rid +96 -0
  194. data/rdoc/site/0.4.29/images/add.png +0 -0
  195. data/rdoc/site/0.4.29/images/brick.png +0 -0
  196. data/rdoc/site/0.4.29/images/brick_link.png +0 -0
  197. data/rdoc/site/0.4.29/images/bug.png +0 -0
  198. data/rdoc/site/0.4.29/images/bullet_black.png +0 -0
  199. data/rdoc/site/0.4.29/images/bullet_toggle_minus.png +0 -0
  200. data/rdoc/site/0.4.29/images/bullet_toggle_plus.png +0 -0
  201. data/rdoc/site/0.4.29/images/date.png +0 -0
  202. data/rdoc/site/0.4.29/images/delete.png +0 -0
  203. data/rdoc/site/0.4.29/images/find.png +0 -0
  204. data/rdoc/site/0.4.29/images/loadingAnimation.gif +0 -0
  205. data/rdoc/site/0.4.29/images/macFFBgHack.png +0 -0
  206. data/rdoc/site/0.4.29/images/package.png +0 -0
  207. data/rdoc/site/0.4.29/images/page_green.png +0 -0
  208. data/rdoc/site/0.4.29/images/page_white_text.png +0 -0
  209. data/rdoc/site/0.4.29/images/page_white_width.png +0 -0
  210. data/rdoc/site/0.4.29/images/plugin.png +0 -0
  211. data/rdoc/site/0.4.29/images/ruby.png +0 -0
  212. data/rdoc/site/0.4.29/images/tag_blue.png +0 -0
  213. data/rdoc/site/0.4.29/images/tag_green.png +0 -0
  214. data/rdoc/site/0.4.29/images/transparent.png +0 -0
  215. data/rdoc/site/0.4.29/images/wrench.png +0 -0
  216. data/rdoc/site/0.4.29/images/wrench_orange.png +0 -0
  217. data/rdoc/site/0.4.29/images/zoom.png +0 -0
  218. data/rdoc/site/0.4.29/index.html +339 -0
  219. data/rdoc/site/0.4.29/js/darkfish.js +155 -0
  220. data/rdoc/site/0.4.29/js/jquery.js +18 -0
  221. data/rdoc/site/0.4.29/js/navigation.js +142 -0
  222. data/rdoc/site/0.4.29/js/search.js +94 -0
  223. data/rdoc/site/0.4.29/js/search_index.js +1 -0
  224. data/rdoc/site/0.4.29/js/searcher.js +228 -0
  225. data/rdoc/site/0.4.29/rdoc.css +543 -0
  226. data/rdoc/site/0.4.29/table_of_contents.html +1561 -0
  227. metadata +192 -45
  228. data/lib/CORL/action/build.rb +0 -22
  229. data/lib/CORL/action/keypair.rb +0 -56
  230. data/lib/core/mod/facter_loader.rb +0 -15
@@ -0,0 +1,1087 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
6
+
7
+ <title>module CORL::Util::Puppet - corl 0.4.29</title>
8
+
9
+ <link type="text/css" media="screen" href="../../rdoc.css" rel="stylesheet">
10
+
11
+ <script type="text/javascript">
12
+ var rdoc_rel_prefix = "../../";
13
+ </script>
14
+
15
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
16
+ <script type="text/javascript" charset="utf-8" src="../../js/navigation.js"></script>
17
+ <script type="text/javascript" charset="utf-8" src="../../js/search_index.js"></script>
18
+ <script type="text/javascript" charset="utf-8" src="../../js/search.js"></script>
19
+ <script type="text/javascript" charset="utf-8" src="../../js/searcher.js"></script>
20
+ <script type="text/javascript" charset="utf-8" src="../../js/darkfish.js"></script>
21
+
22
+
23
+ <body id="top" class="module">
24
+ <nav id="metadata">
25
+ <nav id="home-section" class="section">
26
+ <h3 class="section-header">
27
+ <a href="../../index.html">Home</a>
28
+ <a href="../../table_of_contents.html#classes">Classes</a>
29
+ <a href="../../table_of_contents.html#methods">Methods</a>
30
+ </h3>
31
+ </nav>
32
+
33
+
34
+ <nav id="search-section" class="section project-section" class="initially-hidden">
35
+ <form action="#" method="get" accept-charset="utf-8">
36
+ <h3 class="section-header">
37
+ <input type="text" name="search" placeholder="Search" id="search-field"
38
+ title="Type to search, Up and Down to navigate, Enter to load">
39
+ </h3>
40
+ </form>
41
+
42
+ <ul id="search-results" class="initially-hidden"></ul>
43
+ </nav>
44
+
45
+
46
+ <div id="file-metadata">
47
+ <nav id="file-list-section" class="section">
48
+ <h3 class="section-header">Defined In</h3>
49
+ <ul>
50
+ <li>lib/core/util/puppet.rb
51
+ <li>lib/core/util/puppet/resource.rb
52
+ <li>lib/core/util/puppet/resource_group.rb
53
+ </ul>
54
+ </nav>
55
+
56
+
57
+ </div>
58
+
59
+ <div id="class-metadata">
60
+
61
+
62
+
63
+ <!-- Method Quickref -->
64
+ <nav id="method-list-section" class="section">
65
+ <h3 class="section-header">Methods</h3>
66
+
67
+ <ul class="link-list">
68
+
69
+ <li><a href="#method-c-add">::add</a>
70
+
71
+ <li><a href="#method-c-add_class">::add_class</a>
72
+
73
+ <li><a href="#method-c-add_definition">::add_definition</a>
74
+
75
+ <li><a href="#method-c-add_resource">::add_resource</a>
76
+
77
+ <li><a href="#method-c-debug_resource">::debug_resource</a>
78
+
79
+ <li><a href="#method-c-each_module">::each_module</a>
80
+
81
+ <li><a href="#method-c-import">::import</a>
82
+
83
+ <li><a href="#method-c-include">::include</a>
84
+
85
+ <li><a href="#method-c-logger">::logger</a>
86
+
87
+ <li><a href="#method-c-lookup">::lookup</a>
88
+
89
+ <li><a href="#method-c-namevar">::namevar</a>
90
+
91
+ <li><a href="#method-c-register_plugins">::register_plugins</a>
92
+
93
+ <li><a href="#method-c-to_name">::to_name</a>
94
+
95
+ <li><a href="#method-c-type_info">::type_info</a>
96
+
97
+ <li><a href="#method-c-type_name">::type_name</a>
98
+
99
+ </ul>
100
+ </nav>
101
+
102
+ </div>
103
+
104
+ <div id="project-metadata">
105
+ <nav id="fileindex-section" class="section project-section">
106
+ <h3 class="section-header">Pages</h3>
107
+
108
+ <ul>
109
+
110
+ <li class="file"><a href="../../README_rdoc.html">README</a>
111
+
112
+ </ul>
113
+ </nav>
114
+
115
+ <nav id="classindex-section" class="section project-section">
116
+ <h3 class="section-header">Class and Module Index</h3>
117
+
118
+ <ul class="link-list">
119
+
120
+ <li><a href="../../CORL.html">CORL</a>
121
+
122
+ <li><a href="../../CORL/Action.html">CORL::Action</a>
123
+
124
+ <li><a href="../../CORL/Action/Authorize.html">CORL::Action::Authorize</a>
125
+
126
+ <li><a href="../../CORL/Action/Bootstrap.html">CORL::Action::Bootstrap</a>
127
+
128
+ <li><a href="../../CORL/Action/Build.html">CORL::Action::Build</a>
129
+
130
+ <li><a href="../../CORL/Action/Destroy.html">CORL::Action::Destroy</a>
131
+
132
+ <li><a href="../../CORL/Action/Exec.html">CORL::Action::Exec</a>
133
+
134
+ <li><a href="../../CORL/Action/Facts.html">CORL::Action::Facts</a>
135
+
136
+ <li><a href="../../CORL/Action/Image.html">CORL::Action::Image</a>
137
+
138
+ <li><a href="../../CORL/Action/Images.html">CORL::Action::Images</a>
139
+
140
+ <li><a href="../../CORL/Action/Ip.html">CORL::Action::Ip</a>
141
+
142
+ <li><a href="../../CORL/Action/Keypair.html">CORL::Action::Keypair</a>
143
+
144
+ <li><a href="../../CORL/Action/Lookup.html">CORL::Action::Lookup</a>
145
+
146
+ <li><a href="../../CORL/Action/Machines.html">CORL::Action::Machines</a>
147
+
148
+ <li><a href="../../CORL/Action/Provision.html">CORL::Action::Provision</a>
149
+
150
+ <li><a href="../../CORL/Action/Reboot.html">CORL::Action::Reboot</a>
151
+
152
+ <li><a href="../../CORL/Action/Regions.html">CORL::Action::Regions</a>
153
+
154
+ <li><a href="../../CORL/Action/Revoke.html">CORL::Action::Revoke</a>
155
+
156
+ <li><a href="../../CORL/Action/Seed.html">CORL::Action::Seed</a>
157
+
158
+ <li><a href="../../CORL/Action/Spawn.html">CORL::Action::Spawn</a>
159
+
160
+ <li><a href="../../CORL/Action/Ssh.html">CORL::Action::Ssh</a>
161
+
162
+ <li><a href="../../CORL/Action/Start.html">CORL::Action::Start</a>
163
+
164
+ <li><a href="../../CORL/Action/Stop.html">CORL::Action::Stop</a>
165
+
166
+ <li><a href="../../CORL/Action/Vagrantfile.html">CORL::Action::Vagrantfile</a>
167
+
168
+ <li><a href="../../CORL/Configuration.html">CORL::Configuration</a>
169
+
170
+ <li><a href="../../CORL/Configuration/File.html">CORL::Configuration::File</a>
171
+
172
+ <li><a href="../../CORL/Errors.html">CORL::Errors</a>
173
+
174
+ <li><a href="../../CORL/Event.html">CORL::Event</a>
175
+
176
+ <li><a href="../../CORL/Event/Puppet.html">CORL::Event::Puppet</a>
177
+
178
+ <li><a href="../../CORL/Facade.html">CORL::Facade</a>
179
+
180
+ <li><a href="../../CORL/Machine.html">CORL::Machine</a>
181
+
182
+ <li><a href="../../CORL/Machine/Aws.html">CORL::Machine::Aws</a>
183
+
184
+ <li><a href="../../CORL/Machine/Fog.html">CORL::Machine::Fog</a>
185
+
186
+ <li><a href="../../CORL/Machine/Physical.html">CORL::Machine::Physical</a>
187
+
188
+ <li><a href="../../CORL/Machine/Rackspace.html">CORL::Machine::Rackspace</a>
189
+
190
+ <li><a href="../../CORL/Machine/Vagrant.html">CORL::Machine::Vagrant</a>
191
+
192
+ <li><a href="../../CORL/Mixin.html">CORL::Mixin</a>
193
+
194
+ <li><a href="../../CORL/Mixin/Action.html">CORL::Mixin::Action</a>
195
+
196
+ <li><a href="../../CORL/Mixin/Action/Keypair.html">CORL::Mixin::Action::Keypair</a>
197
+
198
+ <li><a href="../../CORL/Mixin/Lookup.html">CORL::Mixin::Lookup</a>
199
+
200
+ <li><a href="../../CORL/Mixin/Machine.html">CORL::Mixin::Machine</a>
201
+
202
+ <li><a href="../../CORL/Mixin/Machine/SSH.html">CORL::Mixin::Machine::SSH</a>
203
+
204
+ <li><a href="../../CORL/Mixin/Macro.html">CORL::Mixin::Macro</a>
205
+
206
+ <li><a href="../../CORL/Mixin/Macro/NetworkSettings.html">CORL::Mixin::Macro::NetworkSettings</a>
207
+
208
+ <li><a href="../../CORL/Network.html">CORL::Network</a>
209
+
210
+ <li><a href="../../CORL/Network/Default.html">CORL::Network::Default</a>
211
+
212
+ <li><a href="../../CORL/Node.html">CORL::Node</a>
213
+
214
+ <li><a href="../../CORL/Node/Aws.html">CORL::Node::Aws</a>
215
+
216
+ <li><a href="../../CORL/Node/Fog.html">CORL::Node::Fog</a>
217
+
218
+ <li><a href="../../CORL/Node/Local.html">CORL::Node::Local</a>
219
+
220
+ <li><a href="../../CORL/Node/Rackspace.html">CORL::Node::Rackspace</a>
221
+
222
+ <li><a href="../../CORL/Node/Vagrant.html">CORL::Node::Vagrant</a>
223
+
224
+ <li><a href="../../CORL/Plugin.html">CORL::Plugin</a>
225
+
226
+ <li><a href="../../CORL/Plugin/CloudAction.html">CORL::Plugin::CloudAction</a>
227
+
228
+ <li><a href="../../CORL/Provisioner.html">CORL::Provisioner</a>
229
+
230
+ <li><a href="../../CORL/Provisioner/Puppetnode.html">CORL::Provisioner::Puppetnode</a>
231
+
232
+ <li><a href="../../CORL/Template.html">CORL::Template</a>
233
+
234
+ <li><a href="../../CORL/Template/Environment.html">CORL::Template::Environment</a>
235
+
236
+ <li><a href="../../CORL/Util.html">CORL::Util</a>
237
+
238
+ <li><a href="../../CORL/Util/Puppet.html">CORL::Util::Puppet</a>
239
+
240
+ <li><a href="../../CORL/Util/Puppet/Resource.html">CORL::Util::Puppet::Resource</a>
241
+
242
+ <li><a href="../../CORL/Util/Puppet/ResourceGroup.html">CORL::Util::Puppet::ResourceGroup</a>
243
+
244
+ <li><a href="../../CORL/Vagrant.html">CORL::Vagrant</a>
245
+
246
+ <li><a href="../../CORL/Vagrant/Config.html">CORL::Vagrant::Config</a>
247
+
248
+ <li><a href="../../VagrantPlugins.html">VagrantPlugins</a>
249
+
250
+ <li><a href="../../VagrantPlugins/CORL.html">VagrantPlugins::CORL</a>
251
+
252
+ <li><a href="../../VagrantPlugins/CORL/Action.html">VagrantPlugins::CORL::Action</a>
253
+
254
+ <li><a href="../../VagrantPlugins/CORL/Action/DeleteCache.html">VagrantPlugins::CORL::Action::DeleteCache</a>
255
+
256
+ <li><a href="../../VagrantPlugins/CORL/Action/InitKeys.html">VagrantPlugins::CORL::Action::InitKeys</a>
257
+
258
+ <li><a href="../../VagrantPlugins/CORL/Action/LinkNetwork.html">VagrantPlugins::CORL::Action::LinkNetwork</a>
259
+
260
+ <li><a href="../../VagrantPlugins/CORL/BaseAction.html">VagrantPlugins::CORL::BaseAction</a>
261
+
262
+ <li><a href="../../VagrantPlugins/CORL/Command.html">VagrantPlugins::CORL::Command</a>
263
+
264
+ <li><a href="../../VagrantPlugins/CORL/Command/Launcher.html">VagrantPlugins::CORL::Command::Launcher</a>
265
+
266
+ <li><a href="../../VagrantPlugins/CORL/Config.html">VagrantPlugins::CORL::Config</a>
267
+
268
+ <li><a href="../../VagrantPlugins/CORL/Config/CORL.html">VagrantPlugins::CORL::Config::CORL</a>
269
+
270
+ <li><a href="../../VagrantPlugins/CORL/Plugin.html">VagrantPlugins::CORL::Plugin</a>
271
+
272
+ <li><a href="../../VagrantPlugins/CORL/Provisioner.html">VagrantPlugins::CORL::Provisioner</a>
273
+
274
+ <li><a href="../../VagrantPlugins/CORL/Provisioner/CORL.html">VagrantPlugins::CORL::Provisioner::CORL</a>
275
+
276
+ <li><a href="../../Nucleon.html">Nucleon</a>
277
+
278
+ <li><a href="../../Nucleon/Config.html">Nucleon::Config</a>
279
+
280
+ <li><a href="../../Nucleon/Plugin.html">Nucleon::Plugin</a>
281
+
282
+ <li><a href="../../Nucleon/Plugin/Base.html">Nucleon::Plugin::Base</a>
283
+
284
+ <li><a href="../../Nucleon/Plugin/Configuration.html">Nucleon::Plugin::Configuration</a>
285
+
286
+ <li><a href="../../Nucleon/Plugin/Machine.html">Nucleon::Plugin::Machine</a>
287
+
288
+ <li><a href="../../Nucleon/Plugin/Network.html">Nucleon::Plugin::Network</a>
289
+
290
+ <li><a href="../../Nucleon/Plugin/Node.html">Nucleon::Plugin::Node</a>
291
+
292
+ <li><a href="../../Nucleon/Plugin/Provisioner.html">Nucleon::Plugin::Provisioner</a>
293
+
294
+ <li><a href="../../Puppet.html">Puppet</a>
295
+
296
+ <li><a href="../../Puppet/DataBinding.html">Puppet::DataBinding</a>
297
+
298
+ <li><a href="../../Puppet/DataBinding/Corl.html">Puppet::DataBinding::Corl</a>
299
+
300
+ <li><a href="../../Puppet/Indirector.html">Puppet::Indirector</a>
301
+
302
+ <li><a href="../../Puppet/Indirector/Corl.html">Puppet::Indirector::Corl</a>
303
+
304
+ <li><a href="../../Puppet/Parser.html">Puppet::Parser</a>
305
+
306
+ <li><a href="../../Puppet/Parser/Functions.html">Puppet::Parser::Functions</a>
307
+
308
+ <li><a href="../../Fog.html">Fog</a>
309
+
310
+ <li><a href="../../Fog/Compute.html">Fog::Compute</a>
311
+
312
+ <li><a href="../../Fog/Compute/AWS.html">Fog::Compute::AWS</a>
313
+
314
+ <li><a href="../../Fog/Compute/AWS/Server.html">Fog::Compute::AWS::Server</a>
315
+
316
+ <li><a href="../../Fog/Compute/RackspaceV2.html">Fog::Compute::RackspaceV2</a>
317
+
318
+ <li><a href="../../Fog/Compute/RackspaceV2/Server.html">Fog::Compute::RackspaceV2::Server</a>
319
+
320
+ <li><a href="../../Vagrant.html">Vagrant</a>
321
+
322
+ <li><a href="../../Vagrant/Config.html">Vagrant::Config</a>
323
+
324
+ <li><a href="../../Vagrant/Config/Loader.html">Vagrant::Config::Loader</a>
325
+
326
+ <li><a href="../../Vagrant/Vagrantfile.html">Vagrant::Vagrantfile</a>
327
+
328
+ <li><a href="../../Facter.html">Facter</a>
329
+
330
+ <li><a href="../../Facter/Util.html">Facter::Util</a>
331
+
332
+ <li><a href="../../Facter/Util/Loader.html">Facter::Util::Loader</a>
333
+
334
+ <li><a href="../../Hiera.html">Hiera</a>
335
+
336
+ <li><a href="../../Hiera/Backend.html">Hiera::Backend</a>
337
+
338
+ <li><a href="../../Hiera/Corl_logger.html">Hiera::Corl_logger</a>
339
+
340
+ <li><a href="../../Object.html">Object</a>
341
+
342
+ </ul>
343
+ </nav>
344
+
345
+ </div>
346
+ </nav>
347
+
348
+ <div id="documentation">
349
+ <h1 class="module">module CORL::Util::Puppet</h1>
350
+
351
+ <div id="description" class="description">
352
+
353
+ </div><!-- description -->
354
+
355
+
356
+
357
+
358
+ <section id="5Buntitled-5D" class="documentation-section">
359
+
360
+
361
+
362
+
363
+
364
+
365
+
366
+
367
+ <!-- Methods -->
368
+
369
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section section">
370
+ <h3 class="section-header">Public Class Methods</h3>
371
+
372
+
373
+ <div id="method-c-add" class="method-detail ">
374
+
375
+ <div class="method-heading">
376
+ <span class="method-name">add</span><span
377
+ class="method-args">(type_name, resources, defaults = {}, options = {})</span>
378
+ <span class="method-click-advice">click to toggle source</span>
379
+ </div>
380
+
381
+
382
+ <div class="method-description">
383
+
384
+
385
+
386
+
387
+
388
+ <div class="method-source-code" id="add-source">
389
+ <pre><span class="ruby-comment"># File lib/core/util/puppet.rb, line 88</span>
390
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">add</span>(<span class="ruby-identifier">type_name</span>, <span class="ruby-identifier">resources</span>, <span class="ruby-identifier">defaults</span> = {}, <span class="ruby-identifier">options</span> = {})
391
+ <span class="ruby-identifier">config</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">ensure</span>(<span class="ruby-identifier">options</span>)
392
+
393
+ <span class="ruby-identifier">puppet_scope</span> = <span class="ruby-identifier">config</span>.<span class="ruby-identifier">get</span>(<span class="ruby-value">:puppet_scope</span>, <span class="ruby-keyword">nil</span>)
394
+ <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">puppet_scope</span>
395
+
396
+ <span class="ruby-identifier">info</span> = <span class="ruby-identifier">type_info</span>(<span class="ruby-identifier">type_name</span>, <span class="ruby-identifier">options</span>)
397
+
398
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">config</span>.<span class="ruby-identifier">get</span>(<span class="ruby-value">:debug</span>, <span class="ruby-keyword">false</span>)
399
+ <span class="ruby-constant">CORL</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">info</span>(<span class="ruby-string">&quot;\n&quot;</span>, { <span class="ruby-value">:prefix</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword">false</span> })
400
+ <span class="ruby-constant">CORL</span>.<span class="ruby-identifier">ui_group</span>(<span class="ruby-constant">Util</span><span class="ruby-operator">::</span><span class="ruby-constant">Console</span>.<span class="ruby-identifier">purple</span>(<span class="ruby-identifier">info</span>[<span class="ruby-value">:name</span>])) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ui</span><span class="ruby-operator">|</span>
401
+ <span class="ruby-identifier">ui</span>.<span class="ruby-identifier">info</span>(<span class="ruby-string">&quot;-----------------------------------------------------&quot;</span>)
402
+ <span class="ruby-keyword">end</span>
403
+ <span class="ruby-keyword">end</span>
404
+ <span class="ruby-constant">ResourceGroup</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">info</span>, <span class="ruby-identifier">defaults</span>).<span class="ruby-identifier">add</span>(<span class="ruby-identifier">resources</span>, <span class="ruby-identifier">config</span>)
405
+ <span class="ruby-keyword">end</span></pre>
406
+ </div><!-- add-source -->
407
+
408
+ </div>
409
+
410
+
411
+
412
+
413
+ </div><!-- add-method -->
414
+
415
+
416
+ <div id="method-c-add_class" class="method-detail ">
417
+
418
+ <div class="method-heading">
419
+ <span class="method-name">add_class</span><span
420
+ class="method-args">(title, properties, options = {})</span>
421
+ <span class="method-click-advice">click to toggle source</span>
422
+ </div>
423
+
424
+
425
+ <div class="method-description">
426
+
427
+
428
+
429
+
430
+
431
+ <div class="method-source-code" id="add_class-source">
432
+ <pre><span class="ruby-comment"># File lib/core/util/puppet.rb, line 139</span>
433
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">add_class</span>(<span class="ruby-identifier">title</span>, <span class="ruby-identifier">properties</span>, <span class="ruby-identifier">options</span> = {})
434
+ <span class="ruby-identifier">config</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">ensure</span>(<span class="ruby-identifier">options</span>)
435
+ <span class="ruby-identifier">puppet_scope</span> = <span class="ruby-identifier">config</span>.<span class="ruby-identifier">get</span>(<span class="ruby-value">:puppet_scope</span>, <span class="ruby-keyword">nil</span>)
436
+
437
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">puppet_scope</span>
438
+ <span class="ruby-identifier">klass</span> = <span class="ruby-identifier">puppet_scope</span>.<span class="ruby-identifier">find_hostclass</span>(<span class="ruby-identifier">title</span>)
439
+ <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">klass</span>
440
+
441
+ <span class="ruby-identifier">debug_resource</span>(<span class="ruby-identifier">config</span>, <span class="ruby-identifier">title</span>, <span class="ruby-identifier">properties</span>)
442
+ <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">ensure_in_catalog</span>(<span class="ruby-identifier">puppet_scope</span>, <span class="ruby-identifier">properties</span>)
443
+ <span class="ruby-identifier">puppet_scope</span>.<span class="ruby-identifier">catalog</span>.<span class="ruby-identifier">add_class</span>(<span class="ruby-identifier">title</span>)
444
+ <span class="ruby-keyword">end</span>
445
+ <span class="ruby-keyword">end</span></pre>
446
+ </div><!-- add_class-source -->
447
+
448
+ </div>
449
+
450
+
451
+
452
+
453
+ </div><!-- add_class-method -->
454
+
455
+
456
+ <div id="method-c-add_definition" class="method-detail ">
457
+
458
+ <div class="method-heading">
459
+ <span class="method-name">add_definition</span><span
460
+ class="method-args">(type, title, properties, options = {})</span>
461
+ <span class="method-click-advice">click to toggle source</span>
462
+ </div>
463
+
464
+
465
+ <div class="method-description">
466
+
467
+
468
+
469
+
470
+
471
+ <div class="method-source-code" id="add_definition-source">
472
+ <pre><span class="ruby-comment"># File lib/core/util/puppet.rb, line 155</span>
473
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">add_definition</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">title</span>, <span class="ruby-identifier">properties</span>, <span class="ruby-identifier">options</span> = {})
474
+ <span class="ruby-identifier">config</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">ensure</span>(<span class="ruby-identifier">options</span>)
475
+
476
+ <span class="ruby-identifier">puppet_scope</span> = <span class="ruby-identifier">config</span>.<span class="ruby-identifier">get</span>(<span class="ruby-value">:puppet_scope</span>, <span class="ruby-keyword">nil</span>)
477
+ <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">puppet_scope</span>
478
+
479
+ <span class="ruby-identifier">type</span> = <span class="ruby-identifier">type_info</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">config</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">type</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
480
+
481
+ <span class="ruby-identifier">resource</span> = <span class="ruby-operator">::</span><span class="ruby-constant">Puppet</span><span class="ruby-operator">::</span><span class="ruby-constant">Parser</span><span class="ruby-operator">::</span><span class="ruby-constant">Resource</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">type</span>[<span class="ruby-value">:name</span>], <span class="ruby-identifier">title</span>, <span class="ruby-value">:scope</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">puppet_scope</span>, <span class="ruby-value">:source</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">type</span>[<span class="ruby-value">:resource</span>])
482
+ <span class="ruby-identifier">resource</span>.<span class="ruby-identifier">virtual</span> = <span class="ruby-identifier">type</span>[<span class="ruby-value">:virtual</span>]
483
+ <span class="ruby-identifier">resource</span>.<span class="ruby-identifier">exported</span> = <span class="ruby-identifier">type</span>[<span class="ruby-value">:exported</span>]
484
+
485
+ <span class="ruby-identifier">namevar</span> = <span class="ruby-identifier">namevar</span>(<span class="ruby-identifier">type</span>[<span class="ruby-value">:name</span>], <span class="ruby-identifier">title</span>).<span class="ruby-identifier">to_sym</span>
486
+ <span class="ruby-identifier">resource_name</span> = <span class="ruby-identifier">properties</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">namevar</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">namevar</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">title</span>
487
+ <span class="ruby-identifier">properties</span> = { <span class="ruby-value">:name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">resource_name</span> }.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">properties</span>)
488
+
489
+ <span class="ruby-identifier">properties</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
490
+ <span class="ruby-identifier">resource</span>.<span class="ruby-identifier">set_parameter</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>)
491
+ <span class="ruby-keyword">end</span>
492
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">type</span>[<span class="ruby-value">:type</span>] <span class="ruby-operator">==</span> <span class="ruby-value">:define</span>
493
+ <span class="ruby-identifier">type</span>[<span class="ruby-value">:resource</span>].<span class="ruby-identifier">instantiate_resource</span>(<span class="ruby-identifier">puppet_scope</span>, <span class="ruby-identifier">resource</span>)
494
+ <span class="ruby-keyword">end</span>
495
+
496
+ <span class="ruby-identifier">debug_resource</span>(<span class="ruby-identifier">config</span>, <span class="ruby-identifier">title</span>, <span class="ruby-identifier">properties</span>)
497
+ <span class="ruby-identifier">puppet_scope</span>.<span class="ruby-identifier">compiler</span>.<span class="ruby-identifier">add_resource</span>(<span class="ruby-identifier">puppet_scope</span>, <span class="ruby-identifier">resource</span>)
498
+ <span class="ruby-keyword">end</span></pre>
499
+ </div><!-- add_definition-source -->
500
+
501
+ </div>
502
+
503
+
504
+
505
+
506
+ </div><!-- add_definition-method -->
507
+
508
+
509
+ <div id="method-c-add_resource" class="method-detail ">
510
+
511
+ <div class="method-heading">
512
+ <span class="method-name">add_resource</span><span
513
+ class="method-args">(type, title, properties, options = {})</span>
514
+ <span class="method-click-advice">click to toggle source</span>
515
+ </div>
516
+
517
+
518
+ <div class="method-description">
519
+
520
+
521
+
522
+
523
+
524
+ <div class="method-source-code" id="add_resource-source">
525
+ <pre><span class="ruby-comment"># File lib/core/util/puppet.rb, line 107</span>
526
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">add_resource</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">title</span>, <span class="ruby-identifier">properties</span>, <span class="ruby-identifier">options</span> = {})
527
+ <span class="ruby-identifier">config</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">ensure</span>(<span class="ruby-identifier">options</span>)
528
+
529
+ <span class="ruby-identifier">puppet_scope</span> = <span class="ruby-identifier">config</span>.<span class="ruby-identifier">get</span>(<span class="ruby-value">:puppet_scope</span>, <span class="ruby-keyword">nil</span>)
530
+ <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">puppet_scope</span>
531
+
532
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">type</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
533
+ <span class="ruby-identifier">type</span> = <span class="ruby-identifier">type_info</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">config</span>)
534
+ <span class="ruby-keyword">end</span>
535
+
536
+ <span class="ruby-identifier">display_name</span> = <span class="ruby-identifier">puppet_scope</span>.<span class="ruby-identifier">parent_module_name</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">puppet_scope</span>.<span class="ruby-identifier">parent_module_name</span> <span class="ruby-operator">:</span> <span class="ruby-string">&#39;toplevel&#39;</span>
537
+
538
+ <span class="ruby-keyword">case</span> <span class="ruby-identifier">type</span>[<span class="ruby-value">:type</span>]
539
+ <span class="ruby-keyword">when</span> <span class="ruby-value">:type</span>, <span class="ruby-value">:define</span>
540
+ <span class="ruby-constant">CORL</span>.<span class="ruby-identifier">ui_group</span>(<span class="ruby-constant">Util</span><span class="ruby-operator">::</span><span class="ruby-constant">Console</span>.<span class="ruby-identifier">cyan</span>(<span class="ruby-identifier">display_name</span>)) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ui</span><span class="ruby-operator">|</span>
541
+ <span class="ruby-identifier">rendered_title</span> = <span class="ruby-constant">Util</span><span class="ruby-operator">::</span><span class="ruby-constant">Console</span>.<span class="ruby-identifier">blue</span>(<span class="ruby-identifier">title</span>)
542
+ <span class="ruby-identifier">rendered_resource</span> = <span class="ruby-constant">Util</span><span class="ruby-operator">::</span><span class="ruby-constant">Console</span>.<span class="ruby-identifier">green</span>(<span class="ruby-node">&quot;#{type_name(type[:name])}[#{rendered_title}]&quot;</span>)
543
+ <span class="ruby-identifier">ui</span>.<span class="ruby-identifier">info</span>(<span class="ruby-node">&quot;Adding #{rendered_resource}&quot;</span>)
544
+ <span class="ruby-keyword">end</span>
545
+ <span class="ruby-identifier">add_definition</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">title</span>, <span class="ruby-identifier">properties</span>, <span class="ruby-identifier">config</span>)
546
+ <span class="ruby-keyword">when</span> <span class="ruby-value">:class</span>
547
+ <span class="ruby-constant">CORL</span>.<span class="ruby-identifier">ui_group</span>(<span class="ruby-constant">Util</span><span class="ruby-operator">::</span><span class="ruby-constant">Console</span>.<span class="ruby-identifier">cyan</span>(<span class="ruby-identifier">display_name</span>)) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ui</span><span class="ruby-operator">|</span>
548
+ <span class="ruby-identifier">rendered_title</span> = <span class="ruby-constant">Util</span><span class="ruby-operator">::</span><span class="ruby-constant">Console</span>.<span class="ruby-identifier">blue</span>(<span class="ruby-identifier">title</span>)
549
+ <span class="ruby-identifier">rendered_resource</span> = <span class="ruby-constant">Util</span><span class="ruby-operator">::</span><span class="ruby-constant">Console</span>.<span class="ruby-identifier">green</span>(<span class="ruby-node">&quot;Class[#{rendered_title}]&quot;</span>)
550
+ <span class="ruby-identifier">ui</span>.<span class="ruby-identifier">info</span>(<span class="ruby-node">&quot;Adding #{rendered_resource}&quot;</span>)
551
+ <span class="ruby-keyword">end</span>
552
+ <span class="ruby-identifier">add_class</span>(<span class="ruby-identifier">title</span>, <span class="ruby-identifier">properties</span>, <span class="ruby-identifier">config</span>)
553
+ <span class="ruby-keyword">end</span>
554
+ <span class="ruby-keyword">end</span></pre>
555
+ </div><!-- add_resource-source -->
556
+
557
+ </div>
558
+
559
+
560
+
561
+
562
+ </div><!-- add_resource-method -->
563
+
564
+
565
+ <div id="method-c-debug_resource" class="method-detail ">
566
+
567
+ <div class="method-heading">
568
+ <span class="method-name">debug_resource</span><span
569
+ class="method-args">(config, title, properties)</span>
570
+ <span class="method-click-advice">click to toggle source</span>
571
+ </div>
572
+
573
+
574
+ <div class="method-description">
575
+
576
+
577
+
578
+
579
+
580
+ <div class="method-source-code" id="debug_resource-source">
581
+ <pre><span class="ruby-comment"># File lib/core/util/puppet.rb, line 344</span>
582
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">debug_resource</span>(<span class="ruby-identifier">config</span>, <span class="ruby-identifier">title</span>, <span class="ruby-identifier">properties</span>)
583
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">config</span>.<span class="ruby-identifier">get</span>(<span class="ruby-value">:debug</span>, <span class="ruby-keyword">false</span>)
584
+ <span class="ruby-constant">CORL</span>.<span class="ruby-identifier">ui_group</span>(<span class="ruby-constant">Util</span><span class="ruby-operator">::</span><span class="ruby-constant">Console</span>.<span class="ruby-identifier">cyan</span>(<span class="ruby-identifier">title</span>.<span class="ruby-identifier">to_s</span>)) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ui</span><span class="ruby-operator">|</span>
585
+ <span class="ruby-identifier">dump</span> = <span class="ruby-constant">Util</span><span class="ruby-operator">::</span><span class="ruby-constant">Console</span>.<span class="ruby-identifier">green</span>(<span class="ruby-constant">Util</span><span class="ruby-operator">::</span><span class="ruby-constant">Data</span>.<span class="ruby-identifier">to_json</span>(<span class="ruby-identifier">properties</span>, <span class="ruby-keyword">true</span>))
586
+
587
+ <span class="ruby-identifier">ui</span>.<span class="ruby-identifier">info</span>(<span class="ruby-node">&quot;:\n#{dump}&quot;</span>)
588
+ <span class="ruby-identifier">ui</span>.<span class="ruby-identifier">info</span>(<span class="ruby-string">&quot;\n&quot;</span>, { <span class="ruby-value">:prefix</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword">false</span> })
589
+ <span class="ruby-keyword">end</span>
590
+ <span class="ruby-keyword">end</span>
591
+ <span class="ruby-keyword">end</span></pre>
592
+ </div><!-- debug_resource-source -->
593
+
594
+ </div>
595
+
596
+
597
+
598
+
599
+ </div><!-- debug_resource-method -->
600
+
601
+
602
+ <div id="method-c-each_module" class="method-detail ">
603
+
604
+ <div class="method-heading">
605
+ <span class="method-name">each_module</span><span
606
+ class="method-args">(options = {}, &code)</span>
607
+ <span class="method-click-advice">click to toggle source</span>
608
+ </div>
609
+
610
+
611
+ <div class="method-description">
612
+
613
+
614
+
615
+
616
+
617
+ <div class="method-source-code" id="each_module-source">
618
+ <pre><span class="ruby-comment"># File lib/core/util/puppet.rb, line 303</span>
619
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">each_module</span>(<span class="ruby-identifier">options</span> = {}, &amp;<span class="ruby-identifier">code</span>)
620
+ <span class="ruby-identifier">config</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">ensure</span>(<span class="ruby-identifier">options</span>)
621
+ <span class="ruby-identifier">values</span> = []
622
+
623
+ <span class="ruby-identifier">puppet_scope</span> = <span class="ruby-identifier">config</span>.<span class="ruby-identifier">get</span>(<span class="ruby-value">:puppet_scope</span>, <span class="ruby-keyword">nil</span>)
624
+ <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">puppet_scope</span>
625
+
626
+ <span class="ruby-identifier">puppet_scope</span>.<span class="ruby-identifier">compiler</span>.<span class="ruby-identifier">environment</span>.<span class="ruby-identifier">modules</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">mod</span><span class="ruby-operator">|</span>
627
+ <span class="ruby-identifier">values</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">code</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">mod</span>)
628
+ <span class="ruby-keyword">end</span>
629
+ <span class="ruby-identifier">values</span>
630
+ <span class="ruby-keyword">end</span></pre>
631
+ </div><!-- each_module-source -->
632
+
633
+ </div>
634
+
635
+
636
+
637
+
638
+ </div><!-- each_module-method -->
639
+
640
+
641
+ <div id="method-c-import" class="method-detail ">
642
+
643
+ <div class="method-heading">
644
+ <span class="method-name">import</span><span
645
+ class="method-args">(files, options = {})</span>
646
+ <span class="method-click-advice">click to toggle source</span>
647
+ </div>
648
+
649
+
650
+ <div class="method-description">
651
+
652
+
653
+
654
+
655
+
656
+ <div class="method-source-code" id="import-source">
657
+ <pre><span class="ruby-comment"># File lib/core/util/puppet.rb, line 184</span>
658
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">import</span>(<span class="ruby-identifier">files</span>, <span class="ruby-identifier">options</span> = {})
659
+ <span class="ruby-identifier">config</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">ensure</span>(<span class="ruby-identifier">options</span>)
660
+
661
+ <span class="ruby-identifier">puppet_scope</span> = <span class="ruby-identifier">config</span>.<span class="ruby-identifier">get</span>(<span class="ruby-value">:puppet_scope</span>, <span class="ruby-keyword">nil</span>)
662
+ <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">puppet_scope</span>
663
+
664
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">types</span> = <span class="ruby-identifier">puppet_scope</span>.<span class="ruby-identifier">environment</span>.<span class="ruby-identifier">known_resource_types</span>
665
+ <span class="ruby-constant">Util</span><span class="ruby-operator">::</span><span class="ruby-constant">Data</span>.<span class="ruby-identifier">array</span>(<span class="ruby-identifier">files</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
666
+ <span class="ruby-identifier">types</span>.<span class="ruby-identifier">loader</span>.<span class="ruby-identifier">import</span>(<span class="ruby-identifier">file</span>, <span class="ruby-identifier">config</span>.<span class="ruby-identifier">get</span>(<span class="ruby-value">:puppet_import_base</span>, <span class="ruby-keyword">nil</span>))
667
+ <span class="ruby-keyword">end</span>
668
+ <span class="ruby-keyword">end</span>
669
+ <span class="ruby-keyword">end</span></pre>
670
+ </div><!-- import-source -->
671
+
672
+ </div>
673
+
674
+
675
+
676
+
677
+ </div><!-- import-method -->
678
+
679
+
680
+ <div id="method-c-include" class="method-detail ">
681
+
682
+ <div class="method-heading">
683
+ <span class="method-name">include</span><span
684
+ class="method-args">(resource_name, properties = {}, options = {})</span>
685
+ <span class="method-click-advice">click to toggle source</span>
686
+ </div>
687
+
688
+
689
+ <div class="method-description">
690
+
691
+
692
+
693
+
694
+
695
+ <div class="method-source-code" id="include-source">
696
+ <pre><span class="ruby-comment"># File lib/core/util/puppet.rb, line 199</span>
697
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">include</span>(<span class="ruby-identifier">resource_name</span>, <span class="ruby-identifier">properties</span> = {}, <span class="ruby-identifier">options</span> = {})
698
+ <span class="ruby-identifier">config</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">ensure</span>(<span class="ruby-identifier">options</span>)
699
+ <span class="ruby-identifier">class_data</span> = {}
700
+
701
+ <span class="ruby-identifier">puppet_scope</span> = <span class="ruby-identifier">config</span>.<span class="ruby-identifier">get</span>(<span class="ruby-value">:puppet_scope</span>, <span class="ruby-keyword">nil</span>)
702
+ <span class="ruby-keyword">return</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">puppet_scope</span>
703
+
704
+ <span class="ruby-identifier">display_name</span> = <span class="ruby-identifier">puppet_scope</span>.<span class="ruby-identifier">parent_module_name</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">puppet_scope</span>.<span class="ruby-identifier">parent_module_name</span> <span class="ruby-operator">:</span> <span class="ruby-string">&#39;toplevel&#39;</span>
705
+
706
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">resource_name</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>)
707
+ <span class="ruby-identifier">resource_name</span> = <span class="ruby-identifier">resource_name</span>.<span class="ruby-identifier">flatten</span>
708
+ <span class="ruby-keyword">else</span>
709
+ <span class="ruby-identifier">resource_name</span> = [ <span class="ruby-identifier">resource_name</span> ]
710
+ <span class="ruby-keyword">end</span>
711
+
712
+ <span class="ruby-identifier">resource_name</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
713
+ <span class="ruby-identifier">classes</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">lookup</span>(<span class="ruby-identifier">name</span>, <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">config</span>)
714
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">classes</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>)
715
+ <span class="ruby-identifier">classes</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">klass</span><span class="ruby-operator">|</span>
716
+ <span class="ruby-constant">CORL</span>.<span class="ruby-identifier">ui_group</span>(<span class="ruby-constant">Util</span><span class="ruby-operator">::</span><span class="ruby-constant">Console</span>.<span class="ruby-identifier">cyan</span>(<span class="ruby-identifier">display_name</span>)) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ui</span><span class="ruby-operator">|</span>
717
+ <span class="ruby-identifier">rendered_klass</span> = <span class="ruby-constant">Util</span><span class="ruby-operator">::</span><span class="ruby-constant">Console</span>.<span class="ruby-identifier">blue</span>(<span class="ruby-identifier">klass</span>)
718
+ <span class="ruby-identifier">rendered_resource</span> = <span class="ruby-constant">Util</span><span class="ruby-operator">::</span><span class="ruby-constant">Console</span>.<span class="ruby-identifier">green</span>(<span class="ruby-node">&quot;Class[#{rendered_klass}]&quot;</span>)
719
+ <span class="ruby-identifier">ui</span>.<span class="ruby-identifier">info</span>(<span class="ruby-node">&quot;Including #{rendered_resource}&quot;</span>)
720
+ <span class="ruby-keyword">end</span>
721
+ <span class="ruby-identifier">class_data</span>[<span class="ruby-identifier">klass</span>] = <span class="ruby-identifier">properties</span>
722
+ <span class="ruby-keyword">end</span>
723
+ <span class="ruby-keyword">end</span>
724
+ <span class="ruby-keyword">end</span>
725
+
726
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">config</span>.<span class="ruby-identifier">get</span>(<span class="ruby-value">:debug</span>, <span class="ruby-keyword">false</span>)
727
+ <span class="ruby-constant">CORL</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">info</span>(<span class="ruby-string">&quot;\n&quot;</span>, { <span class="ruby-value">:prefix</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword">false</span> })
728
+ <span class="ruby-constant">CORL</span>.<span class="ruby-identifier">ui_group</span>(<span class="ruby-constant">Util</span><span class="ruby-operator">::</span><span class="ruby-constant">Console</span>.<span class="ruby-identifier">cyan</span>(<span class="ruby-node">&quot;#{display_name} include&quot;</span>)) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ui</span><span class="ruby-operator">|</span>
729
+ <span class="ruby-identifier">ui</span>.<span class="ruby-identifier">info</span>(<span class="ruby-string">&quot;-----------------------------------------------------&quot;</span>)
730
+
731
+ <span class="ruby-identifier">dump</span> = <span class="ruby-constant">Util</span><span class="ruby-operator">::</span><span class="ruby-constant">Console</span>.<span class="ruby-identifier">green</span>(<span class="ruby-constant">Util</span><span class="ruby-operator">::</span><span class="ruby-constant">Data</span>.<span class="ruby-identifier">to_json</span>(<span class="ruby-identifier">class_data</span>, <span class="ruby-keyword">true</span>))
732
+
733
+ <span class="ruby-identifier">ui</span>.<span class="ruby-identifier">info</span>(<span class="ruby-node">&quot;:\n#{dump}&quot;</span>)
734
+ <span class="ruby-identifier">ui</span>.<span class="ruby-identifier">info</span>(<span class="ruby-string">&quot;\n&quot;</span>, { <span class="ruby-value">:prefix</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword">false</span> })
735
+ <span class="ruby-keyword">end</span>
736
+ <span class="ruby-keyword">end</span>
737
+
738
+ <span class="ruby-identifier">klasses</span> = <span class="ruby-identifier">puppet_scope</span>.<span class="ruby-identifier">compiler</span>.<span class="ruby-identifier">evaluate_classes</span>(<span class="ruby-identifier">class_data</span>, <span class="ruby-identifier">puppet_scope</span>, <span class="ruby-keyword">false</span>)
739
+ <span class="ruby-identifier">missing</span> = <span class="ruby-identifier">class_data</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">find_all</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">klass</span><span class="ruby-operator">|</span>
740
+ <span class="ruby-operator">!</span> <span class="ruby-identifier">klasses</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">klass</span>)
741
+ <span class="ruby-keyword">end</span>
742
+ <span class="ruby-keyword">return</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">missing</span>.<span class="ruby-identifier">empty?</span>
743
+ <span class="ruby-keyword">true</span>
744
+ <span class="ruby-keyword">end</span></pre>
745
+ </div><!-- include-source -->
746
+
747
+ </div>
748
+
749
+
750
+
751
+
752
+ </div><!-- include-method -->
753
+
754
+
755
+ <div id="method-c-logger" class="method-detail ">
756
+
757
+ <div class="method-heading">
758
+ <span class="method-name">logger</span><span
759
+ class="method-args">()</span>
760
+ <span class="method-click-advice">click to toggle source</span>
761
+ </div>
762
+
763
+
764
+ <div class="method-description">
765
+
766
+
767
+
768
+
769
+
770
+ <div class="method-source-code" id="logger-source">
771
+ <pre><span class="ruby-comment"># File lib/core/util/puppet.rb, line 6</span>
772
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">logger</span>
773
+ <span class="ruby-constant">CORL</span>.<span class="ruby-identifier">logger</span>
774
+ <span class="ruby-keyword">end</span></pre>
775
+ </div><!-- logger-source -->
776
+
777
+ </div>
778
+
779
+
780
+
781
+
782
+ </div><!-- logger-method -->
783
+
784
+
785
+ <div id="method-c-lookup" class="method-detail ">
786
+
787
+ <div class="method-heading">
788
+ <span class="method-name">lookup</span><span
789
+ class="method-args">(property, default = nil, options = {})</span>
790
+ <span class="method-click-advice">click to toggle source</span>
791
+ </div>
792
+
793
+
794
+ <div class="method-description">
795
+
796
+
797
+
798
+
799
+
800
+ <div class="method-source-code" id="lookup-source">
801
+ <pre><span class="ruby-comment"># File lib/core/util/puppet.rb, line 251</span>
802
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">lookup</span>(<span class="ruby-identifier">property</span>, <span class="ruby-identifier">default</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">options</span> = {})
803
+ <span class="ruby-identifier">config</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">ensure</span>(<span class="ruby-identifier">options</span>)
804
+ <span class="ruby-identifier">value</span> = <span class="ruby-keyword">nil</span>
805
+
806
+ <span class="ruby-identifier">puppet_scope</span> = <span class="ruby-identifier">config</span>.<span class="ruby-identifier">get</span>(<span class="ruby-value">:puppet_scope</span>, <span class="ruby-keyword">nil</span>)
807
+ <span class="ruby-identifier">base_names</span> = <span class="ruby-identifier">config</span>.<span class="ruby-identifier">get</span>(<span class="ruby-value">:search</span>, <span class="ruby-keyword">nil</span>)
808
+ <span class="ruby-identifier">search_name</span> = <span class="ruby-identifier">config</span>.<span class="ruby-identifier">get</span>(<span class="ruby-value">:search_name</span>, <span class="ruby-keyword">true</span>)
809
+ <span class="ruby-identifier">reverse_lookup</span> = <span class="ruby-identifier">config</span>.<span class="ruby-identifier">get</span>(<span class="ruby-value">:reverse_lookup</span>, <span class="ruby-keyword">true</span>)
810
+
811
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">default</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">puppet_scope</span>
812
+
813
+ <span class="ruby-identifier">log_level</span> = <span class="ruby-operator">::</span><span class="ruby-constant">Puppet</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span><span class="ruby-operator">::</span><span class="ruby-constant">Log</span>.<span class="ruby-identifier">level</span>
814
+ <span class="ruby-operator">::</span><span class="ruby-constant">Puppet</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span><span class="ruby-operator">::</span><span class="ruby-constant">Log</span>.<span class="ruby-identifier">level</span> = <span class="ruby-value">:err</span> <span class="ruby-comment"># Don&#39;t want failed parameter lookup warnings here.</span>
815
+
816
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">base_names</span>
817
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">base_names</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
818
+ <span class="ruby-identifier">base_names</span> = [ <span class="ruby-identifier">base_names</span> ]
819
+ <span class="ruby-keyword">end</span>
820
+ <span class="ruby-identifier">base_names</span> = <span class="ruby-identifier">base_names</span>.<span class="ruby-identifier">reverse</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">reverse_lookup</span>
821
+
822
+ <span class="ruby-identifier">base_names</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">base</span><span class="ruby-operator">|</span>
823
+ <span class="ruby-identifier">search_property_name</span> = <span class="ruby-node">&quot;#{base}::#{property}&quot;</span>
824
+
825
+ <span class="ruby-identifier">value</span> = <span class="ruby-identifier">puppet_scope</span>.<span class="ruby-identifier">lookupvar</span>(<span class="ruby-node">&quot;::#{search_property_name}&quot;</span>)
826
+ <span class="ruby-constant">Config</span>.<span class="ruby-identifier">debug_lookup</span>(<span class="ruby-identifier">config</span>, <span class="ruby-identifier">search_property_name</span>, <span class="ruby-identifier">value</span>, <span class="ruby-string">&quot;Puppet override lookup&quot;</span>)
827
+
828
+ <span class="ruby-keyword">break</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span>
829
+ <span class="ruby-keyword">end</span>
830
+ <span class="ruby-keyword">end</span>
831
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span>
832
+ <span class="ruby-identifier">components</span> = <span class="ruby-identifier">property</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">&#39;::&#39;</span>)
833
+
834
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">components</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span>
835
+ <span class="ruby-identifier">components</span> <span class="ruby-operator">+=</span> [ <span class="ruby-string">&#39;default&#39;</span>, <span class="ruby-identifier">components</span>.<span class="ruby-identifier">pop</span> ]
836
+ <span class="ruby-identifier">search_property_name</span> = <span class="ruby-identifier">components</span>.<span class="ruby-identifier">flatten</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&#39;::&#39;</span>)
837
+
838
+ <span class="ruby-identifier">value</span> = <span class="ruby-identifier">puppet_scope</span>.<span class="ruby-identifier">lookupvar</span>(<span class="ruby-node">&quot;::#{search_property_name}&quot;</span>)
839
+ <span class="ruby-constant">Config</span>.<span class="ruby-identifier">debug_lookup</span>(<span class="ruby-identifier">config</span>, <span class="ruby-identifier">search_property_name</span>, <span class="ruby-identifier">value</span>, <span class="ruby-string">&quot;Puppet default lookup&quot;</span>)
840
+ <span class="ruby-keyword">end</span>
841
+ <span class="ruby-keyword">end</span>
842
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">search_name</span>
843
+ <span class="ruby-identifier">value</span> = <span class="ruby-identifier">puppet_scope</span>.<span class="ruby-identifier">lookupvar</span>(<span class="ruby-node">&quot;::#{property}&quot;</span>)
844
+ <span class="ruby-constant">Config</span>.<span class="ruby-identifier">debug_lookup</span>(<span class="ruby-identifier">config</span>, <span class="ruby-identifier">property</span>, <span class="ruby-identifier">value</span>, <span class="ruby-string">&quot;Puppet name lookup&quot;</span>)
845
+ <span class="ruby-keyword">end</span>
846
+
847
+ <span class="ruby-operator">::</span><span class="ruby-constant">Puppet</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span><span class="ruby-operator">::</span><span class="ruby-constant">Log</span>.<span class="ruby-identifier">level</span> = <span class="ruby-identifier">log_level</span>
848
+ <span class="ruby-identifier">value</span>
849
+ <span class="ruby-keyword">end</span></pre>
850
+ </div><!-- lookup-source -->
851
+
852
+ </div>
853
+
854
+
855
+
856
+
857
+ </div><!-- lookup-method -->
858
+
859
+
860
+ <div id="method-c-namevar" class="method-detail ">
861
+
862
+ <div class="method-heading">
863
+ <span class="method-name">namevar</span><span
864
+ class="method-args">(type_name, resource_name)</span>
865
+ <span class="method-click-advice">click to toggle source</span>
866
+ </div>
867
+
868
+
869
+ <div class="method-description">
870
+
871
+
872
+
873
+
874
+
875
+ <div class="method-source-code" id="namevar-source">
876
+ <pre><span class="ruby-comment"># File lib/core/util/puppet.rb, line 332</span>
877
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">namevar</span>(<span class="ruby-identifier">type_name</span>, <span class="ruby-identifier">resource_name</span>)
878
+ <span class="ruby-identifier">resource</span> = <span class="ruby-operator">::</span><span class="ruby-constant">Puppet</span><span class="ruby-operator">::</span><span class="ruby-constant">Resource</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">type_name</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp">/^\@?\@/</span>, <span class="ruby-string">&#39;&#39;</span>), <span class="ruby-identifier">resource_name</span>)
879
+
880
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">resource</span>.<span class="ruby-identifier">builtin_type?</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">type</span> = <span class="ruby-identifier">resource</span>.<span class="ruby-identifier">resource_type</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">type</span>.<span class="ruby-identifier">key_attributes</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
881
+ <span class="ruby-identifier">type</span>.<span class="ruby-identifier">key_attributes</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">to_s</span>
882
+ <span class="ruby-keyword">else</span>
883
+ <span class="ruby-string">&#39;name&#39;</span>
884
+ <span class="ruby-keyword">end</span>
885
+ <span class="ruby-keyword">end</span></pre>
886
+ </div><!-- namevar-source -->
887
+
888
+ </div>
889
+
890
+
891
+
892
+
893
+ </div><!-- namevar-method -->
894
+
895
+
896
+ <div id="method-c-register_plugins" class="method-detail ">
897
+
898
+ <div class="method-heading">
899
+ <span class="method-name">register_plugins</span><span
900
+ class="method-args">(options = {})</span>
901
+ <span class="method-click-advice">click to toggle source</span>
902
+ </div>
903
+
904
+
905
+ <div class="method-description">
906
+
907
+
908
+
909
+
910
+
911
+ <div class="method-source-code" id="register_plugins-source">
912
+ <pre><span class="ruby-comment"># File lib/core/util/puppet.rb, line 17</span>
913
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">register_plugins</span>(<span class="ruby-identifier">options</span> = {})
914
+ <span class="ruby-identifier">config</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">ensure</span>(<span class="ruby-identifier">options</span>)
915
+
916
+ <span class="ruby-identifier">puppet_scope</span> = <span class="ruby-identifier">config</span>.<span class="ruby-identifier">get</span>(<span class="ruby-value">:puppet_scope</span>, <span class="ruby-keyword">nil</span>)
917
+ <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">puppet_scope</span>
918
+
919
+ <span class="ruby-identifier">each_module</span>(<span class="ruby-identifier">config</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">mod</span><span class="ruby-operator">|</span>
920
+ <span class="ruby-keyword">unless</span> <span class="ruby-identifier">@@register</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">mod</span>.<span class="ruby-identifier">path</span>)
921
+ <span class="ruby-identifier">lib_dir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">mod</span>.<span class="ruby-identifier">path</span>, <span class="ruby-string">&#39;lib&#39;</span>)
922
+ <span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">lib_dir</span>)
923
+ <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Registering Puppet module at #{lib_dir}&quot;</span>)
924
+ <span class="ruby-constant">CORL</span>.<span class="ruby-identifier">register</span>(<span class="ruby-identifier">lib_dir</span>)
925
+ <span class="ruby-identifier">@@register</span>[<span class="ruby-identifier">mod</span>.<span class="ruby-identifier">path</span>] = <span class="ruby-keyword">true</span>
926
+ <span class="ruby-keyword">end</span>
927
+ <span class="ruby-keyword">end</span>
928
+ <span class="ruby-keyword">end</span>
929
+ <span class="ruby-keyword">end</span></pre>
930
+ </div><!-- register_plugins-source -->
931
+
932
+ </div>
933
+
934
+
935
+
936
+
937
+ </div><!-- register_plugins-method -->
938
+
939
+
940
+ <div id="method-c-to_name" class="method-detail ">
941
+
942
+ <div class="method-heading">
943
+ <span class="method-name">to_name</span><span
944
+ class="method-args">(name)</span>
945
+ <span class="method-click-advice">click to toggle source</span>
946
+ </div>
947
+
948
+
949
+ <div class="method-description">
950
+
951
+
952
+
953
+
954
+
955
+ <div class="method-source-code" id="to_name-source">
956
+ <pre><span class="ruby-comment"># File lib/core/util/puppet.rb, line 318</span>
957
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">to_name</span>(<span class="ruby-identifier">name</span>)
958
+ <span class="ruby-constant">Util</span><span class="ruby-operator">::</span><span class="ruby-constant">Data</span>.<span class="ruby-identifier">value</span>(<span class="ruby-identifier">name</span>).<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp">/[\/\\-\.]/</span>, <span class="ruby-string">&#39;_&#39;</span>)
959
+ <span class="ruby-keyword">end</span></pre>
960
+ </div><!-- to_name-source -->
961
+
962
+ </div>
963
+
964
+
965
+
966
+
967
+ </div><!-- to_name-method -->
968
+
969
+
970
+ <div id="method-c-type_info" class="method-detail ">
971
+
972
+ <div class="method-heading">
973
+ <span class="method-name">type_info</span><span
974
+ class="method-args">(type_name, options = {})</span>
975
+ <span class="method-click-advice">click to toggle source</span>
976
+ </div>
977
+
978
+
979
+ <div class="method-description">
980
+
981
+
982
+
983
+
984
+
985
+ <div class="method-source-code" id="type_info-source">
986
+ <pre><span class="ruby-comment"># File lib/core/util/puppet.rb, line 38</span>
987
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">type_info</span>(<span class="ruby-identifier">type_name</span>, <span class="ruby-identifier">options</span> = {})
988
+ <span class="ruby-identifier">config</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">ensure</span>(<span class="ruby-identifier">options</span>)
989
+ <span class="ruby-identifier">reset</span> = <span class="ruby-identifier">config</span>.<span class="ruby-identifier">get</span>(<span class="ruby-value">:reset</span>, <span class="ruby-keyword">false</span>)
990
+
991
+ <span class="ruby-identifier">puppet_scope</span> = <span class="ruby-identifier">config</span>.<span class="ruby-identifier">get</span>(<span class="ruby-value">:puppet_scope</span>, <span class="ruby-keyword">nil</span>)
992
+ <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">puppet_scope</span>
993
+
994
+ <span class="ruby-identifier">type_name</span> = <span class="ruby-identifier">type_name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">downcase</span>
995
+ <span class="ruby-identifier">type_info</span> = <span class="ruby-identifier">config</span>.<span class="ruby-identifier">get</span>(<span class="ruby-value">:type_info</span>, {})
996
+
997
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">reset</span> <span class="ruby-operator">||</span> <span class="ruby-operator">!</span> <span class="ruby-identifier">type_info</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">type_name</span>)
998
+ <span class="ruby-identifier">resource_type</span> = <span class="ruby-keyword">nil</span>
999
+ <span class="ruby-identifier">type_exported</span>, <span class="ruby-identifier">type_virtual</span> = <span class="ruby-keyword">false</span>
1000
+
1001
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">type_name</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-string">&#39;@@&#39;</span>)
1002
+ <span class="ruby-identifier">type_name</span> = <span class="ruby-identifier">type_name</span>[<span class="ruby-value">2</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>]
1003
+ <span class="ruby-identifier">type_exported</span> = <span class="ruby-keyword">true</span>
1004
+
1005
+ <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">type_name</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-string">&#39;@&#39;</span>)
1006
+ <span class="ruby-identifier">type_name</span> = <span class="ruby-identifier">type_name</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>]
1007
+ <span class="ruby-identifier">type_virtual</span> = <span class="ruby-keyword">true</span>
1008
+ <span class="ruby-keyword">end</span>
1009
+
1010
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">type_name</span> <span class="ruby-operator">==</span> <span class="ruby-string">&#39;class&#39;</span>
1011
+ <span class="ruby-identifier">resource_type</span> = <span class="ruby-value">:class</span>
1012
+ <span class="ruby-keyword">else</span>
1013
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">resource</span> = <span class="ruby-operator">::</span><span class="ruby-constant">Puppet</span><span class="ruby-operator">::</span><span class="ruby-constant">Type</span>.<span class="ruby-identifier">type</span>(<span class="ruby-identifier">type_name</span>.<span class="ruby-identifier">to_sym</span>)
1014
+ <span class="ruby-identifier">resource_type</span> = <span class="ruby-value">:type</span>
1015
+
1016
+ <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">resource</span> = <span class="ruby-identifier">puppet_scope</span>.<span class="ruby-identifier">find_definition</span>(<span class="ruby-identifier">type_name</span>)
1017
+ <span class="ruby-identifier">resource_type</span> = <span class="ruby-value">:define</span>
1018
+ <span class="ruby-keyword">end</span>
1019
+ <span class="ruby-keyword">end</span>
1020
+
1021
+ <span class="ruby-identifier">type_info</span>[<span class="ruby-identifier">type_name</span>] = {
1022
+ <span class="ruby-value">:name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">type_name</span>,
1023
+ <span class="ruby-value">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">resource_type</span>,
1024
+ <span class="ruby-value">:resource</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">resource</span>,
1025
+ <span class="ruby-value">:exported</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">type_exported</span>,
1026
+ <span class="ruby-value">:virtual</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">type_virtual</span>
1027
+ }
1028
+ <span class="ruby-identifier">config</span>.<span class="ruby-identifier">set</span>(<span class="ruby-value">:type_info</span>, <span class="ruby-identifier">type_info</span>)
1029
+ <span class="ruby-keyword">end</span>
1030
+
1031
+ <span class="ruby-identifier">type_info</span>[<span class="ruby-identifier">type_name</span>]
1032
+ <span class="ruby-keyword">end</span></pre>
1033
+ </div><!-- type_info-source -->
1034
+
1035
+ </div>
1036
+
1037
+
1038
+
1039
+
1040
+ </div><!-- type_info-method -->
1041
+
1042
+
1043
+ <div id="method-c-type_name" class="method-detail ">
1044
+
1045
+ <div class="method-heading">
1046
+ <span class="method-name">type_name</span><span
1047
+ class="method-args">(value)</span>
1048
+ <span class="method-click-advice">click to toggle source</span>
1049
+ </div>
1050
+
1051
+
1052
+ <div class="method-description">
1053
+
1054
+
1055
+
1056
+
1057
+
1058
+ <div class="method-source-code" id="type_name-source">
1059
+ <pre><span class="ruby-comment"># File lib/core/util/puppet.rb, line 324</span>
1060
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">type_name</span>(<span class="ruby-identifier">value</span>)
1061
+ <span class="ruby-keyword">return</span> <span class="ruby-value">:main</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">value</span> <span class="ruby-operator">==</span> <span class="ruby-value">:main</span>
1062
+ <span class="ruby-keyword">return</span> <span class="ruby-string">&quot;Class&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">value</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;&quot;</span> <span class="ruby-keyword">or</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword">or</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">downcase</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;component&quot;</span>
1063
+ <span class="ruby-identifier">value</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot;::&quot;</span>).<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">capitalize</span> }.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;::&quot;</span>)
1064
+ <span class="ruby-keyword">end</span></pre>
1065
+ </div><!-- type_name-source -->
1066
+
1067
+ </div>
1068
+
1069
+
1070
+
1071
+
1072
+ </div><!-- type_name-method -->
1073
+
1074
+
1075
+ </section><!-- public-class-method-details -->
1076
+
1077
+ </section><!-- 5Buntitled-5D -->
1078
+
1079
+ </div><!-- documentation -->
1080
+
1081
+
1082
+ <footer id="validator-badges">
1083
+ <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
1084
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.2.
1085
+ <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
1086
+ </footer>
1087
+