SlideShare una empresa de Scribd logo
1 de 32
Descargar para leer sin conexión
INFRASTRUKTUR MIT
ANSIBLE
Stephan Hochhaus ( @yauh ) 15. Januar 2014 bei der OpenTechSchool Dortmund .
WIE SIEHT EURE IT-INFRASTRUKTUR AUS?
Wer hat einen eigenen (Web-)Server?
Welches Betriebssystem?
Wie viele Server sind es?
Wie oft setzt ihr sie neu auf?
Wie lange dauert das Aufsetzen?
Wer hat schonmal ein Tutorial verfasst?
MEIN LEBEN VOR ANSIBLE
1.
2.
3.
4.
5.

Grundsystem per Hand installieren
Ggf. ausgefeilte shell-Skripte für Pakete ausführen
Manuelles Anpassen von Konfigurationsdateien
Fertiges System
Ausprobieren von neuer Software/Konfiguration,
andere Entwickler auf dem Server/Tests
6. Zerschießen des funktionierenden Systems
GEEKS SIND GEWINNERTYPEN
VORTEILE VON AUTOMATISIERUNG
Beliebige (und leichte) Wiederholbarkeit
Hohe Geschwindigkeit von Deployments
Wiederherstellen von bekannten Zuständen
Keine tiefen Systemkenntnisse notwendig
UND GANZ KONKRET
Schneller Aufbau von Testsystemen
Leichter Providerwechsel
Continuous-Integration-Workflows realisieren
"Zerschossene" Systeme wiederherstellen
WIESO NICHT SHELL/PERL-SKRIPTE?
Skripte werden schnell extrem komplex
Idempotenz - Unabhängig vom Ausgangszustand wird ein
definierter Endzustand hergestellt
(mehrfache Ausführung möglich)
Bessere Übersichtlichkeit und Struktur durch Abstraktion
Portabilität (z.B. verschiedene Linux Distros)
Deklarativer Ansatz erlaubt höhere Produktivität als
imperatives Vorgehen
(wie soll das Ergebnis aussehen vs. was soll getan werden)
Teilen von Playbooks mit Community
CONFIGURATION MANAGEMENT 2014

Stand: 13. Januar 2014 auf github
Leistungsfähige automation engine aus Basis von Playbooks
Keine Agents auf Zielsystemen notwendig
(SSH-Zugriff reicht)
Standardmäßig push-Architektur, pull möglich
Keine Programmierkenntnisse notwendig
(statt dessen YAML und Jinja2)
Aber funktional erweiterbar in beliebigen
Programmiersprachen
Kein Management von Windows oder Mac OS X
Integration in Amazon EC2, Rackspace, OpenStack, VMWare,
Vagrant, u.a.
AWX (Web-GUI)
ARCHITEKTURÜBERBLICK
KERNBESTANDTEILE VON ANSIBLE
Inventory - Beschreibt die Infrastruktur
Module - Stellen Funktionen zur Verfügung
Playbooks - Führen Aktionen in Infrastruktur durch
INVENTORY
Hosts - Zielsysteme (Linux)
Gruppen Organisatorische Zuordnung (z.B. geografisch, nach
Funktion oder als Mischung)
BEISPIEL HOSTS-DATEI
[esre]
wbevr
aah.xml.r
pceeapeog
lm.xml.r
apeapeog
[bevr
dsre]
d.xml.r
beapeog
lm.xml.r
apeapeog
[et
ts]
lm.xml.r
apeapeog
[rdcin
pouto]
aah.xml.r
pceeapeog
d.xml.r
beapeog

INI-Format
ES GIBT MODULE FÜR
Monitoring
Notification
System
Cloud
Files
Messaging

Net Infrastructure
Packaging
Utilities
Commands
Internal

