dgt_sys04 – Scripting and automation

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:

  1. Introduction to Automation:
  2. Overview of automation in Linux system administration.
  3. The importance of idempotency in scripts and configurations.

  4. Bash Scripting for Basic Automation:

  5. Basics of Bash scripting, including syntax, control structures, and functions.
  6. Asking the machine for simple scripts for file manipulation, user management, and process handling, and reading what it produces line by line.
  7. Testing generated Bash scripts and guiding the machine through debugging.

  8. Advanced Scripting Techniques in Bash:

  9. Error handling and logging in Bash scripts.
  10. Using Bash for batch processing and data extraction.

  11. Introduction to Ansible:

  12. Overview of Ansible architecture and its role in automation.
  13. Having the machine install and configure Ansible, and checking the inventory and configuration it sets up.

  14. Idempotent Operations with Ansible:

  15. Understanding idempotency and why it is crucial for reliable automation.
  16. Reviewing the playbooks the machine writes to ensure consistent configurations across systems, and confirming idempotency with a second run that reports no changes.

  17. Comparing Bash and Ansible:

  18. 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.
  19. Natural-Language Projects:

  20. Instruct the machine to automate common administrative tasks on a single Linux server with Bash, then audit the scripts for safety and correctness.
  21. Direct the machine to create Ansible playbooks that manage configurations and automate deployments across several servers, and verify the result on every host.

  22. Best Practices and Security Considerations:

  23. Best practices in scripting and playbook development, and how to demand them in your instructions.
  24. 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