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
年末調整プロダクトの内部品質改善活動について
kaomi_wombat
0
180
お問い合わせ対応の改善取り組みとその進め方
masartz
1
280
LINEギフトのLINEミニアプリアクセシビリティ改善事例
lycorptech_jp
PRO
0
210
React Server Componentは 何を解決し何を解決しないのか / What do React Server Components solve, and what do they not solve?
kaminashi
6
1.1k
ソフトウェアプロジェクトの成功率が上がらない原因-「社会価値を考える」ということ-
ytanaka5569
0
120
View Transition API
shirakaba
1
910
Cloud Native PG 使ってみて気づいたことと最新機能の紹介 - 第52回PostgreSQLアンカンファレンス
seinoyu
0
160
ドメインイベントを活用したPHPコードのリファクタリング
kajitack
2
1.1k
コード品質向上で得られる効果と実践的取り組み
ham0215
1
200
LINE API Deep Dive Q1 2025: Unlocking New Possibilities
linedevth
1
150
SpannerとAurora DSQLの同時実行制御の違いに想いを馳せる
masakikato5
0
550
パスキー導入の課題と ベストプラクティス、今後の展望
ritou
7
1.2k
Featured
See All Featured
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Navigating Team Friction
lara
183
15k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
30
2.3k
Rails Girls Zürich Keynote
gr2m
94
13k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Facilitating Awesome Meetings
lara
53
6.3k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
30k
A better future with KSS
kneath
238
17k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7.1k
Into the Great Unknown - MozCon
thekraken
35
1.7k
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