Network
Source Control
Web Infrastructure
Database
Inventory
SYSTEM: PING
EIGENE MODULE
Eigene Module können in Python oder einer beliebigen anderen
Programmiersprache(!) verfasst sein.
PLAYBOOKS
Playbooks sind deklarative Beschreibungen in YAML
(Leerzeichen sind wichtig!)
Tasks beschreiben den gewünschten Zustand
Können Variablen und Schleifen verwenden
Templates und Dateien lassen sich nutzen
NUTZER ANLEGEN UND LÖSCHEN
--hss al
ot: l
ue:ro
sr ot
tss
ak:
#Adteue 'ale wt apiaygopo 'di'
d h sr kye' ih
rmr ru f amn
-ue:nm=alecmet"awne LeFy"gopue
sr aekye omn=Kyint e re ru=sr
#Cet a24-i SHkyfrue kye
rae
08bt S e o sr ale
-ue:nm=alegnrt_s_e=e shkybt=08
sr aekye eeaeshkyys s_e_is24
#Rmv teue 'ale
eoe h sr kye'
-ue:nm=alesaeasn rmv=e
sr aekye tt=bet eoeys
PLAY IT!
VARIABLEN FÜR TASKS
Tasks können Variablen nutzen
--hss al
ot: l
ue:ro
sr ot
vr:
as
ue:sehn
sr tpa
ue_w:$$$MD60aQgWS21
srpd 1$UYUb6uqJox.
tss
ak:
-nm:"nt|Stu a acut
ae Ii
e p n con"
ue:nm={ue } pswr={ue_w } sel/i/ah
sr ae{ sr } asod{ srpd } hl=bnbs
SCHLEIFEN MIT ITEM
tss
ak:
-nm:"nt|Sm sfwr sol b isald
ae Ii
oe otae hud e ntle"
ato:atpg{ ie } saelts
cin p k={ tm } tt=aet
wt_tm:
ihies
-sd
uo
-oeshsre
pns-evr
-sh
s
TEMPLATES UND DATEIEN
Das Template-Modul erlaubt dynamische Anpassungen an
Konfig-Dateien
Mit Copy lassen sich Dateien 1:1 kopieren
tmlt:sctmltsmmpcj ds=ecmmpc
epae r=epae/str.2 et/t/str
cp:sctmltsbcu.hds=urlclbnbcu.h
oy r=epae/akps et/s/oa/i/akps
VARIABLEN IN TEMPLATES
Jinja2 als Template-Sprache
[let
cin]
ue=ot
srro
pswr={mslro_asod}
asod{ yq.otpswr }

my.cnf.j2
HANDLERS
Verhalten sich ähnlich zu Tasks
hnlr:
ades
-nm:rsatmsl
ae etr yq
ato:srienm=yq saersatd
cin evc aemsl tt=etre
TAGS UND ROLES
Tags bündeln Tasks und lassen sich gezielt ausführen
Roles erlauben höhere Modularität in Playbooks
tss
ak:
-nm:LM sol b isald
ae AP hud e ntle
ato:atpg{ ie } saelts
cin p k={ tm } tt=aet
wt_tm:
ihies
-aah2
pce
-msl
yq
-pp
h5
tg:lm
as ap
ANSIBLE INSTALLIEREN
MAC OS X

$be isalasbe
rw ntl nil

LINUX
$ppisalpym jna prmk
i ntl yal ij2 aaio
$ppisalasbe
i ntl nil
BEI BEDARF AUCH MIT GUI

Bis zu 10 Hosts lassen sich kostenlos mit AWX managen.
WEITERE RESSOURCEN
ansibleworks.com - Die Webseite von Ansible
galaxy.ansibleworks.com - Plattform für Ansible
Playbooks/Roles
Configuration Management 101 - Generelle Infos
ALTERNATIVEN
Es gibt eine Vielzahl von Tools für
automatisiertes Configuration Management:
Ansible
Puppet
Chef
cfengine
salt
AUTOMATE ALL THE THINGS
FORK ME!
Ich blogge unter yauh.de ,
tweete als @yauh ,
+1 als StephanHochhaus
und pushe als perlmonkey .

Más contenido relacionado

La actualidad más candente

Unity で実装するエイジングテストのお話
Unity で実装するエイジングテストのお話Unity で実装するエイジングテストのお話
Unity で実装するエイジングテストのお話Shota Baba
 
YoctoをつかったDistroの作り方とハマり方
YoctoをつかったDistroの作り方とハマり方YoctoをつかったDistroの作り方とハマり方
YoctoをつかったDistroの作り方とハマり方wata2ki
 
Androidの新ビルドシステム
Androidの新ビルドシステムAndroidの新ビルドシステム
Androidの新ビルドシステムl_b__
 
Redmine にいろいろ埋め込んでみた
Redmine にいろいろ埋め込んでみたRedmine にいろいろ埋め込んでみた
Redmine にいろいろ埋め込んでみたKohei Nakamura
 
開発環境構築からはじめるPython VisualStudio Codeとpipenvで始めるpython
開発環境構築からはじめるPython VisualStudio Codeとpipenvで始めるpython開発環境構築からはじめるPython VisualStudio Codeとpipenvで始めるpython
開発環境構築からはじめるPython VisualStudio Codeとpipenvで始めるpythontomitomi3 tomitomi3
 
Alfresco勉強会#18 alfrescoのバックアップとリストア
Alfresco勉強会#18 alfrescoのバックアップとリストアAlfresco勉強会#18 alfrescoのバックアップとリストア
Alfresco勉強会#18 alfrescoのバックアップとリストアTasuku Otani
 
TypeScript製フレームワーク「Nest」のご紹介
TypeScript製フレームワーク「Nest」のご紹介TypeScript製フレームワーク「Nest」のご紹介
TypeScript製フレームワーク「Nest」のご紹介bitbank, Inc. Tokyo, Japan
 
