SlideShare a Scribd company logo
1 of 50
Automate yourself out of trouble
with Ansible
How we use Ansible at Dell EMC
Jose Delarosa / Sambhu Kalaga
Dell EMC
May 8th, 2019
Who are we
• Jose Delarosa
- Software Engineer
- Infrastructure solutions team
• Sambhu Kalaga
- Software Engineer
- OpenStack solutions team
Before we begin
1. Thank you for attending!
2. Please ask questions anytime
3. If time runs out, happy to talk to you afterwards
Why are we here today?
1. These days, automation is a necessity, not a luxury.
2. Ansible is a great tool for automation!
3. Dell EMC is active in the Ansible community and we
want to share with you some of the work we’ve done.
Agenda
1. Brief overview of Ansible
2. How Dell EMC uses Ansible
• Network switch configuration
• OpenStack configuration
• Out-of-band server management
• OpenShift deployment
3. Conclusion
Brief Ansible overview
Ansible in a nutshell
1. Agentless, no DB backend  Minimum footprint
2. Remote tasks are run in parallel  Fast & efficient
3. Only do things if needed  Idempotent
4. Easy to learn and use  Reduced learning curve
Some use cases for automation
OpenStack
• Compute nodes
• Storage nodes
• Controller nodes Container Management
• Stop & remove containers
• Refresh container images
• Deploy new containers
 1-to-n management
 Executes tasks in parallel
IT Security Hardening
• Firewall rules
• Remove unused packages
• Install security updates
Ansible components
Task: A Task is the smallest unit of work: “install a package” or “remove a user”.
Play: A Play is composed of tasks: The Play “prepare database” is composed of two
Tasks:
 Task 1: Create database
 Task 2: Give users access to database
