-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
314 lines (265 loc) · 12.3 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
<!doctype html>
<html lang="en" xmlns="http://www.w3.org/1999/html" xmlns="http://www.w3.org/1999/html">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=1024" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>OpenNMS, meet configuration management (with SaltStack) | by Umberto Nicoletti @afactotum</title>
<meta name="description" content="describe integration between OpenNMS and SaltStakc so that nodes are automatically added to OpenNMS as soon as they are processed by Salt" />
<meta name="author" content="Umberto Nicoletti" />
<link href="http://fonts.googleapis.com/css?family=Open+Sans:300italic,600italic,700italic,300,400,800" rel="stylesheet" type="text/css">
<link href='http://fonts.googleapis.com/css?family=Sonsie+One' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Oxygen' rel='stylesheet' type='text/css'>
<!--
Presentation made with Impress.js (https://github.com/bartaz/impress.js)
-->
<link href="css/ouce2013.css" rel="stylesheet" />
</head>
<body class="impress-not-supported">
<div id="backgroundscene">
<p class="smaller">http://www.flickr.com/photos/toasty/915288758/</p>
</div>
<span id="prezlink">bit.ly/ouce2013</span>
<div class="fallback-message">
<p>Your browser <b>doesn't support the features required</b> by impress.js, so you are presented with a simplified version of this presentation.</p>
<p>For the best experience please use the latest <b>Chrome</b>, <b>Safari</b> or <b>Firefox</b> browser.</p>
</div>
<div id="impress">
<div id="start" class="step" data-x="0" data-y="0" data-z="10" data-scale="4">
<span class="maintitle">
OpenNMS, meet Configuration Management
</span>
<span class="withsalt">(with SaltStack)</span>
<span class="footnote">OUCE 2013 <a href="https://twitter.com/AFactotum">@afactotum</a></span>
</div>
<div id="scenario" class="step" data-x="-2400" data-y="200">
<p>Scenario:</p>
<ul>
<li class="onms">OpenNMS</li>
<li class="salt">Salt Stack</li>
<li class="vsphere">VMware vSphere</li>
<li class="script">a custom vm provisioning script</li>
</ul>
</div>
<!-- TODO: perhaps remove or shade the right branch as that part is missing at this stage -->
<div id="bigpicture" class="step" data-x="-3000" data-y="-500">
<p><img src="media/bigpicture.png"></p>
</div>
<div id="bigpictureoverlay" class="step" data-x="-3000" data-y="-500">
<p style="text-align: center;font-weight: bold;">I have an idea!<br/>Since all nodes are configured with Salt why not
let Salt maintain nodes in OpenNMS too?
</p>
</div>
<div id="aboutsalt" class="step" data-x="-2400" data-y="-1200">
<p>What is <a href="http://saltstack.org" class="saltstack">Salt Stack</a> anyway?</p>
<ul>
<li class="onms">Configuration management</li>
<li class="salt">Remote execution</li>
<li class="vsphere">Python</li>
<li class="script">Use <a href="http://www.yaml.org/">YAML</a> files for configuration</li>
</ul>
<span class="tip awesome appearing">oh yeah: it's awesome!</span>
</div>
<div id="aboutsalt2" class="step" data-x="-2000" data-y="-1800">
<p>What is <a href="http://saltstack.org" class="saltstack">Salt Stack</a> anyway? (2)</p>
<ul>
<li>0MQ based comm layer</li>
<li>push model</li>
<li>PKI for comm auth/encryption</li>
<li class="script">Growing fast:
<ul>
<li>in 2012 <a href="https://github.com/blog/1359-the-octoverse-in-2012">ranked 8th</a> on GitHub by number of contributors</li>
</ul>
</li>
</ul>
</div>
<div id="options" class="step" data-x="-1000" data-y="-1000">
<p>Overview of our options:</p>
<ul>
<li class="option2">DNS importer
<ul>
<li>first version</li>
</ul>
</li>
<li class="option3">Events/Reactors
<ul>
<li>current version</li>
</ul>
</li>
</ul>
</div>
<div id="dns" class="step option2" data-x="-150" data-y="-1100">
<p>Option 1: <b>DNS importer</b></p>
<ul>
<li>salt generates one or more zone files</li>
<li>opennms imports the zones:</li>
</ul>
<pre id="onmsdnszone">
<requisition-def import-name="linuxservers"
import-url-resource="dns://salt/linuxservers">
<cron-schedule>0 0 0 * * ? *</cron-schedule>
</requisition-def>
</pre>
</div>
<div id="dsnssalt" class="step option2" data-x="1100" data-y="-1000" data-z="200">
<p>DNS zone generation in <b>Salt</b></p>
<pre id="saltdnszone">
@ in soa localhost. root 1 3H 15M 1W 1D
ns localhost.
{% set nets=salt['publish.publish']('*','network.interfaces') %}\
{% for n in nets %}{% set pdata=salt['publish.publish'](n,'pillar.data') %}\
{% if pdata.has_key(n) %}{% if pdata[n].has_key('zone') %}\
{% if pdata[n]['zone']=='<span style="color: blue">linuxservers</span>' %}
{{ n }} IN A {{ nets[n]['eth0']['inet'][0]['address'] }}
{% endif %}{% endif %}{% endif %}{% endfor %}
</pre>
<span class="verysmall">https://gist.github.com/3987451</span>
</div>
<div id="dsndiscussion" class="step option2" data-x="1100" data-y="-1550">
<p><b>DNS</b>: review</p>
<ul>
<li class="check">✓ no coding required</li>
<li class="check">✓ provisioning aware</li>
<li class="check">✘ still no metadata</li>
<li class="check">✘ still no decommissioning</li>
</ul>
</div>
<div id="eventsReactors" class="step option3" data-x="1700" data-y="-200">
<img id="ribbon" src="media/ribbon.png" border="0">
<p>Option 2: <b>Events</b></p>
<ul>
<li>salt 0.10.5 introduced python event APIs</li>
<li>listen for key add/delete</li>
<li>integrate with provisioning</li>
<li>0.11.0 improves API with builtin Reactors</li>
</ul>
</div>
<div id="eventsOverview" class="step option3" data-x="2700" data-y="-200" data-scale="0.7">
<p>
<img src="media/option3_details.png">
</p>
</div>
<div id="eventsListener" class="step option3" data-x="3700" data-y="-200">
<p>Event listener service
<span class="smaller">(started from inittab or upstart):</span>
</p>
<pre>
event = salt.utils.event.MasterEvent('/var/run/salt/master/')
evt_generator=event.iter_events(tag='key',full=True)
for data in evt_generator:
payload = data['data']
minion_id = payload['id']
if payload.get('act') == 'accept' and payload.get('result'):
minion_id=("%s/%s" % ('add',minion_id))
if payload.get('act') == 'delete' and payload.get('result'):
minion_id=("%s/%s" % ('delete',minion_id))
redis.rpush(salt_queue, "%s"%(minion_id))
</pre>
</div>
<div id="eventsRedis" class="step option3" data-x="1900" data-y="550">
<p><a class="redis" href="http://redis.io">Redis</a>: shared queue and K/V store:</p>
<ul>
<li>listener pushes deleted/added minion ids to a queue</li>
<li>consumer fetches ids (in order)</li>
<li>consumer stores the opennms node id and requisition name:
<pre>
[root@srvdpis ~]# redis-cli get testserver.xxxxxxxxx
"mainsite/55bc57cfdeaf95c3320facb6a95a3afce2475cbd"</pre>
</li>
</ul>
</div>
<div id="eventsConsumer" class="step option3" data-x="2900" data-y="550">
<p>Consumer process
<span class="smaller">(started from crontab every 20'):</span>
</p>
<ul>
<li>locks queue</li>
<li>process queue</li>
<li>query minions for ip and metadata</li>
<li>forks provision.pl calls</li>
<li>supports dry-run mode</li>
</ul>
</div>
<div id="option3Recap" class="step option3" data-x="3900" data-y="550">
<p><b>Events</b>: review</p>
<ul>
<li class="check">✓ aligned with ops</li>
<li class="check">✓ provisioning aware</li>
<li class="check">✓ supports metadata</li>
<li class="check">✓ supports decommissioning</li>
<li class="check">✓ coding required (~ 200 LOC)</li>
</ul>
</div>
<div id="option3pillar" class="step" data-x="4900" data-y="-50">
<p class="center">The metadata as defined inside Salt</p>
<p> </p>
<pre>
[root@saltmaster ~]# cat /srv/pillar/provisioning.sls
requisition: mainsite
opennms_categories: 'production,servers'
opennms_assetinfo: { comment: 'Server a' }
</pre>
<p class="smaller">Tip: reuse this metadata in the <em>motd →</em></p>
</div>
<div id="option3motd" class="step" data-x="5900" data-y="0">
<p>in the motd...</p>
<img src="media/motd.png">
</div>
<div id="option3sshot1" class="step" data-x="4900" data-y="550">
<p class="center">How it looks like in OpenNMS...</p>
<img src="media/opennms_salt_requisition.png">
</div>
<div id="option3sshot2" class="step" data-x="4900" data-y="1050">
<p class="center">The node page</p>
<img src="media/opennms_provisioned_node.png">
</div>
<div id="concept" class="step" data-x="-2500" data-y="1000">
<span id="line1" class="line">META - Food for Thought</span>
<ul>
<li>Integrability matters</li>
<li>Automation is a requirement</li>
<li>Software Defined X (Infrastructure, Network) is here</li>
<li>'Let yourself go with the Flow?' Session</li>
</ul>
</div>
<div id="end" class="step" data-x="0" data-y="0" data-scale="6">
<p id="qa">Q<span class="smaller">&</span>A</p>
<p id="codelink">Code & slides: <a href="https://github.com/unicolet/ouce2013">bit.ly/ouce2013</a></p>
<p id="thanks">thanks</p>
</div>
</div> <!-- close #impress -->
<script src="js/impress.js"></script>
<script>
impress().init();
var backgroundscene=document.getElementById("backgroundscene");
document.getElementById("start").addEventListener("impress:stepenter", function (event) {
backgroundscene.classList.add("samurai-background");
}, false);
document.getElementById("start").addEventListener("impress:stepleave", function (event) {
backgroundscene.classList.remove("samurai-background");
}, false);
//document.getElementById("concept").addEventListener("impress:stepenter", function (event) {
// backgroundscene.classList.add("merlin-background");
//}, false);
//document.getElementById("concept").addEventListener("impress:stepleave", function (event) {
// backgroundscene.classList.remove("merlin-background");
//}, false);
</script>
<!--
The `impress()` function also gives you access to the API that controls the presentation.
Just store the result of the call:
var api = impress();
and you will get three functions you can call:
`api.init()` - initializes the presentation,
`api.next()` - moves to next step of the presentation,
`api.prev()` - moves to previous step of the presentation,
`api.goto( idx | id | element, [duration] )` - moves the presentation to the step given by its index number
id or the DOM element; second parameter can be used to define duration of the transition in ms,
but it's optional - if not provided default transition duration for the presentation will be used.
You can also simply call `impress()` again to get the API, so `impress().next()` is also allowed.
Don't worry, it wont initialize the presentation again.
For some example uses of this API check the last part of the source of impress.js where the API
is used in event handlers.
-->
</body>
</html>