VSCodeで作るPostgreSQL開発環境(第25回 PostgreSQLアンカンファレンス@オンライン 発表資料)
VSCodeで作るPostgreSQL開発環境(第25回 PostgreSQLアンカンファレンス@オンライン 発表資料)VSCodeで作るPostgreSQL開発環境(第25回 PostgreSQLアンカンファレンス@オンライン 発表資料)
VSCodeで作るPostgreSQL開発環境(第25回 PostgreSQLアンカンファレンス@オンライン 発表資料)NTT DATA Technology & Innovation
 
コンテナの作り方「Dockerは裏方で何をしているのか?」
コンテナの作り方「Dockerは裏方で何をしているのか?」コンテナの作り方「Dockerは裏方で何をしているのか?」
コンテナの作り方「Dockerは裏方で何をしているのか?」Masahito Zembutsu
 
Android タブレットにLinuxを入れて色々と遊んでみよう 続編その2 Hacking of Android Tablet on Linux
Android タブレットにLinuxを入れて色々と遊んでみよう 続編その2 Hacking of Android Tablet on LinuxAndroid タブレットにLinuxを入れて色々と遊んでみよう 続編その2 Hacking of Android Tablet on Linux
Android タブレットにLinuxを入れて色々と遊んでみよう 続編その2 Hacking of Android Tablet on LinuxNetwalker lab kapper
 
セキュアエレメントとIotデバイスセキュリティ2
セキュアエレメントとIotデバイスセキュリティ2セキュアエレメントとIotデバイスセキュリティ2
セキュアエレメントとIotデバイスセキュリティ2Kentaro Mitsuyasu
 
UnicodeによるXSSと SQLインジェクションの可能性
UnicodeによるXSSとSQLインジェクションの可能性UnicodeによるXSSとSQLインジェクションの可能性
UnicodeによるXSSと SQLインジェクションの可能性Hiroshi Tokumaru
 
Twilioで作る、電話レスコールセンター
Twilioで作る、電話レスコールセンターTwilioで作る、電話レスコールセンター
Twilioで作る、電話レスコールセンター瑛一 西口
 
近ごろサイボウズで流行ってる「敷居が低いLT」の話
近ごろサイボウズで流行ってる「敷居が低いLT」の話近ごろサイボウズで流行ってる「敷居が低いLT」の話
近ごろサイボウズで流行ってる「敷居が低いLT」の話Ko Kazaana
 
サービス開発における フロントエンド・ドメイン駆動設計の実践
サービス開発における フロントエンド・ドメイン駆動設計の実践サービス開発における フロントエンド・ドメイン駆動設計の実践
サービス開発における フロントエンド・ドメイン駆動設計の実践TakefumiYoshii
 
DBスキーマもバージョン管理したい!
DBスキーマもバージョン管理したい!DBスキーマもバージョン管理したい!
DBスキーマもバージョン管理したい!kwatch
 
GPU Container as a Serviceを実現するための最新OSS徹底比較 - OpenStack最新情報セミナー 2017年7月
GPU Container as a Serviceを実現するための最新OSS徹底比較 - OpenStack最新情報セミナー 2017年7月GPU Container as a Serviceを実現するための最新OSS徹底比較 - OpenStack最新情報セミナー 2017年7月
GPU Container as a Serviceを実現するための最新OSS徹底比較 - OpenStack最新情報セミナー 2017年7月VirtualTech Japan Inc.
 

La actualidad más candente (20)

Unity で実装するエイジングテストのお話
Unity で実装するエイジングテストのお話Unity で実装するエイジングテストのお話
Unity で実装するエイジングテストのお話
 
YoctoをつかったDistroの作り方とハマり方
YoctoをつかったDistroの作り方とハマり方YoctoをつかったDistroの作り方とハマり方
YoctoをつかったDistroの作り方とハマり方
 
Androidの新ビルドシステム
Androidの新ビルドシステムAndroidの新ビルドシステム
Androidの新ビルドシステム
 
Redmine にいろいろ埋め込んでみた
Redmine にいろいろ埋め込んでみたRedmine にいろいろ埋め込んでみた
Redmine にいろいろ埋め込んでみた
 
Project Facilitation
Project FacilitationProject Facilitation
Project Facilitation
 
開発環境構築からはじめるPython VisualStudio Codeとpipenvで始めるpython
開発環境構築からはじめるPython VisualStudio Codeとpipenvで始めるpython開発環境構築からはじめるPython VisualStudio Codeとpipenvで始めるpython
開発環境構築からはじめるPython VisualStudio Codeとpipenvで始めるpython
 
Puppet入門
Puppet入門Puppet入門
Puppet入門
 
Alfresco勉強会#18 alfrescoのバックアップとリストア
Alfresco勉強会#18 alfrescoのバックアップとリストアAlfresco勉強会#18 alfrescoのバックアップとリストア
Alfresco勉強会#18 alfrescoのバックアップとリストア
 
TypeScript製フレームワーク「Nest」のご紹介
TypeScript製フレームワーク「Nest」のご紹介TypeScript製フレームワーク「Nest」のご紹介
TypeScript製フレームワーク「Nest」のご紹介
 