Playbook: A Playbook is a collection of plays: The playbook “Setup my application” has
two Plays: 1) “prepare database” and 2) “prepare web server”.
Playbook: Setup my web application
Play 1: Setup database
Task 1:
Install mysql
package
Task 2:
Create database
customer_db
Play 2: Setup web server
Task 1:
Install httpd
package
Task 2:
Configure
site for TLS
Example
Say you provision 100 servers every
day and you run these commands
in each server:
The same
commands can be
placed in an Ansible
playbook and
executed in 100
servers.
daily_tasks.yml
$ ansible-playbook daily_tasks.yml
Ansible module
• An Ansible module is the code that implements all
the commands specified in playbooks.
• Modules can be written in any language, but most
popular is Python.
• If you are a system administrator, you will work
mostly with playbooks.
• If you are a developer, you will work mostly with
modules.
Ansible Template
Sample VLAN template –Dell EMC OS10 NOS
Template: A template is a file in
Ansible which is used to dynamically
create configurations using the
values from a variable file.
Ansible Roles
• Role: Dell EMC Networking modules are packaged
and distributed through Ansible-galaxy. These pre-
packaged units are known as roles. Ansible roles
have specific file structure and are easily shared
with other users. Roles help separate configuration
syntax from data.
Sample file structure:
Example: Network Switch Configuration
Stack ID
Stack ID
Stack ID
Stack ID
Stack ID
Dell EMC S5248
Network Switch with
OS10
33 34 35 3631 3229 3027 2825 26 45 46 47 4843 4441 4239 4037 389 10 11 127 85 63 41 2 21 22 23 2419 2017 1815 1613 14 50 52 54
49 51 53
StackID
33 34 35 3631 3229 3027 2825 26 45 46 47 4843 4441 4239 4037 389 10 11 127 85 63 41 2 21 22 23 2419 2017 1815 1613 14 50 52 54
49 51 53
StackID
33 34 35 3631 3229 3027 2825 26 45 46 47 4843 4441 4239 4037 389 10 11 127 85 63 41 2 21 22 23 2419 2017 1815 1613 14 50 52 54
49 51 53
StackID
33 34 35 3631 3229 3027 2825 26 45 46 47 4843 4441 4239 4037 389 10 11 127 85 63 41 2 21 22 23 2419 2017 1815 1613 14 50 52 54
49 51 53
StackID
33 34 35 3631 3229 3027 2825 26 45 46 47 4843 4441 4239 4037 389 10 11 127 85 63 41 2 21 22 23 2419 2017 1815 1613 14 50 52 54
49 51 53
StackID
Dell EMC S4048
Network Switch with
OS9
Dell EMC N4000
Network Switches with
OS6
YAML INVENTORY /
DATABASE
Configuration Modules
and Templates
Ansible
Create device configurations
Deploy configurations via SSH
Ansible concept
ACTLNK
1 2ACT
LNK
ACT
LNK
2 864
1 753
10 161412
9 151311
18 242220
17 232119
26 323028
25 312927
34 403836
33 393735
42 484644
41 474543
ACTLNK
1 2ACT
LNK
ACT
LNK
2 864
1 753
10 161412
9 151311
18 242220
17 232119
26 323028
25 312927
34 403836
33 393735
42 484644
41 474543
ACTLNK
1 2ACT
LNK
ACT
LNK
2 864
1 753
10 161412
9 151311
18 242220
17 232119
26 323028
25 312927
34 403836
33 393735
42 484644
41 474543
ACTLNK
1 2ACT
LNK
ACT
LNK
2 864
1 753
10 161412
9 151311
18 242220
17 232119
26 323028
25 312927
34 403836
33 393735
42 484644
41 474543
ACTLNK
1 2ACT
LNK
ACT
LNK
2 864
1 753
10 161412
9 151311
18 242220
17 232119
26 323028
25 312927
34 403836
33 393735
42 484644
41 474543
Dell EMC R740XD
Rack Server
Dell EMC Networking Roles
• Dell EMC Ansible Network Roles:
• Dellos-acl
• Dellos-bgp
• Dellos-dcb
• Dellos-interface
• Dellos-lag
• Dellos-system
• Dellos-vlan
• Dellos-vlt
• Dellos-vrf
• Dellos-xstp
• Dellos-ecmp
• Dellos-prefixlist
Sample file structure:
Install Dell EMC Ansible Network Roles
• Enable Ansible repository:
• Install Ansible:
• Install Dell Networking Ansible Roles:
Example Leaf-Spine switch deployment
33 34 35 3631 3229 3027 2825 26 45 46 47 4843 4441 4239 4037 389 10 11 127 85 63 41 2 21 22 23 2419 2017 1815 1613 14 50 52 54
49 51 53
StackID
2 864
1 753
10 161412
9 151311
18 242220
17 232119 ACTLNK
2 864
1 753
10 161412
9 151311
18 242220
17 232119 ACTLNK
VLT
Spine
Leaf1 Leaf2
Sample playbook
Inventory file
xxx.xxx.xxx.xxx
xxx.xxx.xxx.xxx
xxx.xxx.xxx.xxx
Dell Fabric Design Center
Dell EMC Ansible resources
• Dell EMC Ansible Galaxy documentation
• Dell EMC Network ansible examples
• Dell EMC Networking guides
• Dell EMC Fabric center
Example: Red Hat OpenStack
configuration
Dell EMC RedHat Open Stack
• JetPack is available here
Dell EMC RedHat Open Stack
Open Stack Use cases include:
• Projects
• Networks
• Users
• Security groups
• Flavors
• Instances
• and many more!!
Open Stack Project Configs
Open Stack User Configs
Open Stack Network Configs
Open Stack Network Configs
Open Stack Network Configs
Open Stack Network Configs
Example: Out-of-Band Server
Management
Out-of-Band management
1. Server management independent of the operating system.
2. Provided by an embedded chip with its own Ethernet port.
3. Goes by many names: iDRAC, iLO, IMM, but commonly referred to as
BMC (Baseboard Management Controller).
4. Capabilities include:
 Component inventory
 Hardware failure detection & alerting
 Power management
 BIOS configuration
Communicating with the BMC
1. There are several legacy protocols that can be used: IPMI, WS-MAN,
racadm, etc. but these are not secure, hard to use, proprietary and
not very scalable.
2. Redfish addresses all these short-comings! It is the best method to
communicate with the BMC:
 Open source
 RESTful interface
 Secure
 Scalable
