Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
AnsibleWorkshopMay2019.pdf
Search
Andreas Mosti
May 14, 2019
Programming
270
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
AnsibleWorkshopMay2019.pdf
https://dipsas.github.io/AnsibleCourse/
Andreas Mosti
May 14, 2019
More Decks by Andreas Mosti
See All by Andreas Mosti
Deterministic Builds and where to find them
andmos
0
91
Correct Maps Are Useless: A guide to mental models
andmos
0
220
LEGO I Praksis
andmos
0
110
Supply Chain Attacks: Når den digitale forsyningslinja blir angrepsvektor
andmos
0
54
IoIT: Internet of Insecure Things
andmos
0
140
Containers'n stuff
andmos
0
78
IoT - Bevisstgjøring
andmos
0
71
GitOps in a nutshell
andmos
0
240
Supply Chain Attack
andmos
0
90
Other Decks in Programming
See All in Programming
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
310
thread_parallel_with_free-threaded_Python_and_NumPy.pdf
riku_sakamoto
0
360
Ghostty + Neovimで作る 透明でカッコ良い開発環境
j341nono
0
130
App Intentsのビルドプロセスを支える技術
kntkymt
0
460
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
850
Streamlitで実現する自然言語データアプリ開発
ayumu_yamaguchi
1
320
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
410
難しいけど、読めた。- OSSの入口に立った話。
sts11142
0
130
Starting & Sustaining Code-Based E2E Testing for Non-Coding QA Teams( #jasstniigata )
teyamagu
PRO
1
590
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
570
Apple Intelligence を用いた個人情報誤送信防止、及びユーザーリクエスト体験の改善について
yukiny
0
190
Are APIs Still Relevant in the AI Era?
soyuka
0
330
Featured
See All Featured
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
700
Product Roadmaps are Hard
iamctodd
55
13k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
370
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.6k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
500
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1k
Context Engineering - Making Every Token Count
addyosmani
9
1.2k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
550
Odyssey Design
rkendrick25
PRO
2
820
Designing Powerful Visuals for Engaging Learning
tmiket
1
580
Navigating Weather and Climate Data
rabernat
0
540
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Transcript
and infrastructure as code workshop Andreas Mosti
Key takeaways • Infrastructure as Code • Configuration Management •
What can Ansible solve? • What can it not solve? • Enough knowledge to understand the key principles
Dev/Build Runtime
Dev/Build Runtime
Dev/Build Runtime
Dev/Build Runtime
None
The complexity moves
None
None
Site A Site A Replica Site B Replica Site B
• Application platforms / runtimes • Permissions • Users •
Firewall rules • Config Files • Updates • Running Services • Upgrades
• Application platforms / runtimes • Permissions • Users •
Firewall rules • Config Files • Updates • Running Services • Upgrades 20
None
Inconsistent server farms
Platform requirements, «What are we releasing on?»
«We need new environments quickly, in a reproducible fashion»
Automate the infrastructure
Snowflake vs. Phoenix Servers
Infrastructure as code:
Reproducible Environments
Servers in version control
Configuration management
Explicit process
Safety!
Code Review
Baked vs. Fried servers
The usual suspects
None
None
Why Ansible?
None
None
Open Source
SSH WinRM
Most important:
The correct abstraction (for us)
None
Playbooks push Database Appserver Load Balancer
None
Remember: Ansible keeps state
The benefits of Infrastructure as Code: 1) Automation 2) Version
control 3) Code Review 4) Testing 5) Documentation 6) Reuse
The holy grale: Imutable infrastructure
Warning 1:
None
None
None
None
The files don’t represent reality!
None
Warning 2:
If not run often, the system might regress
Part 1: Inventory and connection
SSH WinRM
WinRM Port 5986 Local / AD admin user w. remoting
Powershell 3.0 ConfigureRemotingForAnsible.ps1
SSH Port 22 root / dedicated user(s)
None
None
The Inventory
inventory/Example.inventory
inventory/Testlab18.inventory
Exercise 1: Inventory and server connection
Part 2: Playbooks and tasks
Playbooks push Database Appserver Loadbalancer
LoadBalancer.yaml Zookeeper.yaml Solr.yaml Database.yaml ArenaAppServer.yaml
WebServer.yaml
WebServer.yaml
WebServer.yaml
WebServer.yaml
roles/DotNet461/tasks/main.yaml
None
None
Exercise 2: Playbook and simple tasks
Part 3: Roles and variables
WebServer.yaml
To reuse tasks or implement components, we make roles
Example roles: • IIS • DotnetFramework45 • Oracle12C • TeamcityAgent
• Java • GoogleChrome • SplunkForwarder
None
Buildserver.yaml
roles/Oracle12Driver/tasks/main.yaml
roles/Oracle12Driver/tasks/main.yaml
roles/Oracle12Driver/defaults/main.yaml
Lists and iterators
roles/Zookeeper/tasks/main.yaml roles/Zookeeper/defaults/main.yaml
A word on variable precendence
From least to most important: • role defaults • group_vars/
• host_vars/ • host facts • play vars • include_vars • set_facts • extra vars
A word on state and idempotency
Always pick modules over shell commands (if possible)
roles/MKDocs/tasks/main.yaml
roles/MKDocs/tasks/main.yaml
Exercise 3: Roles, variables and iterators
Part 4: Handlers, templates, files
None
Files vs Templates
roles/TeamCityAgent/tasks/main.yaml
True configuration management with templating and JINJA2
roles/TeamCityAgent/templates/buildAgent.properties
roles/SplunkForwarder/templates/input.conf.j2
roles/HAProxy/templates/haproxy.conf.j2
roles/Prometheus/templates/alertmanager.yml.j2
roles/Prometheus/defaults/main.yml
roles/TeamCityAgent/tasks/main.yaml
roles/TeamCityAgent/handlers/main.yaml
Exercise 4: Templates, handlers and files
Part 5: Ansible Vault
When working with secrets roles/TeamCityAgent/tasks/main.yaml
roles/TeamCityAgent/defaults/main.yaml
None
roles/TeamCityAgent/defaults/main.yaml
None
roles/TeamCityAgent/defaults/main.yaml
Exercise 5: Vault and encryptet secrets