VSCodeで作るPostgreSQL開発環境(第25回 PostgreSQLアンカンファレンス@オンライン 発表資料)
VSCodeで作るPostgreSQL開発環境(第25回 PostgreSQLアンカンファレンス@オンライン 発表資料)VSCodeで作るPostgreSQL開発環境(第25回 PostgreSQLアンカンファレンス@オンライン 発表資料)
VSCodeで作るPostgreSQL開発環境(第25回 PostgreSQLアンカンファレンス@オンライン 発表資料)
 
SPI Drivers
SPI DriversSPI Drivers
SPI Drivers
 
コンテナの作り方「Dockerは裏方で何をしているのか?」
コンテナの作り方「Dockerは裏方で何をしているのか?」コンテナの作り方「Dockerは裏方で何をしているのか?」
コンテナの作り方「Dockerは裏方で何をしているのか?」
 
Android タブレットにLinuxを入れて色々と遊んでみよう 続編その2 Hacking of Android Tablet on Linux
Android タブレットにLinuxを入れて色々と遊んでみよう 続編その2 Hacking of Android Tablet on LinuxAndroid タブレットにLinuxを入れて色々と遊んでみよう 続編その2 Hacking of Android Tablet on Linux
Android タブレットにLinuxを入れて色々と遊んでみよう 続編その2 Hacking of Android Tablet on Linux
 
セキュアエレメントとIotデバイスセキュリティ2
セキュアエレメントとIotデバイスセキュリティ2セキュアエレメントとIotデバイスセキュリティ2
セキュアエレメントとIotデバイスセキュリティ2
 
UnicodeによるXSSと SQLインジェクションの可能性
UnicodeによるXSSとSQLインジェクションの可能性UnicodeによるXSSとSQLインジェクションの可能性
UnicodeによるXSSと SQLインジェクションの可能性
 
Twilioで作る、電話レスコールセンター
Twilioで作る、電話レスコールセンターTwilioで作る、電話レスコールセンター
Twilioで作る、電話レスコールセンター
 
近ごろサイボウズで流行ってる「敷居が低いLT」の話
近ごろサイボウズで流行ってる「敷居が低いLT」の話近ごろサイボウズで流行ってる「敷居が低いLT」の話
近ごろサイボウズで流行ってる「敷居が低いLT」の話
 
サービス開発における フロントエンド・ドメイン駆動設計の実践
サービス開発における フロントエンド・ドメイン駆動設計の実践サービス開発における フロントエンド・ドメイン駆動設計の実践
サービス開発における フロントエンド・ドメイン駆動設計の実践
 
DBスキーマもバージョン管理したい!
DBスキーマもバージョン管理したい!DBスキーマもバージョン管理したい!
DBスキーマもバージョン管理したい!
 
GPU Container as a Serviceを実現するための最新OSS徹底比較 - OpenStack最新情報セミナー 2017年7月
GPU Container as a Serviceを実現するための最新OSS徹底比較 - OpenStack最新情報セミナー 2017年7月GPU Container as a Serviceを実現するための最新OSS徹底比較 - OpenStack最新情報セミナー 2017年7月
GPU Container as a Serviceを実現するための最新OSS徹底比較 - OpenStack最新情報セミナー 2017年7月
 

Destacado

Ansible presentation
Ansible presentationAnsible presentation
Ansible presentationJohn Lynch
 
Ansible tips & tricks
Ansible tips & tricksAnsible tips & tricks
Ansible tips & tricksbcoca
 
Service Discovery mit Consul
Service Discovery mit ConsulService Discovery mit Consul
Service Discovery mit ConsulOliver Fischer
 
LaTeX für Geisteswissenschaftler
LaTeX für GeisteswissenschaftlerLaTeX für Geisteswissenschaftler
LaTeX für GeisteswissenschaftlerStephan Hochhaus
 
Testing MeteorJS using CasperJS
Testing MeteorJS using CasperJSTesting MeteorJS using CasperJS
Testing MeteorJS using CasperJSStephan Hochhaus
 
Walk of Claim - A Meteor Meetup presentation
Walk of Claim - A Meteor Meetup presentationWalk of Claim - A Meteor Meetup presentation
Walk of Claim - A Meteor Meetup presentationStephan Hochhaus
 
Meteor - not just for rockstars
Meteor - not just for rockstarsMeteor - not just for rockstars
Meteor - not just for rockstarsStephan Hochhaus
 
Writing (Meteor) Code With Style
Writing (Meteor) Code With StyleWriting (Meteor) Code With Style
Writing (Meteor) Code With StyleStephan Hochhaus
 
Introduction to Meteor - revised edition
Introduction to Meteor - revised editionIntroduction to Meteor - revised edition
Introduction to Meteor - revised editionStephan Hochhaus
 