3. A Redfish request is sent as an URI, so a client could be any
application on a server, workstation or mobile device.
Ansible modules for Redfish
1. Dell created and merged upstream 3 modules for Redfish.
2. Everything you need to manage your servers:
• redfish_facts: status, hardware inventory, etc.
• redfish_command: power management, user management, etc.
• redfish_config: BIOS attributes, boot mode, etc.
3. Vendor-neutral, with ongoing contributions from developers
at the DMTF, Dell, HP, Lenovo and others.
4. Use these modules to manage your heterogeneous server
infrastructure from one Ansible controller.
Server management made easy
Management
Network
https://<BMC-IP>/redfish/v1/Systems/Systems.Embedded.1
{
Health OK
HealthRollup OK
}
1
2
Server management made really easy
Management
Network
{
Health OK
HealthRollup OK
}
1
2
Module: redfish_facts
Category: Systems
Command: GetSystemInventory
Module: redfish_config
Category: Systems
Command: SetBiosAttributes
Playbook Playbook
docs.ansible.com
Example: Get system health
$ curl https://<BMC-IP>/redfish/v1/Systems/System.Embedded.1 --user root:password | jq .Status
{
"Health": "OK",
"HealthRollUp": "OK"
"State" : "Enabled"
}
Get system health with Ansible
Playbook
Results placed
In JSON file
Example: Get System Event Logs
$ curl https://<BMC-IP>/redfish/v1/Managers/iDRAC.Embedded.1/Logs/Sel --user root:password |
jq '.Members[] | {date: .Created, message: .Message, severity: .Severity}'
--- snip ---
{
"date": "2017-09-26T13:33:00-05:00",
"message": "Power supply redundancy is lost.",
"severity": "Critical"
}
{
"date": "2017-09-26T13:32:53-05:00",
"message": "The power input for power supply 2 is lost.",
"severity": "Critical"
}
{
"date": "2017-09-16T10:37:59-05:00",
"message": "Log cleared.",
"severity": "Ok"
}
Get System Event Logs with Ansible
Playbook
Results placed
In JSON file
Example: Set boot mode to UEFI and reboot
Change boot mode to UEFI
$ curl https://<BMC-IP>/redfish/v1/Systems/System.Embedded.1/Bios/Settings 
--request PATCH 
--header "Content-Type: application/json" 
--data '{"Attributes":{"BootMode":"Uefi"}}' 
--user root:password
Reboot
$ curl https://<BMC-IP>/redfish/v1/Systems/System.Embedded.1/Actions/ComputerSystem.Reset 
--request POST 
--header "Content-Type: application/json" 
--data '{"ResetType":"GracefulRestart"}' 
--user root:password
Set boot mode to UEFI and reboot with Ansible
Playbook
Full set of playbooks at
https://github.com/dell/redfish-ansible-module
Example: Deploying OpenShift
Reference Architecture for OpenShift
1. Deployment was 95% automated with Ansible
2. Used Ansible to automate:
 Switch configuration (VLT, VLANs, LACP)
 Server BIOS configuration
 OS Provisioning via iPXE
 OpenShift deployment: master, infrastructure, application &
storage nodes
 GlusterFS pool
Reference Architecture for OpenShift
Reference Architecture for OpenShift
1. Download OpenShift RA here.
2. Roles and playbooks available here.
3. Future Reference Architectures between Dell and
Red Hat will continue to leverage Ansible.
Conclusion
Conclusion
1. These are just a few examples of how we use Ansible.
2. Code contributions are welcome!
3. Want feedback on what you’d like to see automated
Thank you!
Q & A
Automating Yourself Out of Trouble

More Related Content

What's hot

What's hot (20)

iSCSI Target Support for Ceph
iSCSI Target Support for Ceph iSCSI Target Support for Ceph
iSCSI Target Support for Ceph
 
Developing a Ceph Appliance for Secure Environments
Developing a Ceph Appliance for Secure EnvironmentsDeveloping a Ceph Appliance for Secure Environments
Developing a Ceph Appliance for Secure Environments
 
Ceph Day Melbourne - Troubleshooting Ceph
Ceph Day Melbourne - Troubleshooting Ceph Ceph Day Melbourne - Troubleshooting Ceph
Ceph Day Melbourne - Troubleshooting Ceph
 
