Ansible Automation Technical Deck

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 71

AUTOMATION FOR EVERYONE

Ansible technical introduction and overview

Brad Hinson
Solution Architect
[email protected]
Automation happens when one person meets
a problem they never want to solve again
ACCELERATE INTEGRATE COLLABORATE
WHAT IS ANSIBLE AUTOMATION?

Ansible Automation is the enterprise


framework for automating across IT
operations. RED HAT ANSIBLE TOWER
Operationalize your automation
Ansible Engine runs Ansible
Playbooks, the automation language CONTROL DELEGATION SCALE

that can perfectly describe an IT


application infrastructure. RED HAT ANSIBLE ENGINE
Simple command line automation
Ansible Tower allows you scale IT
automation, manage complex SIMPLE POWERFUL AGENTLESS

deployments and speed productivity.

FUELED BY AN INNOVATIVE OPEN SOURCE COMMUNITY


WHY ANSIBLE?

SIMPLE POWERFUL AGENTLESS

Human readable automation App deployment Agentless architecture

No special coding skills needed Configuration management Uses OpenSSH & WinRM

Tasks executed in order Workflow orchestration No agents to exploit or update

Usable by every team Network automation Get started immediately

Get productive quickly Orchestrate the app lifecycle More efficient & more secure
ANSIBLE AUTOMATION WORKS ACROSS TEAMS

BUSINESS DEV NETWORK QA/SECURITY I.T. OPERATIONS


WHAT CAN I DO USING ANSIBLE?
Automate the deployment and management of your entire IT footprint.

Do this...

Configuration Application Continuous Security and


Orchestration Provisioning
Management Deployment Delivery Compliance

On these...

Firewalls Load Balancers Applications Containers Clouds

Servers Infrastructure Storage Network Devices And more...


ANSIBLE AUTOMATES TECHNOLOGIES YOU USE
Time to automate is measured in minutes

CLOUD VIRT & WINDOWS NETWORK DEVOPS MONITORING


CONTAINER
AWS Docker ACLs Arista Jira Dynatrace
Azure VMware Files A10 GitHub Airbrake
Digital Ocean RHV Packages Cumulus Vagrant BigPanda
Google OpenStack IIS Bigswitch Jenkins Datadog
OpenStack OpenShift Regedits Cisco Bamboo LogicMonitor
Rackspace +more Shares Cumulus Atlassian Nagios
+more Services Dell Subversion New Relic
Configs F5 Slack PagerDuty
OPERATING STORAGE
Users Juniper Hipchat Sensu
SYSTEMS NetApp
Domains Palo Alto +more StackDriver
RHEL and Linux Red Hat Storage
+more OpenSwitch Zabbix
UNIX Infinidat
+more +more
Windows +more
+more
FINANCIAL SUMMARY:

BY THE NUMBERS:

94% Reduction in recovery time


following a security incident
146%
ROI ON ANSIBLE TOWER

Savings by deploying workloads

84% to generic systems appliances


using Ansible Tower
<
3 MONTHS
67% Reduction in man hours required
for customer deliveries
PAYBACK ON ANSIBLE TOWER

SOURCE: "The Total Economic Impact™ Of Red Hat Ansible Tower, a June 2018 commissioned study conducted by Forrester Consulting on behalf of Red
Hat."
redhat.com/en/engage/total-economic-impact-ansible-tower-20180710
LANGUAGE OF AUTOMATION
CROSS PLATFORM HUMAN READABLE PERFECT DESCRIPTION
OF APPLICATION
Agentless support for all major OS Perfectly describe and document every Every change can be made by
variants, physical, virtual, cloud and aspect of your application Playbooks, ensuring everyone is on
network devices. environment. the same page.

VERSION CONTROLLED DYNAMIC INVENTORIES ORCHESTRATION


PLAYS WELL WITH
OTHERS
Playbooks are plain-text. Treat them Capture all the servers 100% of the Orchestration plays well with others:
like code in your existing version time, regardless of infrastructure, ServiceNow, Infoblox, AWS,
control. location, etc. Terraform, Cisco ACI and more
AUTOMATION FOR EVERYONE
---
- 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
PUBLIC / PRIVATE
CLOUD PUBLIC / PRIVATE
CMDB CLOUD

ANSIBLE AUTOMATION ENGINE

USERS

HOSTS
INVENTORY CLI

MODULES PLUGINS
NETWORK
ANSIBLE DEVICES
PLAYBOOK
PUBLIC / PRIVATE
CLOUD PUBLIC / PRIVATE
CLOUD
CMDB

ANSIBLE AUTOMATION ENGINE

PLAYBOOKS ARE WRITTEN IN YAML


USERS
Tasks are executed sequentially
Invoke Ansible modules
HOSTS
INVENTORY CLI