Infrastructure as code might be literally impossible
Infrastructure as code might be literally impossibleInfrastructure as code might be literally impossible
Infrastructure as code might be literally impossibleice799
 
Infrastructure as Code Maturity Model v1
Infrastructure as Code Maturity Model v1Infrastructure as Code Maturity Model v1
Infrastructure as Code Maturity Model v1Gary Stafford
 
The Cloud Revolution - Philippines Cloud Summit
The Cloud Revolution - Philippines Cloud SummitThe Cloud Revolution - Philippines Cloud Summit
The Cloud Revolution - Philippines Cloud SummitRandy Bias
 
AWS re:Invent 2016: Chalk Talk: Succeeding at Infrastructure-as-Code (GPSCT312)
AWS re:Invent 2016: Chalk Talk: Succeeding at Infrastructure-as-Code (GPSCT312)AWS re:Invent 2016: Chalk Talk: Succeeding at Infrastructure-as-Code (GPSCT312)
AWS re:Invent 2016: Chalk Talk: Succeeding at Infrastructure-as-Code (GPSCT312)Amazon Web Services
 
AWS January 2016 Webinar Series - Managing your Infrastructure as Code
AWS January 2016 Webinar Series - Managing your Infrastructure as CodeAWS January 2016 Webinar Series - Managing your Infrastructure as Code
AWS January 2016 Webinar Series - Managing your Infrastructure as CodeAmazon Web Services
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction Robert Reiz
 
CERN Data Centre Evolution
CERN Data Centre EvolutionCERN Data Centre Evolution
CERN Data Centre EvolutionGavin McCance
 

Destacado (20)

Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
Ansible tips & tricks
Ansible tips & tricksAnsible tips & tricks
Ansible tips & tricks
 
Service Discovery mit Consul
Service Discovery mit ConsulService Discovery mit Consul
Service Discovery mit Consul
 
LaTeX für Geisteswissenschaftler
LaTeX für GeisteswissenschaftlerLaTeX für Geisteswissenschaftler
LaTeX für Geisteswissenschaftler
 
Testing MeteorJS using CasperJS
Testing MeteorJS using CasperJSTesting MeteorJS using CasperJS
Testing MeteorJS using CasperJS
 
Walk of Claim - A Meteor Meetup presentation
Walk of Claim - A Meteor Meetup presentationWalk of Claim - A Meteor Meetup presentation
Walk of Claim - A Meteor Meetup presentation
 
Meteor - not just for rockstars
Meteor - not just for rockstarsMeteor - not just for rockstars
Meteor - not just for rockstars
 
Writing (Meteor) Code With Style
Writing (Meteor) Code With StyleWriting (Meteor) Code With Style
Writing (Meteor) Code With Style
 
Introduction to Meteor - revised edition
Introduction to Meteor - revised editionIntroduction to Meteor - revised edition
Introduction to Meteor - revised edition
 
Meteor WWNRW Intro
Meteor WWNRW IntroMeteor WWNRW Intro
Meteor WWNRW Intro
 
Infrastructure as code might be literally impossible
Infrastructure as code might be literally impossibleInfrastructure as code might be literally impossible
Infrastructure as code might be literally impossible
 
Infrastructure as Code Maturity Model v1
Infrastructure as Code Maturity Model v1Infrastructure as Code Maturity Model v1
Infrastructure as Code Maturity Model v1
 
The Cloud Revolution - Philippines Cloud Summit
The Cloud Revolution - Philippines Cloud SummitThe Cloud Revolution - Philippines Cloud Summit
The Cloud Revolution - Philippines Cloud Summit
 
AWS re:Invent 2016: Chalk Talk: Succeeding at Infrastructure-as-Code (GPSCT312)
AWS re:Invent 2016: Chalk Talk: Succeeding at Infrastructure-as-Code (GPSCT312)AWS re:Invent 2016: Chalk Talk: Succeeding at Infrastructure-as-Code (GPSCT312)
AWS re:Invent 2016: Chalk Talk: Succeeding at Infrastructure-as-Code (GPSCT312)
 
(ARC307) Infrastructure as Code
(ARC307) Infrastructure as Code(ARC307) Infrastructure as Code
(ARC307) Infrastructure as Code
 
Cyansible
CyansibleCyansible
Cyansible
 
AWS January 2016 Webinar Series - Managing your Infrastructure as Code
AWS January 2016 Webinar Series - Managing your Infrastructure as CodeAWS January 2016 Webinar Series - Managing your Infrastructure as Code
AWS January 2016 Webinar Series - Managing your Infrastructure as Code
 
Introducing DevOps
Introducing DevOpsIntroducing DevOps
Introducing DevOps
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction
 
CERN Data Centre Evolution
CERN Data Centre EvolutionCERN Data Centre Evolution
CERN Data Centre Evolution
 

Similar a Automatisierte infrastruktur mit ansible

