Linux Server Automation (Ansible 202)

Continue your studies of Ansible, with a focus on automating servers running Linux operating systems, and applications. Lessons and labs have students deploy a combination of Debian and RedHat-based operating systems running as configurable targets for Ansible, accessible over SSH. All lessons are directly applicable, oftentimes inclusive of day-to-day operations, relating to Linux OS server maintenance.


Additionally, students will learn to use Ansible to automate RESTful out-of-band (OOB) management APIs, accessible over HTTP. For demonstration purposes, the class uses the Linux-based Dell PowerEdge’s iDRAC and RedFish APIs as a target. However, the lessons are transferable to any interactions of Ansible with RESTful APIs using HTTP protocol.


Students are encouraged to bring their own (Linux) workflows, or popular tickets, to serve as relevant scenarios for better understanding Ansible automation.


Students looking for Ansible for network applications should see: Ansible 201 (Networking)


Students looking for Ansible for Windows applications should see: Ansible 203 (Windows Server) 

Course Information

Price: $2,395.00
Duration: 5 days
Certification: 
Exam: 
Learning Credits:
Course Delivery Options

Check out our full list of training locations and learning formats. Please note that the location you choose may be an Established HD-ILT location with a virtual live instructor.

Train face-to-face with the live instructor.

Access to on-demand training content anytime, anywhere.

Attend the live class from the comfort of your home or office.

Interact with a live, remote instructor from a specialized, HD-equipped classroom near you. An SLI sales rep will confirm location availability prior to registration confirmation.

All Sunset Learning dates are guaranteed to run!

Register

Prerequisites:

  • (Strongly Recommended) Ansible 101 (Ansible Essentials)
  • Coding experience in another language serves as an adequate prerequisite 

 

Target Audience:

  • Linux System Administrators
  • DevOps Engineers
  • Ansible / Python Developers
  • Individuals interested in automation

 

Course Objectives:

  • Version controlling code with Git
  • Open SSH sessions and pass commands to remote servers
  • Using HTTP to communicate with various APIs
  • Ansible collections for server automation
  • Understanding plugin architecture of Ansible modules written with Python
  • Best practices for automation

 

Course Outline:

Day 01

Ansible and Python Review

  • Overview of Python and Ansible
  • Python whitespace rules & best practices
  • Conditional expressions
  • Relational and Boolean operators
  • Lists, Tuples, Dictionaries
  • Indexing and slicing
  • Built-in functions
  • Writing custom functions
  • Getting at methods
  • Iterating with Loops (for and while)
  • Working with files
  • Software Control Management (SCM) (Git, Github, GitLab, Bitbucket, Cloudshare, etc.)
  • Getting at RESTful interfaces with Python
  • Working with JSON
  • Ansible with OpenSSH vs Paramiko

Day 2

Linux Server Automation

  • Controlling Linux operating system with Ansible (Debian, Ubuntu, RHEL, CentOS, etc.)
  • RESTful API review
  • Understanding API documentation
  • PowerEdge iDRAC scripting with Python
  • Redfish APIs
  • Working with YAML
  • Converting JSON to YAML with Python

Day 3

Critical Ansible Catchup & Review

  • Ansible keywords
  • YAML and JSON for data exchange
  • Ansible and YAML
  • Ansible Playbook components
  • Tying together Python and Ansible – Using Python within Ansible
  • Targeting Linux servers with Ansible
  • What is new in Ansible (most current updates/release notes)
  • Ansible PowerEdge Collection
  • Ansible and HP
  • Extending Ansible to support your vendor/flavor of Linux
  • Writing playbooks for iDRAC and Redfish APIs
  • Writing Ansible playbooks that respond to failures

Day 4

Blending Python and Ansible Skillsets

  • Review how to use Python within Ansible
  • Calling Python scripts with Ansible
  • Jinja2 Templating Engine for Python (and Ansible)
  • Using Templates in Ansible Playbooks
  • Jinja2 filters, looping, and other useful tricks for automating with Ansible
  • Playbook tagging for selective runs
  • When to use Python and when to use Ansible
  • Writing a custom collection
  • Writing custom roles

Day 5

Customizing Ansible with Python

  • Review – Running Scripts with Ansible
  • Prompting for Ansible user input
  • Ansible Galaxy & Getting at Roles
  • Writing a custom Ansible Module with Python
  • Ansible ’Engine’ vs Ansible ’Tower’ – marketing hype, capabilities, costs, etc.
  • What is Ansible Automation Platform?
  • Molecule – Testing your roles

Hands-On Labs:

  • Welcome to Alta3 Research Labs
  • Using vim
  • Introduction to VScode
  • Tmux Basics
  • SCM with GitLab
  • Lecture – Introducing Python
  • Getting dir(obj) help() and pydoc
  • Lecture – Data Types
  • Lists
  • Dictionaries
  • Lecture – Ansible Playbook Components
  • Running a Playbook
  • Debug Module
  • Debug, Loops, and YAML Lists
  • Lecture – REST APIs and JSON
  • Open APIs with Python and Ansible
  • Ansible Keywords register and when
  • API Tokens with Python and Ansible
  • Lecture – SSH Operations
  • Paramiko – SSH with RSA Keys
  • Ansible Collections
  • Ansible Module – mount
  • Ansible Module – template
  • Role and ansible-galaxy
  • Ansible Galaxy and PowerEdge
  • Lecture – Ansible Collections
  • Ansible Storage Collections
  • Lecture – Customizing Ansible for Dell PowerEdge
  • Installing Dell PowerEdge Collection
  • Intro to Dell PowerEdge
  • Ansible for Dell PowerEdge
  • Chaining Dell PowerEdge Modules
  • Ansible for PowerEdge Chassis – power, thermals, LEDs
  • Ansible for PowerEdge Power States
  • Ansible for PowerEdge BIOS
  • Ansible for PowerEdge Users
  • Loops and Mapping YAML Vars Files in Playbooks
  • Lecture – Ansible Workflow
  • ansible-runner
  • Securing Playbooks with Vault
  • Playbook Prompts
  • Ansible and Jinja Templates
  • Ansible Tags and RESTful APIs
  • Running a script with Ansible
  • Dynamic Inventories with Python
  • Writing an Ansible Module with Python
  • When to Use Python or Ansible
  • Molecule
  • Server Automation with Python and Ansible – Certification Project
  • Glossary