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
Automatización de sistemas con Ansible - OpenSo...
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
zisk0
May 07, 2016
Technology
37
1
Share
Automatización de sistemas con Ansible - OpenSouthCode 16
Automatización de sistemas con Ansible - OpenSouthCode 16
zisk0
May 07, 2016
Other Decks in Technology
See All in Technology
Djangoユーザが知っ得なPostgreSQL機能 - 設計の選択肢を増やす / Djang-use-PostgreSQL
soudai
PRO
0
120
速さだけじゃない! VoidZero ツールが移行先に選ばれる理由
mizdra
PRO
6
730
ChatworkとBPaaS 異なる特性で学んだAI機能開発の ベストプラクティス
kubell_hr
2
2.3k
Oracle Cloud Infrastructure IaaS 新機能アップデート 2026/3 - 2026/5
oracle4engineer
PRO
1
160
AI Adaptable なテストを整える工夫 / Ways to Make Your Tests AI-Adaptable
bitkey
PRO
2
210
AI フレンドリーなエラー監視を TypeScript で実現する
shinyaigeek
2
250
[モダンアプリ勉強会]今更聞けないGit/GitHub入門
tsukuboshi
0
190
APIテストとは?
nagix
0
170
プラットフォームエンジニア ワークショップ/ platform-workshop
databricksjapan
0
220
ポケモンの型をTypeScriptの型システムで表現してみた
subroh0508
0
160
オンコールの負荷軽減のためのBits Assistant 活用方法 / How to Use Bits Assistant to Reduce the Workload on On-Call Staff
sms_tech
1
380
React、まだ楽しくて草
uhyo
7
3.9k
Featured
See All Featured
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
430
Testing 201, or: Great Expectations
jmmastey
46
8.2k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
190
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
320
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.8k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
From π to Pie charts
rasagy
0
200
Code Reviewing Like a Champion
maltzj
528
40k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
1.6k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
200
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
300
Odyssey Design
rkendrick25
PRO
2
670
Transcript
Automatización de sistemas con
Whois Francisco López Sysadmin
Sysadmin: the hard way
The hard way ▪ Máquinas con configuración similar ▪ Servidores
“artesanos”
Simple IT Automation
Ansible ▪ Aprovisionamiento ▪ Gestión de la configuración ▪ Orquestación
▪ Despliegue de aplicaciones
Caracteristicas ▪ Simple pero potente Configuración en YAML. Plantillas en
jinja2. ▪ Sin agentes Usa SSH. ▪ Segura ...eehm, bueno, todo lo seguro que sea SSH.
Caracteristicas ▪ Muy bien documentada ▪ Respaldada por Red Hat
¡Es software libre! ▪ Core licenciado como GPLv3 ▪ Modulos
libres ▪ Roles libres
Ansible 101 Conceptos básicos
Inventory 192.168.1.10 opensouthcode.org [webservers] web1.osc.org web2.osc.org [databases:children] databases-masters databases-slaves [databases-masters]
master[1:3].osc.org [databases-slaves] slaves[1:3].osc.org Listado de máquinas
- name: Instalar vim apt: pkg=vim state=present update_cache=yes Task Acción
a realizar Compuesta de módulo y parámetros apt update && apt install vim
Módulos Amazon EC2 Amazon ECS Amazon S3 Command MongoDB Redis
MySQL Postgres IIS Windows Nagios Zabbix RabbitMQ Azure Digital Ocean Docker Google Cloud VMWare Rackspace Linux Apache2 Django JBOSS Jira Git Github Subversion F5 Cisco HAProxy
Play Inventario + tareas - name: Play simple de ejemplo
hosts: webservers tasks: - name: Instalar vim apt: pkg=vim state=present update_cache=yes - name: Instalar tcpdump apt: pkg=tcpdump state=present
Playbook Sucesión de plays Base de ejecución de Ansible
Config management
Variables app_path: “/home/app” monitoring: server-name: nagios server: 11.22.33.44 Se pueden
definir “en cualquier sitio”
inventario host_vars group_vars main.yml web.osc.org.yml --- app_path: “/home/app” servername: “web.osc.org”
monitoring: server-name: “nagios” server: 11.22.33.44
Variables - name: Clonar repositorio git:repo="
[email protected]
:app.git" clone=yes dest={{ app_path }}
Se referencian usando jinja2
Templates Aplicar variables a ficheros de configuración <VirtualHost _default_:{{ http_port
}}> ServerName {{ servername }} ...
Templates Aplicar variables a ficheros de configuración - name: Subir
config apache template: src=00-app.conf.j2 dest=/path/00-app.conf owner=root group=root mode=0644
inventario host_vars group_vars main.yml templates 00-app.conf.j2
Inclusión y roles
Inclusión En un playbook se pueden incluir otros ficheros con
tasks --- - hosts: webservers tasks: - include: dependencies.yml - include: deployment.yml - include: apache.yml
Roles Encapsulación de configuraciones --- - hosts: webservers roles: -
base - django - apache2
inventario host_vars group_vars main.yml templates roles
apache2 files meta roles handlers tasks vars templates
¿Resultados?
None
¡Gracias! ¿Preguntas? @zisk0
[email protected]