Module Title: dgt_sys04 – Scripting and automation
Overview:
“dgt_sys04 – Scripting and automation” is a module for IT professionals who automate Linux system administration tasks. It covers Bash scripting for basic automation needs and introduces Ansible as a tool for more structured, idempotent operations. You will learn how both work in depth; in practice, you will obtain scripts and playbooks by instructing the machine in natural language, and your job will be to review, test, and correct them.
Module Objectives:
– Understand the fundamentals of shell scripting with Bash.
– Describe routine tasks on Linux systems clearly enough for the machine to automate them with simple scripts, and verify those scripts.
– Explore advanced automation techniques with Ansible for scalable, repeatable system administration.
– Compare the use cases, strengths, and limitations of Bash scripting versus Ansible, and decide which one to ask for.
– Specify, review, and validate structured, idempotent Ansible playbooks that manage configurations across multiple environments efficiently.
Key Topics:
- Introduction to Automation:
- Overview of automation in Linux system administration.
-
The importance of idempotency in scripts and configurations.
-
Bash Scripting for Basic Automation:
- Basics of Bash scripting, including syntax, control structures, and functions.
- Asking the machine for simple scripts for file manipulation, user management, and process handling, and reading what it produces line by line.
-
Testing generated Bash scripts and guiding the machine through debugging.
-
Advanced Scripting Techniques in Bash:
- Error handling and logging in Bash scripts.
-
Using Bash for batch processing and data extraction.
-
Introduction to Ansible:
- Overview of Ansible architecture and its role in automation.
-
Having the machine install and configure Ansible, and checking the inventory and configuration it sets up.
-
Idempotent Operations with Ansible:
- Understanding idempotency and why it is crucial for reliable automation.
-
Reviewing the playbooks the machine writes to ensure consistent configurations across systems, and confirming idempotency with a second run that reports no changes.
-
Comparing Bash and Ansible:
-
Differences in operation between scripting with Bash and using Ansible.
- Bash Scripting: Suited to quick, system-specific tasks; limited scalability and manual execution required.
- Ansible: Designed for managing multiple systems at scale; its declarative approach ensures idempotency without requiring agent software.
-
Natural-Language Projects:
- Instruct the machine to automate common administrative tasks on a single Linux server with Bash, then audit the scripts for safety and correctness.
-
Direct the machine to create Ansible playbooks that manage configurations and automate deployments across several servers, and verify the result on every host.
-
Best Practices and Security Considerations:
- Best practices in scripting and playbook development, and how to demand them in your instructions.
- Ensuring security and compliance in automated processes.
Target Audience:
This module is intended for system administrators, DevOps engineers, IT professionals, and anyone interested in automating Linux systems with Bash and Ansible. Prior experience with Linux command-line tools is recommended but not required.
Module Duration: 6 weeks (2-3 hours per week)
The students can push their exercises to the Academy DevOps & SRE Git project. For this module, create a folder with your username as its name in the following subfolder: https://github.com/Garanti-Del-Talento/gdt_academy
