1. Automação do físico ao NetSecDevOps
Introdução e visão
Raul Leite
rleite@redhat.com
Solution Architect
@sp4wnr0ot
Red Hat Brasil
2. 2
SIMPLES PODEROSO AGENTLESS
Deployment de aplicações
Gerenciamento de
configurações
Network automation
Orquestração do ciclo de vida
Automação legível por humanos
Não são necessárias habilidades
especiais de programação
Tarefas executadas em ordem
Permite que toda equipe utilize e
contribua
Seja produtivo rapidamente
Arquitetura sem Agentes
Utiliza OpenSSH, WinRM, API
ou Netconf
Sem agentes para instalar,
gerenciar ou explorar
vulnerabilidades
Início imediato!!
Maior Eficiência & mais
segurança
POR QUE ANSIBLE?
3. 3
CROSS PLATAFORMA
Suporte sem agente para todas as
principais variantes do sistema
operacional, dispositivos físicos,
virtuais, em nuvem e de rede.
HUMAN READABLE
Descreva e documenta
perfeitamente todos os aspectos do
seu ambiente de aplicativos.
DESCRIÇÃO PERFEITA DA
APLICAÇÃO
Cada mudança pode ser feita por
Playbooks, garantindo que todos
estejam na mesma página.
CONTROLE DE VERSÃO
Playbooks são texto simples.Trate-os
como código em seu controle de
versão existente.
INVENTÁRIOS DINÂMICOS
Capture,,descubra todos os
servidores 100% do tempo,
independentemente da
infraestrutura, localização, ...
ORQUESTRAÇÃO COM
OUTRAS PLATAFORMAS
Cada mudança pode ser feita por
Playbooks, garantindo que todos na
organização estejam na mesma
página.
THE ANSIBLE WAY
4. 4
O QUE PODEMOS FAZER COM ANSIBLE?
Automatize a implante o gerenciamento de todo o seu TI.
Orquestração
Permite...
Firewalls
Gerenciamento
de configuração
Entrega de
aplicações
Provisionamento
Continuous
Delivery
Segurança e
compliance
Com...
Load Balancers Aplicações Containers Clouds
Servers Infraestrutura Storage E mais...Network Devices
6. 6
ANSIBLE’S AUTOMATION ENGINE
CMDB
USERS
INVENTORY
HOSTS
NETWORK
DEVICES
PLUGINS
API
MODULES
PUBLIC / PRIVATE
CLOUD
PUBLIC / PRIVATE
CLOUD
ANSIBLE
PLAYBOOK
ANSIBLE’S AUTOMATION ENGINE
CMDB
INVENTORY
HOSTS
NETWORK
DEVICES
PLUGINS
API
MODULES
PUBLIC / PRIVATE
CLOUD
PUBLIC / PRIVATE
CLOUD
USERS
ANSIBLE
PLAYBOOK
PLAYBOOKS
• Written in YAML
• Tasks are executed sequentially
• Invokes Ansible modules
MODULES
• Tools in the toolkit
• Python, Powershell or
any language
• Extend Ansible simplicity
to entire stack
ANSIBLE’S AUTOMATION ENGINE
CMDB
INVENTORY
HOSTS
NETWORK
DEVICES
PLUGINS
API
PUBLIC / PRIVATE
CLOUD
PUBLIC / PRIVATE
CLOUD
USERS
ANSIBLE
PLAYBOOK
MODULES
COMO O ANSIBLE TRABALHA
CMDB
PUBLIC / PRIVATE
CLOUD
PLUGINS
• Gears in the engine
• Python that plugs into the
core engine
• Adaptability for various uses
& platforms
USERS
ANSIBLE
PLAYBOOK
ANSIBLE’S AUTOMATION ENGINE
HOSTS
NETWORK
DEVICES
API
MODULES
PUBLIC / PRIVATE
CLOUD
INVENTORY
PLUGINS
USERS
ANSIBLE
PLAYBOOK
[web]
webserver1.example.com
webserver2.example.com
[db]
dbserver1.example.com
ANSIBLE’S AUTOMATION ENGINE
CMDB
HOSTS
NETWORK
DEVICES
PLUGINS
API
MODULES
PUBLIC / PRIVATE
CLOUD
PUBLIC / PRIVATE
CLOUD
INVENTORY
CLOUD
OpenStack, VMware, EC2,
Rackspace, GCE, Azure,
Spacewalk, Hanlon, Cobbler
CUSTOM CMDBUSERS
ANSIBLE
PLAYBOOK
ANSIBLE’S AUTOMATION ENGINE
HOSTS
NETWORK
DEVICES
PLUGINS
API
MODULES
PUBLIC / PRIVATE
CLOUD
INVENTORY
CMDB
PUBLIC / PRIVATE
CLOUD
7. 7
POR QUE AUTOMAÇÃO É IMPORTANTE?
Os aplicativos e sistemas são mais do que apenas software
e suas configurações. Eles também são resultado de
conhecimento, e procedimentos operacionais, muitas
vezes, bem documentados, outras nem tanto …
Que resultam em uma lista de atividades e processos
necessários para entregar a solução dentro dos
parâmetros desejados para atender as áreas de
compliance, segurança, operação, arquitetura e
performance...
Ansible pode fazer tudo:
• Provisionamento
• Implantação de aplicativos
• Gerenciamento de configurações
• Orquestração multicamada
8. 8
Ansible é a primeira linguagem de automação que pode ser utilizada em todas as áreas de TI.
Ansible é a única automation engine que pode automatizar o ciclo completo de vida das aplicações e o pipeline de delivery
Do desenvolvimento... …para produção.
ANSIBLE PLAYBOOK
DEV/TEST Q/A OPERAÇÕES GERENCIAMENTO OUTSOURCERS
COMUNICAÇÃO É A CHAVE PARA DEVOPS
9. 9
EXEMPLO DE PLAYBOOK: LINUX
---
- name: install and start apache
hosts: web
become: yes
vars:
http_port: 80
tasks:
- name: httpd package is present
yum:
name: httpd
state: latest
- name: latest index.html file is present
copy:
src: files/index.html
dest: /var/www/html/
- name: httpd is started
service:
name: httpd
state: started
---
- name: install and start apache
hosts: web
become: yes
vars:
http_port: 80
tasks:
- name: httpd package is present
yum:
name: httpd
state: latest
- name: latest index.html file is present
copy:
src: files/index.html
dest: /var/www/html/
- name: httpd is started
service:
name: httpd
state: started
---
- name: install and start apache
hosts: web
become: yes
vars:
http_port: 80
tasks:
- name: httpd package is present
yum:
name: httpd
state: latest
- name: latest index.html file is present
copy:
src: files/index.html
dest: /var/www/html/
- name: httpd is started
service:
name: httpd
state: started
---
- name: install and start apache
hosts: web
become: yes
vars:
http_port: 80
tasks:
- name: httpd package is present
yum:
name: httpd
state: latest
- name: latest index.html file is present
copy:
src: files/index.html
dest: /var/www/html/
- name: httpd is started
service:
name: httpd
state: started
---
- name: install and start apache
hosts: web
become: yes
vars:
http_port: 80
tasks:
- name: httpd package is present
yum:
name: httpd
state: latest
- name: latest index.html file is present
copy:
src: files/index.html
dest: /var/www/html/
- name: httpd is started
service:
name: httpd
state: started
---
- name: install and start apache
hosts: web
become: yes
vars:
http_port: 80
tasks:
- name: httpd package is present
yum:
name: httpd
state: latest
- name: latest index.html file is present
copy:
src: files/index.html
dest: /var/www/html/
- name: httpd is started
service:
name: httpd
state: started
10. 10
- hosts: new_servers
tasks:
- name: ensure common OS updates are current
win_updates:
register: update_result
- name: ensure domain membership
win_domain_membership:
dns_domain_name: contoso.corp
domain_admin_user: '{{ domain_admin_username }}'
domain_admin_password: '{{ domain_admin_password }}'
state: domain
register: domain_result
- name: reboot and wait for host if updates or domain change require it
win_reboot:
when: update_result.reboot_required or domain_result.reboot_required
- name: ensure local admin account exists
win_user:
name: localadmin
password: '{{ local_admin_password }}'
groups: Administrators
- name: ensure common tools are installed
win_chocolatey:
name: '{{ item }}'
with_items: ['sysinternals', 'googlechrome']
EXEMPLO DE PLAYBOOK: WINDOWS
17. - name: validate bgp neighbor
net_bgp_neighbor:
peer: 1.1.1.1
nbr_state: established
pfx_rx: 16593
pfx_tx: 132
DECLARATIVE INTENTCONFIGURAÇÃO
VALIDAÇÃO DO ESTADO
- name: configure bgp neighbor
net_bgp_neighbor:
peer: 1.1.1.1
remote_as: 65000
enabled: yes
Somente realiza a configuração
Ignora o estado do recurso no dispositivo
Somente realiza a validação do estado
Ignora a configuração do dispositivo
DECLARATIVO...
21. Problema:
• Gerenciar políticas através de
diferentes tipos de hardware e
software é uma atividade
complexa e sujeita a erros
• Implementar requerimentos de
segurança (STIG, PCI..;) na
infraestrutura é difícil de
implementar e manter
SEGURANÇA
Solução:
• Defina a política uma única vez.
Aplique-a em multiplas
infraestruturas (física, virtual, cloud,
network, sistema…)
• Aproveite políticas e diretrizes pré
definidas para implementar em toda
a infraestrutura
23. Problema:
• Clouds privadas, públicas e híbridas
aumenta o número de recursos
gerenciados
• Recursos de Clouds são diferentes de
recursos de on-premise e diferentes
nuvens aumentam ainda mais a
complexidade
Solução:
• Automatize tarefas através de
múltiplos dispositivos e nuvens com
o mesmo workflow
• Defina a política uma única vez, e
aplique-a a multiplas infraestruturas
(física, virtual, cloud, network,
sistema…)
CLOUD PRIVADA, PÚBLICA OU HÍBRIDA
25. 25
RED HAT ANSIBLE TOWER
RED HAT ANSIBLE ENGINE
Escala + operacionalização para sua automação
Suporte para suas automações em Ansilble
CONTROLE CONHECIMENTO DELEGAÇÃO
SIMPLES PODEROSO AGENTLESS
ALIMENTADO POR UMA COMUNIDADE OPEN SOURCE INOVADORA
26. 26
USE
CASES
USERS
ANSIBLE
PYTHON CODEBASE
OPEN SOURCE MODULE LIBRARY
PLUGINS
CLOUD
AWS,
GOOGLE CLOUD,
AZURE …
INFRASTRUCTURE
LINUX,
WINDOWS,
UNIX …
NETWORKS
ARISTA,
CISCO,
JUNIPER …
CONTAINERS
DOCKER,
LXC …
SERVICES
DATABASES,
LOGGING,
SOURCE CONTROL
MANAGEMENT…
TRANSPORT
SSH, WINRM, ETC.
AUTOMATE
YOUR
ENTERPRISE
ADMINS
ANSIBLE CLI & CI SYSTEMS
ANSIBLE PLAYBOOKS
….
ANSIBLE
TOWER
SIMPLE USER INTERFACE TOWER API
ROLE-BASED
ACCESS CONTROL
KNOWLEDGE
& VISIBILITY
SCHEDULED &
CENTRALIZED JOBS
CONFIGURATION
MANAGEMENT
APP
DEPLOYMENT
CONTINUOUS
DELIVERY
SECURITY &
COMPLIANCE
ORCHESTRATIONPROVISIONING
43. 43
10,000 ROLES AT YOUR DISPOSAL
Re-usable Roles and Container Apps that allow you to do more, faster
Built into the Ansible CLI and Tower
galaxy.ansible.com