-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
956 lines (853 loc) · 33 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
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Configuration Management with Puppet</title>
<meta name="description" content="A framework for easily creating beautiful presentations using HTML">
<meta name="author" content="Hakim El Hattab">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="css/reveal.min.css">
<link rel="stylesheet" href="css/theme/default.css" id="theme">
<!-- For syntax highlighting -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<!-- If the query includes 'print-pdf', use the PDF print sheet -->
<script>
document.write( '<link rel="stylesheet" href="css/print/' + ( window.location.search.match( /print-pdf/gi ) ? 'pdf' : 'paper' ) + '.css" type="text/css" media="print">' );
</script>
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<section>
<img style='background-color: none; background: none; box-shadow: none; border: none;' src="files/puppet-logo2.png" alt="Puppet" />
<h1>Configuration Management</h1>
<h3>With Puppet</h3>
<p>
<small>
Created by <a href="http://carroarmato0.be">Christophe Vanlancker</a> / <a href="http://twitter.com/carroarmato0">@carroarmato0</a>
</small>
</p>
</section>
<section>
<h2>Who</h2>
<img src='files/me.jpeg' alt='Me' />
<ul>
<li>Christophe Vanlancker</li>
<li>Senior Junior Sysadmin & Open Source Consultant at Inuits</li>
<li>Internal operations and maintainer Mediasalsa</li>
</ul>
</section>
<section>
<section>
<h2>What</h2>
<ul>
<li>Maintain 131+ machines (internally)</li>
<li>Monitoring</li>
<li>Metrics</li>
<li>Updates</li>
<li>Configuration</li>
</ul>
</section>
<section>
<p class='fragment'>I am not alone...</p>
</section>
<section>
<p>Many colleagues</p>
<p>Many changes</p>
</section>
<section>
<h3>Fundamental Questions:</h3>
<ul>
<li>Who did what?</li>
<li>What has changed?</li>
<li>What were the previous configurations?</li>
</ul>
<img style="background-color: none; background: none; box-shadow: none; border: none; padding-top: 50px; display: block; margin: 0px auto;" src='files/developermodel.gif' alt='Not Devops' />
</section>
</section>
<section>
<h2>Past</h2>
<ul>
<li>Complex, expensive, machines</li>
<li>Slow changes</li>
<li>In-Depth documentation</li>
</ul>
<img style="background-color: none; background: none; box-shadow: none; border: none; padding-top: 50px; display: block; margin: 0px auto;" src='files/documentation.gif' alt='Documentation' />
</section>
<section>
<section>
<h2>Present</h2>
<ul>
<li>Virtualization</li>
<li>Many many machines</li>
<li>Dynamic Environments</li>
<li>Lot of changes</li>
</ul>
</section>
<section>
<h2>Present Types of Deployments</h2>
<h3>Manual changes</h3>
<ul>
<li>Repetitive</li>
<li>Time Consuming</li>
<li>Error prone</li>
<li>Inconsistency risk</li>
<li>Documentation need be kept up-to-date</li>
<li>Disaster? HF, hope docs are up to date and backups are working</li>
</ul>
</section>
<section>
<h2>Present Types of Deployments</h2>
<h3>Golden Image</h3>
<ul>
<li>Define state of machine and distribute</li>
<li>Static ?</li>
<li>Change means recreating image and redistribution</li>
<li>Prevent people from monkeying around?</li>
</ul>
</section>
<section>
<h2>Present Types of Deployments</h2>
<h3>Shady Wannabe</h3>
<ul>
<li>No shared knowledge</li>
<li>Insane solution</li>
<li>Shady documentation</li>
<li>No community</li>
<li>Possibly proprietary</li>
</ul>
</section>
<section>
<h2>Enter Configuration Management</h2>
<small>aka cfgmgmt</small>
</section>
</section>
<section>
<section>
<h2>Configuration Management</h2>
<blockquote>
Systems engineering process for establishing and maintaining consistency of a product's performance, functional and physical attributes with its requirements, design and operational information throughout its life.
</blockquote>
</section>
<section>
<h2>Configuration Management</h2>
<ol>
<li>Configuration Identification</li>
<li>Configuration Control</li>
<li>Configuration Status Accounting</li>
<li>Configuration Audits</li>
</ol>
</section>
<section>
<p>To put it more simply:</p>
<img style="background-color: none; background: none; box-shadow: none; border: none; padding-top: 50px; display: block; margin: 0px auto;" src='files/change.gif' alt='Cfgmgmt' />
</section>
<section>
<p>Idempotence (/ˌaɪdɨmˈpoʊtəns/ eye-dəm-poh-təns)</p>
</section>
<section>
<h2>Configuration Management</h2>
<h3>Tools of trade</h3>
<img style='background-color: none; background: none; box-shadow: none; border: none;' src="files/puppet-logo.png" alt="Puppet" />
<img style='background-color: none; background: none; box-shadow: none; border: none;' src="files/chef-logo.jpg" alt="Chef" />
<img style='background-color: none; background: none; box-shadow: none; border: none;' src="files/cfengine-logo.jpg" alt="Cf-Engine" />
<img style='background-color: none; background: none; box-shadow: none; border: none;' src="files/saltstack-logo.jpg" alt="Salt" />
<p>and many others...</p>
</section>
</section>
<section>
<section>
<img style='background-color: none; background: none; box-shadow: none; border: none;' src="files/puppet-logo2.png" alt="Puppet" />
<h2>Puppet</h2>
<ul>
<li>2005</li>
<li>Ruby + Ruby DSL</li>
<li>Unix-like and Windows</li>
<li>Declarative</li>
</ul>
</section>
<section>
<h2>Puppet</h2>
<h3>Resources</h3>
<ul>
<li>User account</li>
<li>Specific file</li>
<li>Directory of files</li>
<li>Software Package</li>
<li>Running Service</li>
<li>Scheduled Cron Job</li>
<li>Invocation of a shell command</li>
<li>...</li>
</ul>
</section>
<section>
<h2>Puppet</h2>
<h3>Resources - types</h3>
<pre><code data-trim>
Type -> user { 'dave': <- Title
ensure => present,
Attribute -> uid => '507', <- Value
gid => 'admin',
shell => '/bin/zsh',
home => '/home/dave',
managehome => true,
}
</code></pre>
</section>
<section>
<h2>Puppet</h2>
<h3>Resources - types</h3>
<img style='background-color: none; background: none; box-shadow: none; border: none;' src="files/puppet-types.png" alt="Puppet Types" />
</section>
<section>
<h2>Puppet</h2>
<ul>
<li>Manifests: resource declarations</li>
<li>Modules: bundle of manifests with a specific purpose</li>
</ul>
</section>
<section>
<h2>Puppet</h2>
<p>Modules can be found on the Forge (https://forge.puppetlabs.com/)</p>
<p>But github is the place to be</p>
</section>
<section>
<h2>Puppet</h2>
<pre><code data-trim>
├── manifests
│ ├── hosts
│ | └── example.pp
│ └── site.pp
└── modules
└── ntp
├── manifests
│ ├── config.pp
│ ├── init.pp
│ ├── install.pp
│ ├── params.pp
│ └── service.pp
└── templates
├── ntp.conf.archlinux.erb
├── ntp.conf.debian.erb
├── ntp.conf.el.erb
├── ntp.conf.freebsd.erb
├── ntp.conf.gentoo.erb
└── ntp.conf.suse.erb
</code></pre>
</section>
<section>
<h2>Puppet</h2>
<img style='background-color: none; background: none; box-shadow: none; border: none;' src="files/compilation.png" alt="Puppet Compilation" />
</section>
<section>
<h2>Puppet</h2>
<img style='background-color: none; background: none; box-shadow: none; border: none;' src="files/state.png" alt="Puppet State" />
</section>
<section>
<h2>Puppet</h2>
<h3>Facter</h3>
<pre><code data-trim>
[carroarmato0:~] $ facter -p
architecture => amd64
augeasversion => 1.1.0
blockdevice_sda_model => LITEONIT LCT-256
blockdevice_sda_size => 256060514304
blockdevice_sda_vendor => ATA
blockdevice_sr0_model => DVD+-RW UJ8B2
blockdevice_sr0_size => 1073741312
blockdevice_sr0_vendor => MATSHITA
blockdevices => sda,sr0
facterversion => 1.7.0
filesystems => ext2,ext3,ext4,vfat
hardwareisa => x86_64
hardwaremodel => x86_64
hostname => neon-flower
id => carroarmato0
interfaces => eth0,lo,wlan0
ipaddress => 127.0.1.1
ipaddress_lo => 127.0.0.1
is_virtual => false
kernel => Linux
kernelmajversion => 3.11
kernelrelease => 3.11.0-15-generic
kernelversion => 3.11.0
lsbdistcodename => saucy
lsbdistdescription => Ubuntu 13.10
lsbdistid => Ubuntu
lsbdistrelease => 13.10
lsbmajdistrelease => 13
macaddress => d4:be:d9:68:25:73
macaddress_eth0 => d4:be:d9:68:25:73
macaddress_wlan0 => 60:67:20:7c:26:98
memoryfree => 6.69 GB
memoryfree_mb => 6851.83
memorysize => 7.75 GB
memorysize_mb => 7936.18
memorytotal => 7.75 GB
mtu_eth0 => 1500
mtu_lo => 65536
mtu_wlan0 => 1500
netmask_lo => 255.0.0.0
network_lo => 127.0.0.0
operatingsystem => Ubuntu
operatingsystemrelease => 13.10
osfamily => Debian
rvm/bin
physicalprocessorcount => 1
processor0 => Intel(R) Core(TM) i7-3630QM CPU @ 2.40GHz
processor1 => Intel(R) Core(TM) i7-3630QM CPU @ 2.40GHz
processor2 => Intel(R) Core(TM) i7-3630QM CPU @ 2.40GHz
processor3 => Intel(R) Core(TM) i7-3630QM CPU @ 2.40GHz
processor4 => Intel(R) Core(TM) i7-3630QM CPU @ 2.40GHz
processor5 => Intel(R) Core(TM) i7-3630QM CPU @ 2.40GHz
processor6 => Intel(R) Core(TM) i7-3630QM CPU @ 2.40GHz
processor7 => Intel(R) Core(TM) i7-3630QM CPU @ 2.40GHz
processorcount => 8
ps => ps -ef
puppetversion => 3.2.4
rubysitedir => /usr/local/lib/site_ruby/1.9.1
rubyversion => 1.9.3
selinux => false
swapfree => 7.95 GB
swapfree_mb => 8144.00
swapsize => 7.95 GB
swapsize_mb => 8144.00
timezone => CET
uniqueid => 007f0101
uptime => 0:16 hours
uptime_days => 0
uptime_hours => 0
uptime_seconds => 1014
virtual => physical
</code></pre>
</section>
<section>
<h2>Puppet</h2>
<h3>module/virtinstall</h3>
<pre><code data-trim>
Virtinstall::Bootstrap {
ensure => 'present',
bootstrap_method => 'kickstart',
vm_netbridge => hiera('kvm_bridge'),
vm_netmask => hiera('br0_netmask'),
vm_gateway => $::ipaddress_br0,
vm_nameserver => hiera('nameserver'),
vm_domain => hiera('vm_default_domain', 'internal.inuits.eu'),
vm_os_name => 'centos',
vm_os_version => '6',
vm_ram => hiera('vm_default_ram_size', '1024'),
vm_lvm_lv_size => hiera('vm_default_lv_size', '10g'),
vm_lvm_vg_name => hiera('vm_default_vg_name', "vg_${::hostname}"),
datacenter => $::datacenter,
plannedenvironment => hiera('vm_environment', 'production'),
bootstrap_url_mirror => 'http://pulp2.internal.inuits.eu/pulp/repos/pub/centos/6/os/x86_64/',
bootstrap_baseurl => "http://${::ipaddress_br0}/bootstrap",
tag => 'vms',
}
</code></pre>
</section>
<section>
<h2>Puppet</h2>
<h3>module/virtinstall preseed Debian</h3>
<pre><code data-trim>
virtinstall::bootstrap{'mediasalsa01.infradev.mediasalsa.eu':
vm_ipaddress => '10.0.49.11',
vm_vcpus => '2',
vm_ram => '4096',
vm_os_name => 'debian',
bootstrap_method => 'preseed',
bootstrap_url_mirror => 'http://ftp.be.debian.org/debian/dists/squeeze/main/installer-amd64',
}
</code></pre>
</section>
<section>
<h2>Puppet</h2>
<h3>module/virtinstall preseed Debian</h3>
<pre><code data-trim>
#### Squeeze preseed file
### Localization
d-i debian-installer/locale string <%= vm_locale %>
d-i console-keymaps-at/keymap select <%= vm_keymap %>
### Network configuration
d-i netcfg/choose_interface select <%= bootstrap_device %>
d-i netcfg/disable_dhcp boolean true
d-i netcfg/confirm_static boolean true
d-i netcfg/get_hostname string <%= vm_hostname %>
d-i netcfg/get_domain string <%= vm_domain %>
d-i netcfg/get_ipaddress string <%= vm_ipaddress %>
d-i netcfg/get_netmask string <%= vm_netmask %>
d-i netcfg/get_gateway string <%= vm_gateway %>
d-i netcfg/get_nameservers string <%= vm_nameserver %>
</code></pre>
</section>
<section>
<h2>Puppet</h2>
<h3>module/virtinstall run</h3>
<img style='background-color: none; background: none; box-shadow: none; border: none;' src="files/clean.png" alt="Puppet Clean Run" />
</section>
<section>
<h2>Puppet</h2>
<h3>Environments</h3>
<p>Different Environment = Different Puppet code</p>
<p class='fragment'>or</p>
<p class='fragment'>Different $customer = Different Repository...</p>
</section>
<section>
<h2>Puppet</h2>
<h3>Environments</h3>
<h4>On the clients</h4>
<p>/etc/puppet/puppet.conf</p>
<pre><code data-trim>
...
environment = production
...
</code></pre>
<pre><code data-trim>
...
environment = development
...
</code></pre>
<h4>On the Master</h4>
<pre><code data-trim>
manifest = \$confdir/environments/\$environment/manifests/site.pp
modulepath = \$confdir/environments/\$environment/modules
</code></pre>
</section>
<section>
<h2>Puppet</h2>
<h3>Exported Resources</h3>
<br>
<h4>(Local) Resource</h4>
<hr>
<pre><code data-trim>
user { 'steve': home => '/home/steve' }
</code></pre>
<br>
<h4>Exported Resource</h4>
<hr>
<pre><code data-trim>
@@user { 'steve': home => '/home/steve' }
</code></pre>
</section>
<section>
<h2>Puppet</h2>
<h3>Exported Resources</h3>
<pre><code data-trim>
@@nagios_host { $fqdn: ....}
</code></pre>
<pre><code data-trim>
Nagios_host <<| |>> { notify => Service[$::icinga::service_server] }
Nagios_service <<| |>> { notify => Service[$::icinga::service_server] }
Nagios_hostextinfo <<| |>> { notify => Service[$::icinga::service_server] }
Nagios_command <<| |>> { notify => Service[$::icinga::service_server] }
Nagios_contact <<| |>> { notify => Service[$::icinga::service_server] }
Nagios_contactgroup <<| |>> { notify => Service[$::icinga::service_server] }
Nagios_hostdependency <<| |>> { notify => Service[$::icinga::service_server] }
Nagios_hostescalation <<| |>> { notify => Service[$::icinga::service_server] }
</code></pre>
</section>
<section>
<h2>Puppet</h2>
<h3>Exported Resources with tags</h3>
<h4>Exporter</h4>
<pre><code data-trim>
@@apache_vhost {'mysite.example.org':
...
tag => 'hypervisor02.example.org',
}
</code></pre>
<h4>Collector</h4>
<pre><code data-trim>
node 'hypervisor02.example.org' {
Apache::Vhost <<| tag == $::fqdn |>> {}
...
}
</code></pre>
</section>
<section>
<h2>Puppet</h2>
<h3>Exported Resources</h3>
<p>In the past stored in DB (mysql/mariadb)</p>
<p>Intensive for massive collectors (monitoring, central backup, ...)</p>
<p>Introduction of PuppetDB</p>
</section>
<section>
<h2>Puppet</h2>
<h3>PuppetDB</h3>
<p>PuppetDB collects data generated by Puppet.</p>
<p>It enables advanced Puppet features like the inventory service and exported resources, and can be the foundation for other applications that use Puppet’s data.</p>
</section>
<section>
<h2>Puppet</h2>
<h3>PuppetDB</h3>
<h4>Before / After</h4>
<img style='background-color: none; background: none; box-shadow: none; border: none;' src="files/puppetdb.png" alt="PuppetDB" />
</section>
</section>
<section>
<section>
<h2>Hiera</h2>
<p><small>Variable lookup</small></p>
<p><small>Data and code separation</small></p>
</section>
<section>
<h2>Hiera</h2>
<pre><code data-trim>
---
eth0_ipaddr: '10.0.33.3'
mysql_stats_user: 'someuser'
mysql_stats_pw: 'somepassword'
serveraliases:
- 'www.mywebsite.nl'
- 'mywebsite.nl'
- 'www.yetanotherwebsite.nl'
- 'yetanotherwebsite.nl'
- 'www.ithinkyougotthis.nl'
- 'ithinkyougotthis.nl'
mysql_root_pass: 'WoudntYouLikeToKnow'
mysql_site_pass: 'nOt7oDaY'
mysite_sitename: 'My Site Production'
mysite_siteroot: '/var/vhosts/mysite.nl/htdocs/'
</code></pre>
</section>
<section>
<h2>Hiera</h2>
<pre><code data-trim>
node /mysite/ {
########################################
# BEWARE, changes here have effect on: #
# mysite and mysite-staging #
########################################
$mysite_vhost_name = hiera('mysite_vhost_name')
$mysite_siteroot = hiera('mysite_siteroot')
$mysite_cron_url = hiera('mysite_cron_url')
$mysite_cron_key = hiera('mysite_cron_key')
$mysql_site_pass = hiera('mysql_mysite_pass')
$server_aliases = hiera('serveraliases')
</code></pre>
</section>
<section>
<h2>Hiera</h2>
<pre><code data-trim>
include drupal7
drupal7::config { $mysite_vhost_name:
drupal_sitename => hiera('mysite_sitename'),
siteroot => $mysite_siteroot,
config_basepath => hiera('mysite_config_basepath'),
database_host => '127.0.0.1',
database_name => 'mysite',
database_user => 'mysite',
database_password => $mysql_site_pass,
dedicated_cron => true,
is_multidomain => true,
environment => hiera('drupal_environment', 'production'),
cronkey => $mysite_cron_key,
cron_url => $mysite_cron_url,
}
</code></pre>
</section>
<section>
<h2>Hiera</h2>
<h3>Lookup hierarchy</h3>
<pre><code data-trim>
---
:backends:
- yaml
:logger: console
:hierarchy:
- clients/%{environment}/%{hostname}
- hypervisors/%{hypervisor}
- hypervisors/common
- locations/%{datacenter}
- environments/%{environment}
- ostype/%{operatingsystem}
- common
:yaml:
:datadir: /etc/puppet/hieradata
</code></pre>
</section>
<section>
<h2>Puppet Roles + Hiera</h2>
<pre><code data-trim>
node /www/ {
include apache
include ntp
include php
...
}
</code></pre>
<img style='background-color: none; background: none; box-shadow: none; border: none;' src='files/new-host.gif' alt='New Host' />
</section>
</section>
<section>
<section>
<img style='background-color: none; background: none; box-shadow: none; border: none;' src="files/foreman_large.png" alt="Foreman" />
</section>
<section>
<h2>Foreman</h2>
<ul>
<li>Complete lifecycle management tool for physical and virtual servers</li>
<li>Paul Kelly and Ohad Levy (2009)</li>
<li>From simple central Puppet Report overview to automated deployment (not limited to Puppet!)</li>
<li>Multitenancy</li>
<li>Internal auth / Ldap</li>
<li>API</li>
<li>Smart-Proxy </li>
</ul>
</section>
<section>
<img style='background-color: none; background: none; box-shadow: none; border: none;' src="files/host_listing.png" alt="Foreman Hosts" />
</section>
<section>
<img style='background-color: none; background: none; box-shadow: none; border: none;' src="files/reportview.png" alt="Foreman Report View" />
</section>
<section>
<img style='background-color: none; background: none; box-shadow: none; border: none;' src="files/Foreman+LXC.png" alt="Foreman LXC" />
</section>
<section>
<img style='background-color: none; background: none; box-shadow: none; border: none;' src="files/hosteditpage.png" alt="Foreman Edit Host" />
</section>
<section>
<h2>Foreman</h2>
<p>Provision on bare metal and cloud</p>
<img style='background-color: none; background: none; box-shadow: none; border: none;' src="files/aws_logo.png" alt="AWS EC2" />
<img style='background-color: none; background: none; box-shadow: none; border: none;' src="files/google_compute_engine.png" alt="Google Compute Engine" />
<img style='background-color: none; background: none; box-shadow: none; border: none;' src="files/libvirtLogo.png" alt="LibVirt" />
<img style='background-color: none; background: none; box-shadow: none; border: none;' src="files/openstack.png" alt="OpenStack" />
<img style='background-color: none; background: none; box-shadow: none; border: none;' src="files/ovirt.png" alt="oVirt" />
<img style='background-color: none; background: none; box-shadow: none; border: none;' src="files/rackspace.jpg" alt="Rackspace" /
>
<img style='background-color: none; background: none; box-shadow: none; border: none;' src="files/vsphere_logo.png" alt="VmWare vSphere" />
</section>
</section>
<section>
<section>
<h2>Deployment Strategies</h2>
</section>
<section>
<h2>Deployment Strategies</h2>
<h3>Tools of trade</h3>
<ul>
<li>Git - versioning</li>
<li>Jenkins - CI</li>
<li>FPM - Packaging</li>
<li>Pulp - Repositories</li>
<li>MCollective / SSH - Some deployment strategy</li>
</ul>
</section>
<section>
<h2>Deployment Strategies</h2>
<h3>Git</h3>
<p>Puppet Modules as Git Submodules</p>
</section>
<section>
<h2>Deployment Strategies</h2>
<h3>Puppet</h3>
<pre><code>
[puppet-inuits] master ± tree -L 2
.
├── manifests
│ ├── classes
│ ├── defaults
│ ├── hosts
│ └── site.pp
├── modules
│ ├── activemq
│ ├── apache
│ ├── apc
│ ├── apt
│ ├── augeas
│ ├── bacula
.....
</code></pre>
</section>
<section>
<h2>Deployment Strategies</h2>
<h3>Git - Initial clone</h3>
<pre><code>
git clone ssh://.....git
git submodule update --init
</code></pre>
</section>
<section>
<h2>Deployment Strategies</h2>
<h3>Git - Add submodule</h3>
<pre><code>
git submodule add ssh://.....git modules/<name module>
git add .gitmodules
git add module/<name module>
git commit -sm 'Add <name module>'
git push
</code></pre>
</section>
<section>
<h2>Deployment Strategies</h2>
<h3>Git - Update</h3>
<pre><code>
git pull --rebase
git submodule update --init
</code></pre>
</section>
<section>
<h2>Deployment Strategies</h2>
<h3>Git - tig</h3>
<img style='background-color: none; background: none; box-shadow: none; border: none;' src='files/git.png' alt='Tig' />
</section>
<section>
<h2>Deployment Strategies</h2>
<h3>Jenkins</h3>
<ul>
<li>CI Server (Continuous Integration)</li>
<li>Open Source</li>
<li>Fork of Hudson</li>
<li>Lots of Plugins</li>
<li>Jobs</li>
</ul>
<img style='background-color: none; background: none; box-shadow: none; border: none;' src='files/jenkins.jpg' alt='Jenkins' />
</section>
<section>
<h2>Deployment Strategies</h2>
<h3>Pipelines</h3>
<img style='background-color: none; background: none; box-shadow: none; border: none;' src='files/pipeline-puppet.png' alt='Puppet Pipeline' />
<br>
<img style='background-color: none; background: none; box-shadow: none; border: none;' src='files/pipeline-frontend.png' alt='Frontend Pipeline' />
<br>
<img style='background-color: none; background: none; box-shadow: none; border: none;' src='files/pipeline-backend.png' alt='Backend Pipeline' />
</section>
<section>
<h2>Deployment Strategies</h2>
<h3>Displaying Builds - zmon</h3>
<img style='background-color: none; background: none; box-shadow: none; border: none;' src='files/zmon.png' alt='zmon' />
</section>
<section>
<h2>Deployment Strategies</h2>
<h3>Displaying Builds - ganbatte</h3>
<small><a href="http://github.com/kalmanolah/ganbatte">github: kalmanolah/ganbatte</a></small>
<img style='background-color: none; background: none; box-shadow: none; border: none;' src='files/ganbatte.png' alt='Ganbatte' />
</section>
<section>
<h2>Deployment Strategies</h2>
<h3>Promotions</h3>
<img style='background-color: none; background: none; box-shadow: none; border: none;' src='files/pipeline-promotion.png' alt='Puppet Promotion' />
</section>
<section>
<h2>Deployment Strategies</h2>
<ol>
<li class='fragment'>Code</li>
<li class='fragment'>Deploy to Infradev</li>
<li class='fragment'>Feedback (Foreman for Puppet, Icinga for services)</li>
<li class='fragment'>Correct Code if necessary and repeat from step 2</li>
<li class='fragment'>Promote to UAT and repeat step 3</li>
<li class='fragment'>Promote to Production Environments</li>
</ol>
</section>
<section>
<h2>Deployment Strategies</h2>
<h3>Packaging</h3>
<p>fpm - Effing package managers! Build packages for multiple platforms (deb, rpm, etc) with great ease and sanity.</p>
<pre><code data-trim>
fpm -s dir -t rpm \
--name "${PACKAGE_NAME}" \
--version "${PACKAGE_VERSION}" \
--iteration "${PACKAGE_ITERATION}" \
--architecture noarch \
--prefix /etc/puppet/environments/${environment}/ \
--vendor 'Inuits' \
--description 'Puppet Tree' \
--maintainer 'Jenkins' \
--epoch '1' \
-C ${WORKSPACE} .
</code></pre>
</section>
<section>
<h2>Deployment Strategies</h2>
<p>Breakage on Infradev must result in predicatable breakage on UAT</p>
<p>Breakage on UAT must result in breakage in Production</p>
<p>Reality: not all envs are equal, but all possible tests should be run on Infradev</p>
</section>
<section>
<h2>Deployment Strategies</h2>
<h3>Repositories</h3>
<ul>
<li>Pulp</li>
<li>
Add pkg:
<pre><code data-trim>
pulp-admin rpm repo uploads rpm -f mypackage.rpm --repo-id=myrepo
</code></pre>
</li>
<li>
Rebuild metadata:
<pre><code data-trim>
pulp-admin rpm repo publish run --repo-id=myrepo
</code></pre>
</li>
</ul>
</section>
<section>
<h2>Deployment Strategies</h2>
<h3>Repositories</h3>
<p>Strive to have staged repositories</p>
</section>
<section>
<h2>Deployment Strategies</h2>
<h3>Mcollective / SSH</h3>
<p>Invalidate pkg manager cache and trigger update</p>
</section>
<section>
<h2>Deployment Strategies</h2>
<h3>Mcollective</h3>
<ul>
<li>Framework to build server orchestration or parallel job execution systems</li>
<li>Queuing Technology (RabbitMQ, ActiveMQ, ...)</li>
</ul>
<pre><code data-trim>
#Clean yum cache on node
sudo /usr/bin/mco rpc package yum_clean mode=expire-cache -I ${mcollectivenode}
#Trigger package update
sudo /usr/bin/mco rpc -t 1200 package update package=${packagename} -I ${mcollectivenode}
</code></pre>
</section>
</section>
<section>
<h2>THE END</h2>
<img style='background-color: none; background: none; box-shadow: none; border: none;' src='files/happyworks.gif' alt='Happy Works' />
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.min.js"></script>
<script>
// Full list of configuration options available here:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
slideNumber: true,
overview: true,
theme: Reveal.getQueryHash().theme, // available themes are in /css/theme
transition: Reveal.getQueryHash().transition || 'default', // default/cube/page/concave/zoom/linear/fade/none
// Parallax scrolling
// parallaxBackgroundImage: 'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg',
// parallaxBackgroundSize: '2100px 900px',
// Optional libraries used to extend on reveal.js
dependencies: [
{ src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: 'plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
{ src: 'plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } }
]
});
</script>
</body>
</html>