-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
143 lines (128 loc) · 5.75 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<html>
<head>
<title>Interactive Hiera Demo</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<link rel="stylesheet" href="atelier-cave-light.css">
<link rel="stylesheet" type="text/css" href="styles.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script src="highlight.pack.js"></script>
<script>
hljs.initHighlightingOnLoad();
</script>
<script type="text/javascript" src="yaml.js"></script>
<link rel="stylesheet" type="text/css" href="styles.css">
<script type="text/javascript" src="scripts.js"></script>
</head>
<body>
<h1>Interactive Hiera Demo</h1>
<p>Retrieve data from Hiera, based on the values of facts. <a id="openhelp" href="#">[help]</a></p>
<aside class="float-left">
<div>
<label for="key">Lookup key:</label>
<input id="key" type="text" name="key">
<input id="lookup" type="submit" value="Lookup">
</div>
<br>
<div id="facts">Facts
<ul>
<li>
<label for="clientcert">clientcert</label>
<input type="text" id="clientcert" name="clientcert" value="web01.example.com">
</li>
<li>
<label for="role">role</label>
<input type="text" id="role" name="role" value="webserver">
</li>
<li>
<label for="datacenter">datacenter</label>
<input type="text" id="datacenter" name="datacenter" value="houston">
</li>
<li>
<label for="environment">environment</label>
<input type="text" id="environment" name="environment" value="production">
</li>
</ul>
</div>
</aside>
<section class="float-right">
<div id="result">
<svg class="timer" width="16" height="16" xmlns="http://www.w3.org/2000/svg">
<g>
<circle class="countdown" r="4" cy="8" cx="8" stroke-width="8" stroke="black" fill="none"/>
</g>
</svg>
<h4>Progress:</h4>
<div id="message"></div>
</div>
<div class="hiera">
<h3><code>hiera.yaml</code></h3>
<pre><code class="yaml"><input type="button" id="update" class="float-right" value="Interpolate Facts" /><input type="button" id="reset" class="float-right" value="Reset Facts" />---
:backends:
- yaml
:hierarchy:
- <span id="level1" class="level">"nodes/<span class="replace clientcert" title="%{clientcert}">%{clientcert}</span>"</span>
- <span id="level2" class="level">"<span class="replace datacenter" title="%{datacenter}">%{datacenter}</span>/<span class="replace role" title="%{role}">%{role}</span>"</span>
- <span id="level3" class="level">"<span class="replace role" title="%{role}">%{role}</span>"</span>
- <span id="level4" class="level">"<span class="replace datacenter" title="%{datacenter}">%{datacenter}</span>"</span>
- <span id="level5" class="level">common</span>
:yaml:
:datadir: "/etc/puppetlabs/code/environments/<span class="replace environment" title="%{environment}">%{environment}</span>/hieradata"</code></pre>
</div>
<div class="datasources">
<h3>Datasource Files (in <code>/etc/puppetlabs/code/environments</code>):</h3>
<ul>
<li>
<div class="path">development/hieradata/common<span class="ext">.yaml</span></div>
<pre><code class="yaml">---
message: This is the development environment</code></pre>
</li>
<li>
<div class="path">development/hieradata/nodes/master.example.com<span class="ext">.yaml</span></div>
<pre><code class="yaml">---
puppet_enterprise::profile::master::java_args:
Xmx: '1024m'
Xms: '1024m'</code></pre>
</li>
<li>
<div class="path">production/hieradata/common<span class="ext">.yaml</span></div>
<pre><code class="yaml">---
message: This is the production environment</code></pre>
</li>
<li>
<div class="path">production/hieradata/nodes/console.example.com<span class="ext">.yaml</span></div>
<pre><code class="yaml">---
puppet_enterprise::profile::console::java_args:
Xmx: '512m'
Xms: '512m'</code></pre>
</li>
<li>
<div class="path">production/hieradata/nodes/web01.example.com<span class="ext">.yaml</span></div>
<pre><code class="yaml">---
dbserver: pgsql.example.com
dbuser: webs
dbpassword: hunter2</code></pre>
</li>
<li>
<div class="path">production/hieradata/nodes/master.example.com<span class="ext">.yaml</span></div>
<pre><code class="yaml">---
puppet_enterprise::profile::master::java_args:
Xmx: '4096m'
Xms: '4096m'</code></pre>
</li>
</ul>
</div>
</section>
<div id="help-dialog" title="Usage help">
<p>Look up values from this simulated Hiera instance by entering a key and pressing
the <em>lookup</em> button. Hiera uses fact values to resolve the values it looks up
as it iterates through the hierarchy. You can change the fact values used in this
demo to affect how keys are resolved.</p>
<p>Look inside the datasource files at the bottom of the page to see the values you can
retrieve. Try looking up keys of <code>message</code>, <code>dbserver</code>, or
<code>puppet_enterprise::profile::master::java_args</code>.</p>
<p>Compare fact values and the datasource paths and try to predict which files will be
used to resolve the keys you're looking up.</p>
</div>
</body>
</html>