Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Continuous Lifecycle 2013: Mit Puppen spielen -...
Search
Bastian Spanneberg
November 11, 2013
Technology
0
120
Continuous Lifecycle 2013: Mit Puppen spielen - Testsysteme automatisieren mit Vagrant und Puppet
Slides zu meinem Vagrant/Puppet Talk auf der Continuous Lifecycle 2013 in Karlsruhe
Bastian Spanneberg
November 11, 2013
Tweet
Share
More Decks by Bastian Spanneberg
See All by Bastian Spanneberg
The road to SRE
spanneberg
0
100
Continuous Delivery. Lessons (Not) Learned.
spanneberg
0
180
Deployments automatisieren und testen mit Ansible und ServerSpec
spanneberg
0
450
Other Decks in Technology
See All in Technology
解析の定理証明実践@Lean 4
dec9ue
0
180
PHP開発者のためのSOLID原則再入門 #phpcon / PHP Conference Japan 2025
shogogg
4
890
Kotlin Coroutine Mechanisms: A Surprisingly Deep Rabbithole
amanda_hinchman
2
100
Amazon S3標準/ S3 Tables/S3 Express One Zoneを使ったログ分析
shigeruoda
4
570
あなたの声を届けよう! 女性エンジニア登壇の意義とアウトプット実践ガイド #wttjp / Call for Your Voice
kondoyuko
4
480
~宇宙最速~2025年AWS Summit レポート
satodesu
1
1.9k
本が全く読めなかった過去の自分へ
genshun9
0
620
Oracle Audit Vault and Database Firewall 20 概要
oracle4engineer
PRO
3
1.7k
登壇ネタの見つけ方 / How to find talk topics
pinkumohikan
5
540
Node-REDのFunctionノードでMCPサーバーの実装を試してみた / Node-RED × MCP 勉強会 vol.1
you
PRO
0
120
急成長を支える基盤作り〜地道な改善からコツコツと〜 #cre_meetup
stefafafan
0
130
Snowflake Summit 2025全体振り返り / Snowflake Summit 2025 Overall Review
mtpooh
2
420
Featured
See All Featured
Why Our Code Smells
bkeepers
PRO
337
57k
How to train your dragon (web standard)
notwaldorf
94
6.1k
Why You Should Never Use an ORM
jnunemaker
PRO
58
9.4k
Done Done
chrislema
184
16k
Bash Introduction
62gerente
614
210k
Being A Developer After 40
akosma
90
590k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
161
15k
GitHub's CSS Performance
jonrohan
1031
460k
Practical Orchestrator
shlominoach
188
11k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.2k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
35
2.4k
Git: the NoSQL Database
bkeepers
PRO
430
65k
Transcript
codecentric AG Mit Puppen spielen Testsysteme automatisieren mit Vagrant und
Puppet Bastian Spanneberg @spanneberg
codecentric AG Testsysteme ?
codecentric AG [Gefühlte] Wahrheit: Wo verbringen Entwickler/QAs? Testsystem Produktion
codecentric AG Dokumentation?
codecentric AG Wie solide sind Testsysteme gebaut?
codecentric AG Das geht besser!
codecentric AG Los geht's ... > vagrant init precise64 http://.../precise64.box
> vagrant up > vagrant ssh
codecentric AG Vagrantfile Vagrant.configure("2") do |config| config.vm.box = "precise64" config.vm.box_url
= “..." end
codecentric AG ... > vagrant package > vagrant halt >
vagrant destroy > vagrant provision
codecentric AG Synced Folders config.vm.synced_folder "path_on_host", "/opt/guest_path" config.vm.synced_folder ... owner:
“foo”, group: “bar”, nfs: true, disabled: true
codecentric AG Networking config.vm.network :forwarded_port, guest: 80, host: 8080 [,auto_correct:
true] config.vm.network :private_network, ip: "192.168.50.4" config.vm.network :public network
codecentric AG Multi VM Umgebungen config.vm.define "app01" do |app01| app01.vm.host_name
= “app.local” app01.vm.box = "appserverimage" end config.vm.define "db01" do |db01| db01.vm.host_name = “db.local” db01.vm.box = "dbserverimage" end
codecentric AG Provisioning (Shell) Vagrant.configure("2") do |config| config.vm.box = "precise64"
config.vm.provision :shell, inline: "echo 'Vagrant was here!' > /etc/motd.tail" end
codecentric AG Provisioning (Puppet) config.vm.provision :puppet do |puppet| puppet.manifests_path =
"manifests" puppet.module_path = "modules" puppet.manifest_file = "site.pp" puppet.options = "..." end
codecentric AG Puppet – Resourcen resource_type { 'name' : attribut1
=> wert1, attribut2 => wert2, … } • Zustandbeschreibung • Keine garantierte Reihenfolge • Idempotenz
codecentric AG Puppet – Verbreitete Resourcen (1) file { '/etc/motd.tail'
: ensure => present, owner => root, group => root, mode => 644, content => 'This machine is managed by Puppet' } • Für Files, Links, Directories • “source” für Verweis auf externe Dateien • Ruby Templates
codecentric AG Puppet – Verbreitete Resourcen (2) package { 'apache2'
: ensure => installed, } service { 'apache2' : ensure => running, require => Package['apache2'], }
codecentric AG Puppet – Verbreitete Resourcen (3) group { 'foo'
: ensure => present, } user { 'foo' : ensure => present, gid => 'foo', managehome => true, shell => '/bin/bash', }
codecentric AG Puppet – Verbreitete Resourcen (4) exec { 'dltomcat'
: command => '/usr/bin/wget … foo.tgz', cwd => '/tmp', creates => '/tmp/foo.tgz', } exec { 'unpacktomcat' : command => '/bin/tar xzf …', unless => '/usr/bin/test d …', require => Exec['dltomcat'], }
codecentric AG Puppet – Metaparameter type { 'foobar' : before
=> …, require => …, notify => …, subscribe => …, alias => …, } • Auf alle Typen anwendbar • Modellierung von Abhängigkeiten
codecentric AG Puppet – Fakten, Klassen, Module, Nodes • Fakten
→ Infos über das System • Klassen → Gruppierung von Resourcen • Module → Wiederverwendung • Nodes → Beschreibung von Hosts → Demo
codecentric AG Puppet - Forge → forge.puppetlabs.com > puppet module
install mysql • Module für nahezu jeden Zweck • Guter Startpunkt zum Vertiefen
codecentric AG Puppet – Best Practice • Komma nach den
Attributes • Einrückung. Spaces. • Execs vermeiden! • Pakte verwenden wenn möglich • Lohnt sich ein eigenes Paket? • Potentiale für Wiederverwendung finden
codecentric AG Next step: Infrastruktur-Projekt ./modules/ ./manifests/ ./hiera/common.yaml ./hiera/local.yaml ./hiera/test.yaml
./hiera/staging.yaml ./Vagrantfile • Grundlage für Zusammenarbeit mit Betrieb • Reviews. Pair Programming. DevOps-Kultur :)
codecentric AG Next interesting steps • Puppetmaster • Dashboards: The
Foreman, Puppet Enterprise • mcollective • Puppet + rspec • Vagrant Cloud Provider (AWS, OpenStack) • Vagrantfile = Ruby-Skript • Custom Facts + Function mit Ruby
codecentric AG Danke! Fragen? • Wir suchen Kollegen! • Karlsruhe
:) • München • Hamburg • Frankfurt • Berlin • Düsseldorf • Solingen