Puppet und OpenStack - Ein gutes Team
Puppet und OpenStack - Ein gutes TeamPuppet und OpenStack - Ein gutes Team
Puppet und OpenStack - Ein gutes TeamNETWAYS
 
Automation with Ansible
Automation with AnsibleAutomation with Ansible
Automation with AnsibleSusannSgorzaly
 
PHPUnit - Eine kurze Einführung
PHPUnit - Eine kurze EinführungPHPUnit - Eine kurze Einführung
PHPUnit - Eine kurze Einführungfrankstaude
 
SLAC 2008 Mit SUSE Linux glücklich werden
SLAC 2008 Mit SUSE Linux glücklich werdenSLAC 2008 Mit SUSE Linux glücklich werden
SLAC 2008 Mit SUSE Linux glücklich werdenSchlomo Schapiro
 
Puppet: Aufbau einer Puppet Enterprise Umgebung (Webinar vom 28.03.2014)
Puppet: Aufbau einer Puppet Enterprise Umgebung (Webinar vom 28.03.2014)Puppet: Aufbau einer Puppet Enterprise Umgebung (Webinar vom 28.03.2014)
Puppet: Aufbau einer Puppet Enterprise Umgebung (Webinar vom 28.03.2014)NETWAYS
 
Einführung in Elasticsearch - August 2014
Einführung in Elasticsearch - August 2014Einführung in Elasticsearch - August 2014
Einführung in Elasticsearch - August 2014inovex GmbH
 
WordPress vs. TYPO3
WordPress vs. TYPO3WordPress vs. TYPO3
WordPress vs. TYPO3webpard UG
 
Dart (Teil I der Tour de Dart)
Dart (Teil I der Tour de Dart)Dart (Teil I der Tour de Dart)
Dart (Teil I der Tour de Dart)Nane Kratzke
 
OSMC 2010 | Verwendung von Puppet in verteilten Monitoring Umgebungen by Birg...
OSMC 2010 | Verwendung von Puppet in verteilten Monitoring Umgebungen by Birg...OSMC 2010 | Verwendung von Puppet in verteilten Monitoring Umgebungen by Birg...
OSMC 2010 | Verwendung von Puppet in verteilten Monitoring Umgebungen by Birg...NETWAYS
 
OSDC 2011 | Puppet from Scratch by Thomas Gelf
OSDC 2011 | Puppet from Scratch by Thomas GelfOSDC 2011 | Puppet from Scratch by Thomas Gelf
OSDC 2011 | Puppet from Scratch by Thomas GelfNETWAYS
 
Einführung in Puppet und Vagrant
Einführung in Puppet und VagrantEinführung in Puppet und Vagrant
Einführung in Puppet und Vagrants0enke
 
Production-ready Infrastruktur in 3 Wochen
Production-ready Infrastruktur in 3 WochenProduction-ready Infrastruktur in 3 Wochen
Production-ready Infrastruktur in 3 WochenAndré Goliath
 
Dnug35 ak-dev.071111-cookbook
Dnug35 ak-dev.071111-cookbookDnug35 ak-dev.071111-cookbook
Dnug35 ak-dev.071111-cookbookUlrich Krause
 
Coffee Backone Introduction
Coffee Backone IntroductionCoffee Backone Introduction
Coffee Backone IntroductionTino Isnich
 
Upgrading Puppet CommitterConf Essen 2014
Upgrading Puppet CommitterConf Essen 2014Upgrading Puppet CommitterConf Essen 2014
Upgrading Puppet CommitterConf Essen 2014Martin Alfke
 

Similar a Automatisierte infrastruktur mit ansible (20)

Puppet und OpenStack - Ein gutes Team
Puppet und OpenStack - Ein gutes TeamPuppet und OpenStack - Ein gutes Team
Puppet und OpenStack - Ein gutes Team
 
Automation with Ansible
Automation with AnsibleAutomation with Ansible
Automation with Ansible
 
Webapplikationen mit Node.js
Webapplikationen mit Node.jsWebapplikationen mit Node.js
Webapplikationen mit Node.js
 
PHPUnit - Eine kurze Einführung
PHPUnit - Eine kurze EinführungPHPUnit - Eine kurze Einführung
PHPUnit - Eine kurze Einführung
 
SLAC 2008 Mit SUSE Linux glücklich werden
SLAC 2008 Mit SUSE Linux glücklich werdenSLAC 2008 Mit SUSE Linux glücklich werden
SLAC 2008 Mit SUSE Linux glücklich werden
 
Web Entwicklung mit PHP - Teil 1
Web Entwicklung mit PHP - Teil 1Web Entwicklung mit PHP - Teil 1
Web Entwicklung mit PHP - Teil 1
 
Puppet: Aufbau einer Puppet Enterprise Umgebung (Webinar vom 28.03.2014)
Puppet: Aufbau einer Puppet Enterprise Umgebung (Webinar vom 28.03.2014)Puppet: Aufbau einer Puppet Enterprise Umgebung (Webinar vom 28.03.2014)
Puppet: Aufbau einer Puppet Enterprise Umgebung (Webinar vom 28.03.2014)
 
