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 - Testsysteme automatisieren mit Vagrant und Puppet
Search
Bastian Spanneberg
November 11, 2013
Technology
0
110
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
86
Continuous Delivery. Lessons (Not) Learned.
spanneberg
0
170
Deployments automatisieren und testen mit Ansible und ServerSpec
spanneberg
0
420
Other Decks in Technology
See All in Technology
TypeScript Quiz (Encraft #12 Frontend Quiz Night)
uhyo
6
800
10分でわかるfreeeのQA
freee
0
260
任意コード実行の原理
ffri
0
190
KTC_DBRE.pdf
_awache
1
290
BDD(Cucumber)コミュニティが無料提供しているコンテンツの紹介と現在起きている危機
nihonbuson
4
750
オブジェクトのおしゃべり大失敗 メッセージングアンチパターン集 / messaging anti-pattern collection
ytake
0
340
Kubeflow Pipelines v2 で変わる機械学習パイプライン開発
asei
4
340
GraphQLに入門してみた
chiroruxx
2
130
匠MethodとRDRAとICONIXとDDDで実現する一気通貫オブジェクト指向開発
haru860
4
2.1k
AMLD 2024 - Build Your Own GPT
donlelef
1
260
ビジネスロジックを「型」で表現するOOPのための関数型DDD / Functional And Type-Safe DDD for OOP
yuitosato
29
12k
今さら聞けない!? AWSの生成AIサービス Amazon Bedrock入門!
minorun365
PRO
11
2.7k
Featured
See All Featured
Reflections from 52 weeks, 52 projects
jeffersonlam
343
19k
Build The Right Thing And Hit Your Dates
maggiecrowley
23
1.9k
5 minutes of I Can Smell Your CMS
philhawksworth
199
19k
Stop Working from a Prison Cell
hatefulcrawdad
265
19k
Making Projects Easy
brettharned
106
5.4k
Documentation Writing (for coders)
carmenintech
59
3.8k
Fireside Chat
paigeccino
19
2.6k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
272
12k
Web Components: a chance to create the future
zenorocha
304
41k
Mobile First: as difficult as doing things right
swwweet
215
8.5k
Bash Introduction
62gerente
604
210k
The Language of Interfaces
destraynor
150
23k
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