Using Recently Published Ceph Reference Architectures to Select Your Ceph Con...
Using Recently Published Ceph Reference Architectures to Select Your Ceph Con...Using Recently Published Ceph Reference Architectures to Select Your Ceph Con...
Using Recently Published Ceph Reference Architectures to Select Your Ceph Con...
 
Walk Through a Software Defined Everything PoC
Walk Through a Software Defined Everything PoCWalk Through a Software Defined Everything PoC
Walk Through a Software Defined Everything PoC
 
Ceph Day Melbourne - Walk Through a Software Defined Everything PoC
Ceph Day Melbourne - Walk Through a Software Defined Everything PoCCeph Day Melbourne - Walk Through a Software Defined Everything PoC
Ceph Day Melbourne - Walk Through a Software Defined Everything PoC
 
DataStax | DSE: Bring Your Own Spark (with Enterprise Security) (Artem Aliev)...
DataStax | DSE: Bring Your Own Spark (with Enterprise Security) (Artem Aliev)...DataStax | DSE: Bring Your Own Spark (with Enterprise Security) (Artem Aliev)...
DataStax | DSE: Bring Your Own Spark (with Enterprise Security) (Artem Aliev)...
 
Ceph Performance Profiling and Reporting
Ceph Performance Profiling and ReportingCeph Performance Profiling and Reporting
Ceph Performance Profiling and Reporting
 
2016-JAN-28 -- High Performance Production Databases on Ceph
2016-JAN-28 -- High Performance Production Databases on Ceph2016-JAN-28 -- High Performance Production Databases on Ceph
2016-JAN-28 -- High Performance Production Databases on Ceph
 
[OpenStack Days Korea 2016] Track1 - All flash CEPH 구성 및 최적화
[OpenStack Days Korea 2016] Track1 - All flash CEPH 구성 및 최적화[OpenStack Days Korea 2016] Track1 - All flash CEPH 구성 및 최적화
[OpenStack Days Korea 2016] Track1 - All flash CEPH 구성 및 최적화
 
Ceph Day Melbourne - Ceph on All-Flash Storage - Breaking Performance Barriers
Ceph Day Melbourne - Ceph on All-Flash Storage - Breaking Performance BarriersCeph Day Melbourne - Ceph on All-Flash Storage - Breaking Performance Barriers
Ceph Day Melbourne - Ceph on All-Flash Storage - Breaking Performance Barriers
 
Ceph Day Melbourne - Scale and performance: Servicing the Fabric and the Work...
Ceph Day Melbourne - Scale and performance: Servicing the Fabric and the Work...Ceph Day Melbourne - Scale and performance: Servicing the Fabric and the Work...
Ceph Day Melbourne - Scale and performance: Servicing the Fabric and the Work...
 
AF Ceph: Ceph Performance Analysis and Improvement on Flash
AF Ceph: Ceph Performance Analysis and Improvement on FlashAF Ceph: Ceph Performance Analysis and Improvement on Flash
AF Ceph: Ceph Performance Analysis and Improvement on Flash
 
Journey to Stability: Petabyte Ceph Cluster in OpenStack Cloud
Journey to Stability: Petabyte Ceph Cluster in OpenStack CloudJourney to Stability: Petabyte Ceph Cluster in OpenStack Cloud
Journey to Stability: Petabyte Ceph Cluster in OpenStack Cloud
 
VMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld 2016: vSphere 6.x Host Resource Deep DiveVMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld 2016: vSphere 6.x Host Resource Deep Dive
 
Ceph on All Flash Storage -- Breaking Performance Barriers
Ceph on All Flash Storage -- Breaking Performance BarriersCeph on All Flash Storage -- Breaking Performance Barriers
Ceph on All Flash Storage -- Breaking Performance Barriers
 
Transforming the Ceph Integration Tests with OpenStack
Transforming the Ceph Integration Tests with OpenStack Transforming the Ceph Integration Tests with OpenStack
Transforming the Ceph Integration Tests with OpenStack
 