Einführung in Elasticsearch - August 2014
Einführung in Elasticsearch - August 2014Einführung in Elasticsearch - August 2014
Einführung in Elasticsearch - August 2014
 
Einführung in Puppet
Einführung in PuppetEinführung in Puppet
Einführung in Puppet
 
WordPress vs. TYPO3
WordPress vs. TYPO3WordPress vs. TYPO3
WordPress vs. TYPO3
 
Node.js für Webapplikationen
Node.js für WebapplikationenNode.js für Webapplikationen
Node.js für Webapplikationen
 
Dart (Teil I der Tour de Dart)
Dart (Teil I der Tour de Dart)Dart (Teil I der Tour de Dart)
Dart (Teil I der Tour de Dart)
 
OSMC 2010 | Verwendung von Puppet in verteilten Monitoring Umgebungen by Birg...
OSMC 2010 | Verwendung von Puppet in verteilten Monitoring Umgebungen by Birg...OSMC 2010 | Verwendung von Puppet in verteilten Monitoring Umgebungen by Birg...
OSMC 2010 | Verwendung von Puppet in verteilten Monitoring Umgebungen by Birg...
 
OSDC 2011 | Puppet from Scratch by Thomas Gelf
OSDC 2011 | Puppet from Scratch by Thomas GelfOSDC 2011 | Puppet from Scratch by Thomas Gelf
OSDC 2011 | Puppet from Scratch by Thomas Gelf
 
Einführung in Puppet und Vagrant
Einführung in Puppet und VagrantEinführung in Puppet und Vagrant
Einführung in Puppet und Vagrant
 
Production-ready Infrastruktur in 3 Wochen
Production-ready Infrastruktur in 3 WochenProduction-ready Infrastruktur in 3 Wochen
Production-ready Infrastruktur in 3 Wochen
 
Dnug35 ak-dev.071111-cookbook
Dnug35 ak-dev.071111-cookbookDnug35 ak-dev.071111-cookbook
Dnug35 ak-dev.071111-cookbook
 
A/B Testing mit Node.js
A/B Testing mit Node.jsA/B Testing mit Node.js
A/B Testing mit Node.js
 
Coffee Backone Introduction
Coffee Backone IntroductionCoffee Backone Introduction
Coffee Backone Introduction
 
Upgrading Puppet CommitterConf Essen 2014
Upgrading Puppet CommitterConf Essen 2014Upgrading Puppet CommitterConf Essen 2014
Upgrading Puppet CommitterConf Essen 2014
 