MODULES PLUGINS
NETWORK
ANSIBLE DEVICES
PLAYBOOK
PUBLIC / PRIVATE
CLOUD PUBLIC / PRIVATE
CLOUD
CMDB

ANSIBLE AUTOMATION
MODULESENGINE
ARE “TOOLS IN THE TOOLKIT”
Python, Powershell, or any language
Extend Ansible simplicity to the entire stack
USERS

HOSTS
INVENTORY CLI

MODULES PLUGINS
NETWORK
ANSIBLE DEVICES
PLAYBOOK

CORE NETWORK COMMUNITY


PUBLIC / PRIVATE
CLOUD PUBLIC / PRIVATE
CLOUD
CMDB

PLUGINS ARE “GEARS IN THE ENGINE”


Code that plugs into the core engine
Adaptability
ANSIBLE AUTOMATIONfor various
ENGINEuses & platforms

USERS

HOSTS
INVENTORY CLI

MODULES PLUGINS
NETWORK
ANSIBLE DEVICES
PLAYBOOK
PUBLIC / PRIVATE
CLOUD PUBLIC / PRIVATE
CLOUD
CMDB
INVENTORY

[web]
ANSIBLE AUTOMATIONwebserver1.example.com
ENGINE
webserver2.example.com

USERS
[db]
dbserver1.example.com
HOSTS
INVENTORY CLI
[switches]
leaf01.internal.com
leaf02.internal.com
MODULES PLUGINS
[firewalls] NETWORK
ANSIBLE DEVICES
checkpoint01.internal.com
PLAYBOOK

[lb]
f5-01.internal.com
PUBLIC / PRIVATE
CLOUD PUBLIC / PRIVATE
CLOUD
CMDB

ANSIBLE AUTOMATION ENGINE

USERS

HOSTS
INVENTORY CLI

CLOUD MODULES PLUGINS


NETWORK
ANSIBLE Red Hat Openstack, Red Hat Satellite, VMware, DEVICES
PLAYBOOK AWS EC2, Rackspace, Google Compute Engine, Azure
PUBLIC / PRIVATE
CLOUD PUBLIC / PRIVATE
CMDB CLOUD

ANSIBLE AUTOMATION ENGINE

USERS CMDB
ServiceNow, Cobbler, BMC, Custom cmdb
HOSTS
INVENTORY CLI

MODULES PLUGINS
NETWORK
ANSIBLE DEVICES
PLAYBOOK
PUBLIC / PRIVATE
CLOUD PUBLIC / PRIVATE
CLOUD
CMDB

ANSIBLE AUTOMATION ENGINE

USERS

HOSTS
INVENTORY CLI

MODULES PLUGINS
AUTOMATE EVERYTHING NETWORK
ANSIBLE DEVICES
Red Hat Enterprise Linux, Ubuntu, Debian,
PLAYBOOK
Cisco routers, Arista switches, Juniper routers,
Windows hosts, Checkpoint firewalls and more
GITHUB
github.com/ansible/ansible-examples

LAMP + HAPROXY + NAGIOS


github.com/ansible/ansible-examples/tree/master/lamp_haproxy

PLAYBOOK EXAMPLES: WINDOWS


github.com/ansible/ansible-examples/tree/master/windows

SECURITY COMPLIANCE
github.com/ansible/ansible-lockdown

NETWORK AUTOMATION
ansible.com/linklight
github.com/network-automation
AUTOMATION ACROSS
THE ENTERPRISE
WHAT IS ANSIBLE TOWER?
Ansible Tower is a UI and RESTful API allowing
you to scale IT automation, manage complex
deployments and speed productivity.

• Role-based access control

• Deploy entire applications with


push-button deployment access

• All automations are centrally logged

• Powerful workflows match your IT processes


RBAC PUSH BUTTON RESTful API
Allow restricting playbook access to An intuitive user interface experience With an API first mentality every
authorized users. One team can use makes it easy for novice users to feature and function of Tower can be
playbooks in check mode (read-only) execute playbooks you allow them API driven. Allow seamless integration
while others have full administrative access to. with other tools like ServiceNow and
abilities. Infoblox.

WORKFLOWS ENTERPRISE CENTRALIZED LOGGING


INTEGRATIONS All automation activity is securely
Ansible Tower’s multi-playbook Integrate with enterprise authentication
workflows chain any number of like TACACS+, RADIUS, Azure AD. logged. Who ran it, how they
playbooks, regardless of whether they Setup token authentication with OAuth customized it, what it did, where it
use different inventories, run as 2. Setup notifications with PagerDuty, happened - all securely stored and
different users, run at once or utilize Slack and Twilio. viewable later, or exported through
different credentials. Ansible Tower’s API.
…. ANSIBLE CLI & CI SYSTEMS
ANSIBLE PLAYBOOKS
ADMINS
ROLE-BASED KNOWLEDGE SCHEDULED &
ANSIBLE ACCESS CONTROL & VISIBILITY CENTRALIZED JOBS
TOWER
SIMPLE USER INTERFACE TOWER API

