corl 0.4.29 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -3
- data/Gemfile.lock +16 -13
- data/VERSION +1 -1
- data/bin/corl +21 -1
- data/bootstrap/os/ubuntu/00_base.sh +2 -2
- data/bootstrap/os/ubuntu/06_puppet.sh +7 -12
- data/bootstrap/os/ubuntu/09_nucleon.sh +1 -1
- data/bootstrap/os/ubuntu/10_corl.sh +1 -4
- data/corl.gemspec +193 -40
- data/lib/CORL/builder/identity.rb +68 -0
- data/lib/CORL/builder/package.rb +75 -0
- data/lib/CORL/configuration/file.rb +5 -5
- data/lib/CORL/machine/{aws.rb → AWS.rb} +2 -2
- data/lib/CORL/machine/physical.rb +1 -1
- data/lib/CORL/machine/rackspace.rb +1 -1
- data/lib/CORL/machine/vagrant.rb +2 -2
- data/lib/CORL/network/{default.rb → CORL.rb} +1 -1
- data/lib/CORL/node/{aws.rb → AWS.rb} +1 -1
- data/lib/CORL/node/local.rb +1 -1
- data/lib/CORL/node/vagrant.rb +7 -2
- data/lib/CORL/provisioner/puppetnode.rb +139 -131
- data/lib/core/build.rb +112 -0
- data/lib/core/facade.rb +48 -8
- data/lib/core/mixin/builder.rb +158 -0
- data/lib/core/mixin/lookup.rb +51 -20
- data/lib/core/mixin/machine/ssh.rb +16 -4
- data/lib/core/plugin/builder.rb +49 -0
- data/lib/core/plugin/{action.rb → cloud_action.rb} +22 -16
- data/lib/core/plugin/configuration.rb +9 -3
- data/lib/core/plugin/fog_machine.rb +3 -3
- data/lib/core/plugin/fog_node.rb +1 -1
- data/lib/core/plugin/machine.rb +2 -2
- data/lib/core/plugin/network.rb +39 -10
- data/lib/core/plugin/node.rb +95 -35
- data/lib/core/plugin/provisioner.rb +133 -113
- data/lib/core/util/puppet/resource.rb +1 -1
- data/lib/core/vagrant/actions/delete_cache.rb +7 -1
- data/lib/core/vagrant/commands/launcher.rb +2 -2
- data/lib/core/vagrant/config.rb +29 -2
- data/lib/corl.rb +9 -8
- data/lib/facter/corl_config_ready.rb +1 -1
- data/lib/facter/vagrant_exists.rb +1 -1
- data/lib/nucleon/action/cloud/create.rb +51 -0
- data/lib/nucleon/action/cloud/hiera.rb +61 -0
- data/lib/{CORL/action → nucleon/action/cloud}/images.rb +11 -2
- data/lib/nucleon/action/cloud/inspect.rb +47 -0
- data/lib/{CORL/action → nucleon/action/cloud}/machines.rb +11 -2
- data/lib/{CORL/action → nucleon/action/cloud}/regions.rb +11 -2
- data/lib/{CORL/action → nucleon/action/cloud}/vagrantfile.rb +11 -2
- data/lib/{CORL/action/ip.rb → nucleon/action/node/IP.rb} +11 -2
- data/lib/{CORL/action/ssh.rb → nucleon/action/node/SSH.rb} +15 -7
- data/lib/{CORL/action → nucleon/action/node}/authorize.rb +11 -2
- data/lib/{CORL/action → nucleon/action/node}/bootstrap.rb +13 -4
- data/lib/nucleon/action/node/build.rb +49 -0
- data/lib/{CORL/action → nucleon/action/node}/destroy.rb +14 -5
- data/lib/{CORL/action → nucleon/action/node}/exec.rb +11 -2
- data/lib/{CORL/action → nucleon/action/node}/facts.rb +12 -3
- data/lib/{CORL/action → nucleon/action/node}/image.rb +13 -4
- data/lib/nucleon/action/node/keypair.rb +85 -0
- data/lib/{CORL/action → nucleon/action/node}/lookup.rb +13 -4
- data/lib/{CORL/action → nucleon/action/node}/provision.rb +30 -8
- data/lib/{CORL/action → nucleon/action/node}/reboot.rb +13 -4
- data/lib/{CORL/action → nucleon/action/node}/revoke.rb +11 -2
- data/lib/{CORL/action → nucleon/action/node}/seed.rb +13 -4
- data/lib/{CORL/action → nucleon/action/node}/spawn.rb +19 -9
- data/lib/{CORL/action → nucleon/action/node}/start.rb +13 -4
- data/lib/{CORL/action → nucleon/action/node}/stop.rb +13 -4
- data/lib/{CORL → nucleon}/event/puppet.rb +2 -2
- data/lib/{CORL → nucleon}/template/environment.rb +2 -2
- data/lib/puppet/indirector/corl.rb +7 -4
- data/lib/puppet/parser/functions/corl_resources.rb +1 -0
- data/lib/puppet/parser/functions/global_array.rb +2 -1
- data/lib/puppet/parser/functions/global_hash.rb +2 -1
- data/lib/puppet/parser/functions/global_param.rb +2 -1
- data/lib/puppet/parser/functions/module_array.rb +2 -1
- data/lib/puppet/parser/functions/module_hash.rb +3 -2
- data/lib/puppet/parser/functions/module_param.rb +3 -2
- data/lib/puppet/parser/functions/render.rb +1 -0
- data/locales/en.yml +80 -0
- data/rdoc/site/0.4.29/CORL/Action/Authorize.html +485 -0
- data/rdoc/site/0.4.29/CORL/Action/Bootstrap.html +546 -0
- data/rdoc/site/0.4.29/CORL/Action/Build.html +396 -0
- data/rdoc/site/0.4.29/CORL/Action/Destroy.html +515 -0
- data/rdoc/site/0.4.29/CORL/Action/Exec.html +472 -0
- data/rdoc/site/0.4.29/CORL/Action/Facts.html +398 -0
- data/rdoc/site/0.4.29/CORL/Action/Image.html +515 -0
- data/rdoc/site/0.4.29/CORL/Action/Images.html +514 -0
- data/rdoc/site/0.4.29/CORL/Action/Ip.html +395 -0
- data/rdoc/site/0.4.29/CORL/Action/Keypair.html +494 -0
- data/rdoc/site/0.4.29/CORL/Action/Lookup.html +474 -0
- data/rdoc/site/0.4.29/CORL/Action/Machines.html +509 -0
- data/rdoc/site/0.4.29/CORL/Action/Provision.html +456 -0
- data/rdoc/site/0.4.29/CORL/Action/Reboot.html +515 -0
- data/rdoc/site/0.4.29/CORL/Action/Regions.html +509 -0
- data/rdoc/site/0.4.29/CORL/Action/Revoke.html +483 -0
- data/rdoc/site/0.4.29/CORL/Action/Seed.html +544 -0
- data/rdoc/site/0.4.29/CORL/Action/Spawn.html +616 -0
- data/rdoc/site/0.4.29/CORL/Action/Ssh.html +526 -0
- data/rdoc/site/0.4.29/CORL/Action/Start.html +515 -0
- data/rdoc/site/0.4.29/CORL/Action/Stop.html +515 -0
- data/rdoc/site/0.4.29/CORL/Action/Vagrantfile.html +457 -0
- data/rdoc/site/0.4.29/CORL/Action.html +360 -0
- data/rdoc/site/0.4.29/CORL/Configuration/File.html +1128 -0
- data/rdoc/site/0.4.29/CORL/Configuration.html +339 -0
- data/rdoc/site/0.4.29/CORL/Errors.html +339 -0
- data/rdoc/site/0.4.29/CORL/Event/Puppet.html +673 -0
- data/rdoc/site/0.4.29/CORL/Event.html +339 -0
- data/rdoc/site/0.4.29/CORL/Facade.html +742 -0
- data/rdoc/site/0.4.29/CORL/Machine/Aws.html +733 -0
- data/rdoc/site/0.4.29/CORL/Machine/Fog.html +1269 -0
- data/rdoc/site/0.4.29/CORL/Machine/Physical.html +1039 -0
- data/rdoc/site/0.4.29/CORL/Machine/Rackspace.html +514 -0
- data/rdoc/site/0.4.29/CORL/Machine/Vagrant.html +1300 -0
- data/rdoc/site/0.4.29/CORL/Machine.html +343 -0
- data/rdoc/site/0.4.29/CORL/Mixin/Action/Keypair.html +572 -0
- data/rdoc/site/0.4.29/CORL/Mixin/Action.html +339 -0
- data/rdoc/site/0.4.29/CORL/Mixin/Lookup.html +954 -0
- data/rdoc/site/0.4.29/CORL/Mixin/Machine/SSH.html +643 -0
- data/rdoc/site/0.4.29/CORL/Mixin/Machine.html +339 -0
- data/rdoc/site/0.4.29/CORL/Mixin/Macro/NetworkSettings.html +464 -0
- data/rdoc/site/0.4.29/CORL/Mixin/Macro.html +339 -0
- data/rdoc/site/0.4.29/CORL/Mixin.html +342 -0
- data/rdoc/site/0.4.29/CORL/Network/Default.html +391 -0
- data/rdoc/site/0.4.29/CORL/Network.html +339 -0
- data/rdoc/site/0.4.29/CORL/Node/Aws.html +716 -0
- data/rdoc/site/0.4.29/CORL/Node/Fog.html +1192 -0
- data/rdoc/site/0.4.29/CORL/Node/Local.html +424 -0
- data/rdoc/site/0.4.29/CORL/Node/Rackspace.html +709 -0
- data/rdoc/site/0.4.29/CORL/Node/Vagrant.html +1451 -0
- data/rdoc/site/0.4.29/CORL/Node.html +343 -0
- data/rdoc/site/0.4.29/CORL/Plugin/CloudAction.html +810 -0
- data/rdoc/site/0.4.29/CORL/Plugin.html +339 -0
- data/rdoc/site/0.4.29/CORL/Provisioner/Puppetnode.html +1095 -0
- data/rdoc/site/0.4.29/CORL/Provisioner.html +339 -0
- data/rdoc/site/0.4.29/CORL/Template/Environment.html +528 -0
- data/rdoc/site/0.4.29/CORL/Template.html +339 -0
- data/rdoc/site/0.4.29/CORL/Util/Puppet/Resource.html +1038 -0
- data/rdoc/site/0.4.29/CORL/Util/Puppet/ResourceGroup.html +920 -0
- data/rdoc/site/0.4.29/CORL/Util/Puppet.html +1087 -0
- data/rdoc/site/0.4.29/CORL/Util.html +341 -0
- data/rdoc/site/0.4.29/CORL/Vagrant/Config.html +896 -0
- data/rdoc/site/0.4.29/CORL/Vagrant.html +418 -0
- data/rdoc/site/0.4.29/CORL.html +465 -0
- data/rdoc/site/0.4.29/Facter/Util/Loader.html +396 -0
- data/rdoc/site/0.4.29/Facter/Util.html +339 -0
- data/rdoc/site/0.4.29/Facter.html +339 -0
- data/rdoc/site/0.4.29/Fog/Compute/AWS/Server.html +423 -0
- data/rdoc/site/0.4.29/Fog/Compute/AWS.html +345 -0
- data/rdoc/site/0.4.29/Fog/Compute/RackspaceV2/Server.html +408 -0
- data/rdoc/site/0.4.29/Fog/Compute/RackspaceV2.html +345 -0
- data/rdoc/site/0.4.29/Fog/Compute.html +340 -0
- data/rdoc/site/0.4.29/Fog.html +340 -0
- data/rdoc/site/0.4.29/Hiera/Backend.html +422 -0
- data/rdoc/site/0.4.29/Hiera/Corl_logger.html +449 -0
- data/rdoc/site/0.4.29/Hiera.html +346 -0
- data/rdoc/site/0.4.29/Nucleon/Config.html +357 -0
- data/rdoc/site/0.4.29/Nucleon/Plugin/Base.html +345 -0
- data/rdoc/site/0.4.29/Nucleon/Plugin/Configuration.html +1213 -0
- data/rdoc/site/0.4.29/Nucleon/Plugin/Machine.html +1279 -0
- data/rdoc/site/0.4.29/Nucleon/Plugin/Network.html +1425 -0
- data/rdoc/site/0.4.29/Nucleon/Plugin/Node.html +3715 -0
- data/rdoc/site/0.4.29/Nucleon/Plugin/Provisioner.html +1297 -0
- data/rdoc/site/0.4.29/Nucleon/Plugin.html +344 -0
- data/rdoc/site/0.4.29/Nucleon.html +344 -0
- data/rdoc/site/0.4.29/Object.html +358 -0
- data/rdoc/site/0.4.29/Puppet/DataBinding/Corl.html +345 -0
- data/rdoc/site/0.4.29/Puppet/DataBinding.html +338 -0
- data/rdoc/site/0.4.29/Puppet/Indirector/Corl.html +454 -0
- data/rdoc/site/0.4.29/Puppet/Indirector.html +338 -0
- data/rdoc/site/0.4.29/Puppet/Parser/Functions.html +480 -0
- data/rdoc/site/0.4.29/Puppet/Parser.html +338 -0
- data/rdoc/site/0.4.29/Puppet.html +338 -0
- data/rdoc/site/0.4.29/README_rdoc.html +340 -0
- data/rdoc/site/0.4.29/Vagrant/Config/Loader.html +399 -0
- data/rdoc/site/0.4.29/Vagrant/Config.html +339 -0
- data/rdoc/site/0.4.29/Vagrant/Vagrantfile.html +392 -0
- data/rdoc/site/0.4.29/Vagrant.html +346 -0
- data/rdoc/site/0.4.29/VagrantPlugins/CORL/Action/DeleteCache.html +396 -0
- data/rdoc/site/0.4.29/VagrantPlugins/CORL/Action/InitKeys.html +408 -0
- data/rdoc/site/0.4.29/VagrantPlugins/CORL/Action/LinkNetwork.html +406 -0
- data/rdoc/site/0.4.29/VagrantPlugins/CORL/Action.html +341 -0
- data/rdoc/site/0.4.29/VagrantPlugins/CORL/BaseAction.html +491 -0
- data/rdoc/site/0.4.29/VagrantPlugins/CORL/Command/Launcher.html +533 -0
- data/rdoc/site/0.4.29/VagrantPlugins/CORL/Command.html +339 -0
- data/rdoc/site/0.4.29/VagrantPlugins/CORL/Config/CORL.html +732 -0
- data/rdoc/site/0.4.29/VagrantPlugins/CORL/Config.html +339 -0
- data/rdoc/site/0.4.29/VagrantPlugins/CORL/Plugin.html +345 -0
- data/rdoc/site/0.4.29/VagrantPlugins/CORL/Provisioner/CORL.html +536 -0
- data/rdoc/site/0.4.29/VagrantPlugins/CORL/Provisioner.html +339 -0
- data/rdoc/site/0.4.29/VagrantPlugins/CORL.html +346 -0
- data/rdoc/site/0.4.29/VagrantPlugins.html +346 -0
- data/rdoc/site/0.4.29/created.rid +96 -0
- data/rdoc/site/0.4.29/images/add.png +0 -0
- data/rdoc/site/0.4.29/images/brick.png +0 -0
- data/rdoc/site/0.4.29/images/brick_link.png +0 -0
- data/rdoc/site/0.4.29/images/bug.png +0 -0
- data/rdoc/site/0.4.29/images/bullet_black.png +0 -0
- data/rdoc/site/0.4.29/images/bullet_toggle_minus.png +0 -0
- data/rdoc/site/0.4.29/images/bullet_toggle_plus.png +0 -0
- data/rdoc/site/0.4.29/images/date.png +0 -0
- data/rdoc/site/0.4.29/images/delete.png +0 -0
- data/rdoc/site/0.4.29/images/find.png +0 -0
- data/rdoc/site/0.4.29/images/loadingAnimation.gif +0 -0
- data/rdoc/site/0.4.29/images/macFFBgHack.png +0 -0
- data/rdoc/site/0.4.29/images/package.png +0 -0
- data/rdoc/site/0.4.29/images/page_green.png +0 -0
- data/rdoc/site/0.4.29/images/page_white_text.png +0 -0
- data/rdoc/site/0.4.29/images/page_white_width.png +0 -0
- data/rdoc/site/0.4.29/images/plugin.png +0 -0
- data/rdoc/site/0.4.29/images/ruby.png +0 -0
- data/rdoc/site/0.4.29/images/tag_blue.png +0 -0
- data/rdoc/site/0.4.29/images/tag_green.png +0 -0
- data/rdoc/site/0.4.29/images/transparent.png +0 -0
- data/rdoc/site/0.4.29/images/wrench.png +0 -0
- data/rdoc/site/0.4.29/images/wrench_orange.png +0 -0
- data/rdoc/site/0.4.29/images/zoom.png +0 -0
- data/rdoc/site/0.4.29/index.html +339 -0
- data/rdoc/site/0.4.29/js/darkfish.js +155 -0
- data/rdoc/site/0.4.29/js/jquery.js +18 -0
- data/rdoc/site/0.4.29/js/navigation.js +142 -0
- data/rdoc/site/0.4.29/js/search.js +94 -0
- data/rdoc/site/0.4.29/js/search_index.js +1 -0
- data/rdoc/site/0.4.29/js/searcher.js +228 -0
- data/rdoc/site/0.4.29/rdoc.css +543 -0
- data/rdoc/site/0.4.29/table_of_contents.html +1561 -0
- metadata +192 -45
- data/lib/CORL/action/build.rb +0 -22
- data/lib/CORL/action/keypair.rb +0 -56
- 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">"\n"</span>, { <span class="ruby-value">:prefix</span> =<span class="ruby-operator">></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">"-----------------------------------------------------"</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">></span> <span class="ruby-identifier">puppet_scope</span>, <span class="ruby-value">:source</span> =<span class="ruby-operator">></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">></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">'toplevel'</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">"#{type_name(type[:name])}[#{rendered_title}]"</span>)
|
543
|
+
<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">info</span>(<span class="ruby-node">"Adding #{rendered_resource}"</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">"Class[#{rendered_title}]"</span>)
|
550
|
+
<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">info</span>(<span class="ruby-node">"Adding #{rendered_resource}"</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">":\n#{dump}"</span>)
|
588
|
+
<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">info</span>(<span class="ruby-string">"\n"</span>, { <span class="ruby-value">:prefix</span> =<span class="ruby-operator">></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> = {}, &<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"><<</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">'toplevel'</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">"Class[#{rendered_klass}]"</span>)
|
719
|
+
<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">info</span>(<span class="ruby-node">"Including #{rendered_resource}"</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">"\n"</span>, { <span class="ruby-value">:prefix</span> =<span class="ruby-operator">></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">"#{display_name} include"</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">"-----------------------------------------------------"</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">":\n#{dump}"</span>)
|
734
|
+
<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">info</span>(<span class="ruby-string">"\n"</span>, { <span class="ruby-value">:prefix</span> =<span class="ruby-operator">></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'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">"#{base}::#{property}"</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">"::#{search_property_name}"</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">"Puppet override lookup"</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">'::'</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">></span> <span class="ruby-value">1</span>
|
835
|
+
<span class="ruby-identifier">components</span> <span class="ruby-operator">+=</span> [ <span class="ruby-string">'default'</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">'::'</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">"::#{search_property_name}"</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">"Puppet default lookup"</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">&&</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">"::#{property}"</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">"Puppet name lookup"</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">''</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">'name'</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">'lib'</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">"Registering Puppet module at #{lib_dir}"</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">'_'</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">'@@'</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">'@'</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">'class'</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">></span> <span class="ruby-identifier">type_name</span>,
|
1023
|
+
<span class="ruby-value">:type</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">resource_type</span>,
|
1024
|
+
<span class="ruby-value">:resource</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">resource</span>,
|
1025
|
+
<span class="ruby-value">:exported</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">type_exported</span>,
|
1026
|
+
<span class="ruby-value">:virtual</span> =<span class="ruby-operator">></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">"Class"</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">value</span> <span class="ruby-operator">==</span> <span class="ruby-string">""</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">"component"</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">"::"</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">"::"</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
|
+
|