Automatisierte infrastruktur mit ansible

  • 1. INFRASTRUKTUR MIT ANSIBLE Stephan Hochhaus ( @yauh ) 15. Januar 2014 bei der OpenTechSchool Dortmund .
  • 2.
  • 3. WIE SIEHT EURE IT-INFRASTRUKTUR AUS? Wer hat einen eigenen (Web-)Server? Welches Betriebssystem? Wie viele Server sind es? Wie oft setzt ihr sie neu auf? Wie lange dauert das Aufsetzen? Wer hat schonmal ein Tutorial verfasst?
  • 4. MEIN LEBEN VOR ANSIBLE 1. 2. 3. 4. 5. Grundsystem per Hand installieren Ggf. ausgefeilte shell-Skripte für Pakete ausführen Manuelles Anpassen von Konfigurationsdateien Fertiges System Ausprobieren von neuer Software/Konfiguration, andere Entwickler auf dem Server/Tests 6. Zerschießen des funktionierenden Systems
  • 6. VORTEILE VON AUTOMATISIERUNG Beliebige (und leichte) Wiederholbarkeit Hohe Geschwindigkeit von Deployments Wiederherstellen von bekannten Zuständen Keine tiefen Systemkenntnisse notwendig
  • 7. UND GANZ KONKRET Schneller Aufbau von Testsystemen Leichter Providerwechsel Continuous-Integration-Workflows realisieren "Zerschossene" Systeme wiederherstellen
  • 8. WIESO NICHT SHELL/PERL-SKRIPTE? Skripte werden schnell extrem komplex Idempotenz - Unabhängig vom Ausgangszustand wird ein definierter Endzustand hergestellt (mehrfache Ausführung möglich) Bessere Übersichtlichkeit und Struktur durch Abstraktion Portabilität (z.B. verschiedene Linux Distros) Deklarativer Ansatz erlaubt höhere Produktivität als imperatives Vorgehen (wie soll das Ergebnis aussehen vs. was soll getan werden) Teilen von Playbooks mit Community
  • 9. CONFIGURATION MANAGEMENT 2014 Stand: 13. Januar 2014 auf github
  • 10. Leistungsfähige automation engine aus Basis von Playbooks Keine Agents auf Zielsystemen notwendig (SSH-Zugriff reicht) Standardmäßig push-Architektur, pull möglich Keine Programmierkenntnisse notwendig (statt dessen YAML und Jinja2) Aber funktional erweiterbar in beliebigen Programmiersprachen Kein Management von Windows oder Mac OS X Integration in Amazon EC2, Rackspace, OpenStack, VMWare, Vagrant, u.a. AWX (Web-GUI)
  • 12. KERNBESTANDTEILE VON ANSIBLE Inventory - Beschreibt die Infrastruktur Module - Stellen Funktionen zur Verfügung Playbooks - Führen Aktionen in Infrastruktur durch
  • 13. INVENTORY Hosts - Zielsysteme (Linux) Gruppen Organisatorische Zuordnung (z.B. geografisch, nach Funktion oder als Mischung)
  • 15. ES GIBT MODULE FÜR Monitoring Notification System Cloud Files Messaging Net Infrastructure Packaging Utilities Commands Internal Network Source Control Web Infrastructure Database Inventory
  • 17. EIGENE MODULE Eigene Module können in Python oder einer beliebigen anderen Programmiersprache(!) verfasst sein.
  • 18. PLAYBOOKS Playbooks sind deklarative Beschreibungen in YAML (Leerzeichen sind wichtig!) Tasks beschreiben den gewünschten Zustand Können Variablen und Schleifen verwenden Templates und Dateien lassen sich nutzen
  • 19. NUTZER ANLEGEN UND LÖSCHEN --hss al ot: l ue:ro sr ot tss ak: #Adteue 'ale wt apiaygopo 'di' d h sr kye' ih rmr ru f amn -ue:nm=alecmet"awne LeFy"gopue sr aekye omn=Kyint e re ru=sr #Cet a24-i SHkyfrue kye rae 08bt S e o sr ale -ue:nm=alegnrt_s_e=e shkybt=08 sr aekye eeaeshkyys s_e_is24 #Rmv teue 'ale eoe h sr kye' -ue:nm=alesaeasn rmv=e sr aekye tt=bet eoeys
  • 21. VARIABLEN FÜR TASKS Tasks können Variablen nutzen --hss al ot: l ue:ro sr ot vr: as ue:sehn sr tpa ue_w:$$$MD60aQgWS21 srpd 1$UYUb6uqJox. tss ak: -nm:"nt|Stu a acut ae Ii e p n con" ue:nm={ue } pswr={ue_w } sel/i/ah sr ae{ sr } asod{ srpd } hl=bnbs
  • 22. SCHLEIFEN MIT ITEM tss ak: -nm:"nt|Sm sfwr sol b isald ae Ii oe otae hud e ntle" ato:atpg{ ie } saelts cin p k={ tm } tt=aet wt_tm: ihies -sd uo -oeshsre pns-evr -sh s
  • 23. TEMPLATES UND DATEIEN Das Template-Modul erlaubt dynamische Anpassungen an Konfig-Dateien Mit Copy lassen sich Dateien 1:1 kopieren tmlt:sctmltsmmpcj ds=ecmmpc epae r=epae/str.2 et/t/str cp:sctmltsbcu.hds=urlclbnbcu.h oy r=epae/akps et/s/oa/i/akps
  • 24. VARIABLEN IN TEMPLATES Jinja2 als Template-Sprache [let cin] ue=ot srro pswr={mslro_asod} asod{ yq.otpswr } my.cnf.j2
  • 25. HANDLERS Verhalten sich ähnlich zu Tasks hnlr: ades -nm:rsatmsl ae etr yq ato:srienm=yq saersatd cin evc aemsl tt=etre
  • 26. TAGS UND ROLES Tags bündeln Tasks und lassen sich gezielt ausführen Roles erlauben höhere Modularität in Playbooks tss ak: -nm:LM sol b isald ae AP hud e ntle ato:atpg{ ie } saelts cin p k={ tm } tt=aet wt_tm: ihies -aah2 pce -msl yq -pp h5 tg:lm as ap
  • 27. ANSIBLE INSTALLIEREN MAC OS X $be isalasbe rw ntl nil LINUX $ppisalpym jna prmk i ntl yal ij2 aaio $ppisalasbe i ntl nil
  • 28. BEI BEDARF AUCH MIT GUI Bis zu 10 Hosts lassen sich kostenlos mit AWX managen.
  • 29. WEITERE RESSOURCEN ansibleworks.com - Die Webseite von Ansible galaxy.ansibleworks.com - Plattform für Ansible Playbooks/Roles Configuration Management 101 - Generelle Infos
  • 30. ALTERNATIVEN Es gibt eine Vielzahl von Tools für automatisiertes Configuration Management: Ansible Puppet Chef cfengine salt
  • 32. FORK ME! Ich blogge unter yauh.de , tweete als @yauh , +1 als StephanHochhaus und pushe als perlmonkey .