[OpenStack Day in Korea 2015] Track 1-4 - VDI OpenStack? It Works!!!
[OpenStack Day in Korea 2015] Track 1-4 - VDI OpenStack? It Works!!![OpenStack Day in Korea 2015] Track 1-4 - VDI OpenStack? It Works!!!
[OpenStack Day in Korea 2015] Track 1-4 - VDI OpenStack? It Works!!!
 
Unattended Deployment with Zero Touch Provisioning (ZTP)
Unattended Deployment with Zero Touch Provisioning (ZTP)Unattended Deployment with Zero Touch Provisioning (ZTP)
Unattended Deployment with Zero Touch Provisioning (ZTP)
 
XPDS16: High-Performance Virtualization for HPC Cloud on Xen - Jun Nakajima &...
XPDS16: High-Performance Virtualization for HPC Cloud on Xen - Jun Nakajima &...XPDS16: High-Performance Virtualization for HPC Cloud on Xen - Jun Nakajima &...
XPDS16: High-Performance Virtualization for HPC Cloud on Xen - Jun Nakajima &...
 

Similar to Automating Yourself Out of Trouble

the NML project
the NML projectthe NML project
the NML project
Lei Yang
 

Similar to Automating Yourself Out of Trouble (20)

Ansible for networks
Ansible for networksAnsible for networks
Ansible for networks
 
What You Should Know About WebLogic Server 12c (12.2.1.2) #oow2015 #otntour2...
What You Should Know About WebLogic Server 12c (12.2.1.2)  #oow2015 #otntour2...What You Should Know About WebLogic Server 12c (12.2.1.2)  #oow2015 #otntour2...
What You Should Know About WebLogic Server 12c (12.2.1.2) #oow2015 #otntour2...
 
Weave User Group Talk - DockerCon 2017 Recap
Weave User Group Talk - DockerCon 2017 RecapWeave User Group Talk - DockerCon 2017 Recap
Weave User Group Talk - DockerCon 2017 Recap
 
Benchmark emc vnx7500, emc fast suite, emc snap sure and oracle rac on v-mware
Benchmark   emc vnx7500, emc fast suite, emc snap sure and oracle rac on v-mwareBenchmark   emc vnx7500, emc fast suite, emc snap sure and oracle rac on v-mware
Benchmark emc vnx7500, emc fast suite, emc snap sure and oracle rac on v-mware
 
Oracle virtual appliance
Oracle virtual applianceOracle virtual appliance
Oracle virtual appliance
 
Sergey Dzyuban "To Build My Own Cloud with Blackjack…"
Sergey Dzyuban "To Build My Own Cloud with Blackjack…"Sergey Dzyuban "To Build My Own Cloud with Blackjack…"
Sergey Dzyuban "To Build My Own Cloud with Blackjack…"
 
To Build My Own Cloud with Blackjack…
To Build My Own Cloud with Blackjack…To Build My Own Cloud with Blackjack…
To Build My Own Cloud with Blackjack…
 
Patterns
Patterns Patterns
Patterns
 
Hybrid Cloud Tutorial Linkedin 2
Hybrid Cloud Tutorial Linkedin 2Hybrid Cloud Tutorial Linkedin 2
Hybrid Cloud Tutorial Linkedin 2
 
OpenStack Integration with OpenContrail and OpenDaylight
OpenStack Integration with OpenContrail and OpenDaylightOpenStack Integration with OpenContrail and OpenDaylight
OpenStack Integration with OpenContrail and OpenDaylight
 
NCS: NEtwork Control System Hands-on Labs
NCS:  NEtwork Control System Hands-on Labs NCS:  NEtwork Control System Hands-on Labs
NCS: NEtwork Control System Hands-on Labs
 
AAI-1304 Technical Deep-Dive into IBM WebSphere Liberty
AAI-1304 Technical Deep-Dive into IBM WebSphere LibertyAAI-1304 Technical Deep-Dive into IBM WebSphere Liberty
AAI-1304 Technical Deep-Dive into IBM WebSphere Liberty
 
OpenStack with OpenDaylight
OpenStack with OpenDaylightOpenStack with OpenDaylight
OpenStack with OpenDaylight
 
