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
130
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
More Decks by Bastian Spanneberg
See All by Bastian Spanneberg
The road to SRE
spanneberg
0
110
Continuous Delivery. Lessons (Not) Learned.
spanneberg
0
190
Deployments automatisieren und testen mit Ansible und ServerSpec
spanneberg
0
490
Other Decks in Technology
See All in Technology
AI Adaptable なテストを整える工夫 / Ways to Make Your Tests AI-Adaptable
bitkey
PRO
3
220
Terraformモジュールは、なぜ「魔境」化するのか
hayama17
1
210
Platform Engineering as a Product: Criteria for Improvement and Multi-Tenant Design
kumorn5s
0
520
ITエンジニアを取り巻く環境とキャリアパス / A career path for Japanese IT engineers
takatama
4
1.8k
AI フレンドリーなエラー監視を TypeScript で実現する
shinyaigeek
2
270
そのPoC、何を検証したつもりでしたか? AIプロダクトの価値検証で陥った落とし穴
techtekt
PRO
0
150
Rubyで音を視る
ydah
1
100
AWSシリコン最前線 〜AI時代のチップ選択を読み解く〜
htokoyo
1
190
速さだけじゃない! VoidZero ツールが移行先に選ばれる理由
mizdra
PRO
6
760
Build with AI 楽しむ!アイデアを形に
norikotakiguchi
0
100
AIを「創る」と「使う」の循環 — HRテックが実践するリアルなAI組織実装
taketo957
0
1.7k
Socrates × Looker 〜セマンティックレイヤーで進化するデータ分析エージェント〜
hanon52_
0
230
Featured
See All Featured
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
1.1k
RailsConf 2023
tenderlove
30
1.5k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.3k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
71
40k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Thoughts on Productivity
jonyablonski
76
5.2k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
550
Chasing Engaging Ingredients in Design
codingconduct
0
210
The Cult of Friendly URLs
andyhume
79
6.9k
Everyday Curiosity
cassininazir
0
220
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
380
The SEO Collaboration Effect
kristinabergwall1
1
480
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