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
AnsibleWorkshopMay2019.pdf
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
84
Correct Maps Are Useless: A guide to mental models
andmos
0
210
LEGO I Praksis
andmos
0
98
Supply Chain Attacks: Når den digitale forsyningslinja blir angrepsvektor
andmos
0
53
IoIT: Internet of Insecure Things
andmos
0
140
Containers'n stuff
andmos
0
68
IoT - Bevisstgjøring
andmos
0
67
GitOps in a nutshell
andmos
0
240
Supply Chain Attack
andmos
0
84
Other Decks in Programming
See All in Programming
まずはプロンプトガイドを読もう、話はそれからだ
kiakiraki
1
160
in-process GraphQL のすすめ #ginzajs
izumin5210
4
1.4k
関東Kaggler会_NVIDIA_Nemotron_コンペ_振り返り
rick_ds
0
670
今さら聞けない .NET CLI
htkym
0
200
Claude Code全社展開のためにやったことn選~プラグイン302個・コミッター271人を支えるために~
kenchan
5
1.6k
30年振りにコンパイラの定数整数除算を改善した
herumi
2
510
生成AI導入の「期待外れ」を乗り越える ー 開発フロー改革が目指す、真の組織変革
starfish719
0
4.9k
VibeCodingからAgenticWorkflowへ
starfish719
0
700
Cloudflare is Agents
chimame
0
170
自動化したのに回らないテスト運用の壁ーAI時代の品質責任と生産性
mfunaki
1
150
運用ダッシュボードの設計を誰も教えてくれないのだけどみなさんどうしてるんですか? - チームに監視するという文化を根付かせるための第一歩を踏みたい -
satoshi256kbyte
1
140
MySQLとPostgreSQLって何が違うの?
akagami
0
120
Featured
See All Featured
Odyssey Design
rkendrick25
PRO
2
770
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.1k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
Google's AI Overviews - The New Search
badams
0
1.1k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
240
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
430
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
380
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.2k
What does AI have to do with Human Rights?
axbom
PRO
1
2.3k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
950
Paper Plane (Part 1)
katiecoart
PRO
1
10k
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