Automating hard things may 2015
Automating hard things   may 2015Automating hard things   may 2015
Automating hard things may 2015
 
Mikrotik® MPLS/VPN Lab Part 1
Mikrotik® MPLS/VPN Lab Part 1Mikrotik® MPLS/VPN Lab Part 1
Mikrotik® MPLS/VPN Lab Part 1
 
Juniper Network Automation for KrDAG
Juniper Network Automation for KrDAGJuniper Network Automation for KrDAG
Juniper Network Automation for KrDAG
 
Clustering
ClusteringClustering
Clustering
 
the NML project
the NML projectthe NML project
the NML project
 
EM12C High Availability without SLB and RAC
EM12C High Availability without SLB and RACEM12C High Availability without SLB and RAC
EM12C High Availability without SLB and RAC
 
DockerCon 16 General Session Day 1
DockerCon 16 General Session Day 1DockerCon 16 General Session Day 1
DockerCon 16 General Session Day 1
 

Recently uploaded

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide Deck
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 

Automating Yourself Out of Trouble

  • 1. Automate yourself out of trouble with Ansible How we use Ansible at Dell EMC Jose Delarosa / Sambhu Kalaga Dell EMC May 8th, 2019
  • 2. Who are we • Jose Delarosa - Software Engineer - Infrastructure solutions team • Sambhu Kalaga - Software Engineer - OpenStack solutions team
  • 3. Before we begin 1. Thank you for attending! 2. Please ask questions anytime 3. If time runs out, happy to talk to you afterwards
  • 4. Why are we here today? 1. These days, automation is a necessity, not a luxury. 2. Ansible is a great tool for automation! 3. Dell EMC is active in the Ansible community and we want to share with you some of the work we’ve done.
  • 5. Agenda 1. Brief overview of Ansible 2. How Dell EMC uses Ansible • Network switch configuration • OpenStack configuration • Out-of-band server management • OpenShift deployment 3. Conclusion
  • 7. Ansible in a nutshell 1. Agentless, no DB backend  Minimum footprint 2. Remote tasks are run in parallel  Fast & efficient 3. Only do things if needed  Idempotent 4. Easy to learn and use  Reduced learning curve
  • 8. Some use cases for automation OpenStack • Compute nodes • Storage nodes • Controller nodes Container Management • Stop & remove containers • Refresh container images • Deploy new containers  1-to-n management  Executes tasks in parallel IT Security Hardening • Firewall rules • Remove unused packages • Install security updates
  • 9. Ansible components Task: A Task is the smallest unit of work: “install a package” or “remove a user”. Play: A Play is composed of tasks: The Play “prepare database” is composed of two Tasks:  Task 1: Create database  Task 2: Give users access to database Playbook: A Playbook is a collection of plays: The playbook “Setup my application” has two Plays: 1) “prepare database” and 2) “prepare web server”. Playbook: Setup my web application Play 1: Setup database Task 1: Install mysql package Task 2: Create database customer_db Play 2: Setup web server Task 1: Install httpd package Task 2: Configure site for TLS
  • 10. Example Say you provision 100 servers every day and you run these commands in each server: The same commands can be placed in an Ansible playbook and executed in 100 servers. daily_tasks.yml $ ansible-playbook daily_tasks.yml
  • 11. Ansible module • An Ansible module is the code that implements all the commands specified in playbooks. • Modules can be written in any language, but most popular is Python. • If you are a system administrator, you will work mostly with playbooks. • If you are a developer, you will work mostly with modules.
  • 12. Ansible Template Sample VLAN template –Dell EMC OS10 NOS Template: A template is a file in Ansible which is used to dynamically create configurations using the values from a variable file.
  • 13. Ansible Roles • Role: Dell EMC Networking modules are packaged and distributed through Ansible-galaxy. These pre- packaged units are known as roles. Ansible roles have specific file structure and are easily shared with other users. Roles help separate configuration syntax from data. Sample file structure:
  • 14. Example: Network Switch Configuration
  • 15. Stack ID Stack ID Stack ID Stack ID Stack ID Dell EMC S5248 Network Switch with OS10 33 34 35 3631 3229 3027 2825 26 45 46 47 4843 4441 4239 4037 389 10 11 127 85 63 41 2 21 22 23 2419 2017 1815 1613 14 50 52 54 49 51 53 StackID 33 34 35 3631 3229 3027 2825 26 45 46 47 4843 4441 4239 4037 389 10 11 127 85 63 41 2 21 22 23 2419 2017 1815 1613 14 50 52 54 49 51 53 StackID 33 34 35 3631 3229 3027 2825 26 45 46 47 4843 4441 4239 4037 389 10 11 127 85 63 41 2 21 22 23 2419 2017 1815 1613 14 50 52 54 49 51 53 StackID 33 34 35 3631 3229 3027 2825 26 45 46 47 4843 4441 4239 4037 389 10 11 127 85 63 41 2 21 22 23 2419 2017 1815 1613 14 50 52 54 49 51 53 StackID 33 34 35 3631 3229 3027 2825 26 45 46 47 4843 4441 4239 4037 389 10 11 127 85 63 41 2 21 22 23 2419 2017 1815 1613 14 50 52 54 49 51 53 StackID Dell EMC S4048 Network Switch with OS9 Dell EMC N4000 Network Switches with OS6 YAML INVENTORY / DATABASE Configuration Modules and Templates Ansible Create device configurations Deploy configurations via SSH Ansible concept ACTLNK 1 2ACT LNK ACT LNK 2 864 1 753 10 161412 9 151311 18 242220 17 232119 26 323028 25 312927 34 403836 33 393735 42 484644 41 474543 ACTLNK 1 2ACT LNK ACT LNK 2 864 1 753 10 161412 9 151311 18 242220 17 232119 26 323028 25 312927 34 403836 33 393735 42 484644 41 474543 ACTLNK 1 2ACT LNK ACT LNK 2 864 1 753 10 161412 9 151311 18 242220 17 232119 26 323028 25 312927 34 403836 33 393735 42 484644 41 474543 ACTLNK 1 2ACT LNK ACT LNK 2 864 1 753 10 161412 9 151311 18 242220 17 232119 26 323028 25 312927 34 403836 33 393735 42 484644 41 474543 ACTLNK 1 2ACT LNK ACT LNK 2 864 1 753 10 161412 9 151311 18 242220 17 232119 26 323028 25 312927 34 403836 33 393735 42 484644 41 474543 Dell EMC R740XD Rack Server
  • 16. Dell EMC Networking Roles • Dell EMC Ansible Network Roles: • Dellos-acl • Dellos-bgp • Dellos-dcb • Dellos-interface • Dellos-lag • Dellos-system • Dellos-vlan • Dellos-vlt • Dellos-vrf • Dellos-xstp • Dellos-ecmp • Dellos-prefixlist Sample file structure:
  • 17. Install Dell EMC Ansible Network Roles • Enable Ansible repository: • Install Ansible: • Install Dell Networking Ansible Roles:
  • 18. Example Leaf-Spine switch deployment 33 34 35 3631 3229 3027 2825 26 45 46 47 4843 4441 4239 4037 389 10 11 127 85 63 41 2 21 22 23 2419 2017 1815 1613 14 50 52 54 49 51 53 StackID 2 864 1 753 10 161412 9 151311 18 242220 17 232119 ACTLNK 2 864 1 753 10 161412 9 151311 18 242220 17 232119 ACTLNK VLT Spine Leaf1 Leaf2 Sample playbook Inventory file xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx
  • 20. Dell EMC Ansible resources • Dell EMC Ansible Galaxy documentation • Dell EMC Network ansible examples • Dell EMC Networking guides • Dell EMC Fabric center
  • 21. Example: Red Hat OpenStack configuration
  • 22. Dell EMC RedHat Open Stack • JetPack is available here
  • 23. Dell EMC RedHat Open Stack Open Stack Use cases include: • Projects • Networks • Users • Security groups • Flavors • Instances • and many more!!
  • 25. Open Stack User Configs
  • 31. Out-of-Band management 1. Server management independent of the operating system. 2. Provided by an embedded chip with its own Ethernet port. 3. Goes by many names: iDRAC, iLO, IMM, but commonly referred to as BMC (Baseboard Management Controller). 4. Capabilities include:  Component inventory  Hardware failure detection & alerting  Power management  BIOS configuration
  • 32. Communicating with the BMC 1. There are several legacy protocols that can be used: IPMI, WS-MAN, racadm, etc. but these are not secure, hard to use, proprietary and not very scalable. 2. Redfish addresses all these short-comings! It is the best method to communicate with the BMC:  Open source  RESTful interface  Secure  Scalable 3. A Redfish request is sent as an URI, so a client could be any application on a server, workstation or mobile device.
  • 33. Ansible modules for Redfish 1. Dell created and merged upstream 3 modules for Redfish. 2. Everything you need to manage your servers: • redfish_facts: status, hardware inventory, etc. • redfish_command: power management, user management, etc. • redfish_config: BIOS attributes, boot mode, etc. 3. Vendor-neutral, with ongoing contributions from developers at the DMTF, Dell, HP, Lenovo and others. 4. Use these modules to manage your heterogeneous server infrastructure from one Ansible controller.
  • 34. Server management made easy Management Network https://<BMC-IP>/redfish/v1/Systems/Systems.Embedded.1 { Health OK HealthRollup OK } 1 2
  • 35. Server management made really easy Management Network { Health OK HealthRollup OK } 1 2 Module: redfish_facts Category: Systems Command: GetSystemInventory Module: redfish_config Category: Systems Command: SetBiosAttributes Playbook Playbook
  • 37. Example: Get system health $ curl https://<BMC-IP>/redfish/v1/Systems/System.Embedded.1 --user root:password | jq .Status { "Health": "OK", "HealthRollUp": "OK" "State" : "Enabled" }
  • 38. Get system health with Ansible Playbook Results placed In JSON file
  • 39. Example: Get System Event Logs $ curl https://<BMC-IP>/redfish/v1/Managers/iDRAC.Embedded.1/Logs/Sel --user root:password | jq '.Members[] | {date: .Created, message: .Message, severity: .Severity}' --- snip --- { "date": "2017-09-26T13:33:00-05:00", "message": "Power supply redundancy is lost.", "severity": "Critical" } { "date": "2017-09-26T13:32:53-05:00", "message": "The power input for power supply 2 is lost.", "severity": "Critical" } { "date": "2017-09-16T10:37:59-05:00", "message": "Log cleared.", "severity": "Ok" }
  • 40. Get System Event Logs with Ansible Playbook Results placed In JSON file
  • 41. Example: Set boot mode to UEFI and reboot Change boot mode to UEFI $ curl https://<BMC-IP>/redfish/v1/Systems/System.Embedded.1/Bios/Settings --request PATCH --header "Content-Type: application/json" --data '{"Attributes":{"BootMode":"Uefi"}}' --user root:password Reboot $ curl https://<BMC-IP>/redfish/v1/Systems/System.Embedded.1/Actions/ComputerSystem.Reset --request POST --header "Content-Type: application/json" --data '{"ResetType":"GracefulRestart"}' --user root:password
  • 42. Set boot mode to UEFI and reboot with Ansible Playbook Full set of playbooks at https://github.com/dell/redfish-ansible-module
  • 44. Reference Architecture for OpenShift 1. Deployment was 95% automated with Ansible 2. Used Ansible to automate:  Switch configuration (VLT, VLANs, LACP)  Server BIOS configuration  OS Provisioning via iPXE  OpenShift deployment: master, infrastructure, application & storage nodes  GlusterFS pool
  • 46. Reference Architecture for OpenShift 1. Download OpenShift RA here. 2. Roles and playbooks available here. 3. Future Reference Architectures between Dell and Red Hat will continue to leverage Ansible.
  • 48. Conclusion 1. These are just a few examples of how we use Ansible. 2. Code contributions are welcome! 3. Want feedback on what you’d like to see automated

Editor's Notes

  1. IMM = Integrated Management Module
  2. Redfish is an open standard specification published by the DMTF DMTF: Distributed Management Task Force: Consortium of dozens of hardware providers
  3. Can use different HTTP methods: GET (default), POST, PATCH, DELETE
  4. Setting up bastion node not automated OOB network not automated