USERS

OPEN SOURCE MODULE LIBRARY


ANSIBLE
ENGINE PLUGINS PYTHON CODEBASE

TRANSPORT

SSH, WINRM, ETC.

INFRASTRUCTUR NETWORKS CONTAINERS CLOUD SERVICES


E
AUTOMATE ARISTA, DOCKER, AWS, DATABASES,
YOUR LINUX, CISCO, LXC … GOOGLE CLOUD, LOGGING,
ENTERPRISE WINDOWS, JUNIPER … AZURE … SOURCE CONTROL
UNIX …
MANAGEMENT…

USE
CASES
PROVISIONING CONFIGURATION APP CONTINUOUS SECURITY & ORCHESTRATIO
MANAGEMENT DEPLOYMENT DELIVERY COMPLIANCE N
FEATURE OVERVIEW:

CONTROL
ANSIBLE TOWER FEATURES: YOUR ANSIBLE DASHBOARD
ANSIBLE TOWER FEATURES: JOB STATUS UPDATE
ANSIBLE TOWER FEATURES: ACTIVITY STREAM
ANSIBLE TOWER FEATURES: MANAGE AND TRACK YOUR INVENTORY
ANSIBLE TOWER FEATURES: SCHEDULE JOBS
ANSIBLE TOWER FEATURES: EXTERNAL LOGGING
ANSIBLE TOWER FEATURES: INTEGRATED NOTIFICATIONS
FEATURE OVERVIEW:

DELEGATION
ANSIBLE TOWER FEATURES: ROLE BASED ACCESS CONTROL
USERS TEAMS
ANSIBLE TOWER FEATURES: ROLE BASED ACCESS CONTROL

36
ANSIBLE TOWER FEATURES: SELF-SERVICE I.T.
ANSIBLE TOWER FEATURES: REMOTE COMMAND EXECUTION
FEATURE OVERVIEW:

SCALE
ANSIBLE TOWER FEATURES: CREATE AUTOMATION
WORKFLOWS
ANSIBLE TOWER FEATURES: SCALE OUT CLUSTERING
USE CASE:

LINUX AUTOMATION
LINUX AUTOMATION
AUTOMATE EVERYTHING

150+ LINUX
Red Hat Enterprise Linux, BSD,
Debian, Ubuntu and many more!
Linux Modules
ONLY REQUIREMENTS:
Python 2 (2.6 or later)
or Python 3 (3.5 or later)

ansible.com/get-started
AUTOMATION FOR EVERYONE: SYSTEM ADMINISTRATORS

---
- name: upgrade rhel packages
hosts: rhel

tasks:
- name: upgrade all packages
yum:
name: '*'
state: latest
AUTOMATION FOR EVERYONE: SYSTEM ADMINISTRATORS

---
- name: reboot rhel hosts
hosts: rhel

tasks:
- name: reboot the machine
reboot:
AUTOMATION FOR EVERYONE: SYSTEM ADMINISTRATORS

---
- name: check services on rhel hosts
hosts: rhel
become: yes

tasks:
- name: ensure nginx is started
service:
name: nginx
state: started
USE CASE:

NETWORK AUTOMATION
ANSIBLE NETWORK AUTOMATION

50 700+ 12*
Network Network Galaxy
Platforms Modules Network Roles

ansible.com/for/networks
galaxy.ansible.com/ansible-network

*Roles developed and maintained by Ansible Network Engineering


WHY AUTOMATE YOUR NETWORK?
PLAN AND PROTOTYPE VIRTUALLY
Use tasks as reusable building blocks

USE YOUR CURRENT DEVELOPMENT PRACTICES


Agile, DevOps, Waterfall

GO BEYOND THE “PING” TEST


Integrate with formal testing platforms

BE CONFIDENT DURING DEPLOYMENT


Validate changes were successful

ENSURE AN ON-GOING STEADY-STATE


AUTOMATION FOR EVERYONE: NETWORK ENGINEERS

---
- hosts: cisco
gather_facts: false
connection: network_cli

tasks:
- name: show command for cisco
cli_command:
command: show ip int br
register: result

- name: display result to terminal window


debug:
var: result.stdout_lines
AUTOMATION FOR EVERYONE: PLAYBOOK RESULTS
AUTOMATION FOR EVERYONE: NETWORK ENGINEERS

---
- hosts: juniper
gather_facts: false
connection: network_cli

tasks:
- name: show command for juniper
cli_command:
command: show interfaces terse em1
register: result

- name: display result to terminal window


debug:
var: result.stdout_lines
AUTOMATION FOR EVERYONE: PLAYBOOK RESULTS
USE CASE:

WINDOWS AUTOMATION
WINDOWS AUTOMATION

90+ 1,300+
Windows Powershell DSC
Modules resources

ansible.com/windows
AUTOMATION FOR EVERYONE: WINDOWS ADMINS
---
- name: windows playbook
hosts: new_servers

tasks:
- name: ensure local admin account exists
win_user:
name: localadmin
password: '{{ local_admin_password }}'
groups: Administrators
AUTOMATION FOR EVERYONE: WINDOWS ADMINS
---
- name: windows playbook
hosts: windows_machines

tasks:
- name: ensure common tools are installed
win_chocolatey:
name: '{{ item }}'
loop: ['sysinternals', 'googlechrome']
AUTOMATION FOR EVERYONE: WINDOWS ADMINS
---
- name: update and reboot
hosts: windows_servers
tasks:
- name: ensure common OS updates are current
win_updates:
register: update_result

- name: reboot and wait for host if updates change require it


win_reboot:
when: update_result.reboot_required
AUTOMATION FOR EVERYONE: WINDOWS ADMINS
---
- name: update domain and reboot
hosts: windows_servers
tasks:
- 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 domain change require it


win_reboot:
when: domain_result.reboot_required
USE CASE:

CLOUD AUTOMATION
CLOUD AUTOMATION

800+ 30+
Cloud Cloud Platforms
Modules

ansible.com/cloud
PLAYBOOK EXAMPLE: AWS
---
- name: aws playbook
hosts: localhost
connection: local

tasks:
- name: create AWS VPC ansible-vpc
ec2_vpc_net:
name: "ansible-vpc"
cidr_block: "192.168.0.0/24"
tags:
demo: the demo vpc
register: create_vpc
PLAYBOOK EXAMPLE: AZURE
---
- name: azure playbook
hosts: localhost
connection: local

tasks:
- name: create virtual network
azure_rm_virtualnetwork:
resource_group: myResourceGroup
name: myVnet
address_prefixes: "10.0.0.0/16"
PLAYBOOK EXAMPLE: RED HAT OPENSTACK
---
- name: openstack playbook
hosts: localhost
connection: local

tasks:
- name: launch an instance
os_server:
name: vm1
cloud: mordred
region_name: ams01
image: Red Hat Enterprise Linux 7.4
flavor_ram: 4096
USE CASE:

SECURITY AUTOMATION
WHAT IS IT?

Ansible Security Automation is a supported set of Ansible modules, roles


and playbooks designed to unify the security response to cyberattacks in a
new way - by orchestrating the activity of multiple classes of security solutions
that wouldn’t normally integrate with each other.
WHAT DOES IT DO?
Through Ansible Security Automation, IT organizations can address multiple popular use cases:

● For detection and triage of suspicious activities, for example, Ansible can automatically enable
logging or increase the log verbosity across enterprise firewalls and IDS to enrich the alerts received
by a SIEM for an easier triage.
● For threat hunting, for example, Ansible can automatically create new IDS rules to investigate the
origin of a firewall rule violation, and whitelist those IP addresses recognized as non threats.
● For incident response, for example, Ansible can automatically validate a threat by verifying an IDS
rule, trigger a remediation from the SIEM solution, and create new enterprise firewall rules to blacklist
the source of an attack.

At launch, Red Hat's Ansible security automation platform provides support for:

● Check Point – Next Generation Firewall (NGFW);


● Splunk – Splunk Security Enterprise (SE);
● Snort
WHO IS IT FOR?
Ansible Security Automation extends the Ansible agentless, modular and easy to use
enterprise automation platform to support the following industry constituencies:

● End-user organizations’ security teams in charge of Security Operations Centres


(SOCs)

● Managed security service providers (MSSPs) responsible for the governance of


thousands of enterprise security solutions across their whole customer base

● Security ISVs offering security orchestration and automation (SOAR) solutions


currently using custom-made automation frameworks
AUTOMATION FOR EVERYONE: SECURITY OPERATIONS
---
- name: checkpoint playbook
hosts: checkpoint
connection: httpapi

tasks:
- name: create access rule
checkpoint_access_rule:
layer: Network
name: "Drop attacker"
position: top
source: attacker
destination: Any
action: Drop
AUTOMATION FOR EVERYONE: SECURITY OPERATIONS
---
- name: checkpoint playbook
hosts: checkpoint
connection: httpapi

tasks:
- name: delete access rule
checkpoint_access_rule:
layer: Network
name: "Drop attacker"
state: absent
NEXT STEPS

GET STARTED JOIN THE COMMUNITY


ansible.com/get-started ansible.com/community

ansible.com/tower-trial

WORKSHOPS & TRAINING SHARE YOUR STORY


ansible.com/workshops Follow us @Ansible

Red Hat Training Friend us on Facebook

You might also like