Chapter 1
System Management
Course: Comptia Linux Xk0 006
Subject: Comptia Linux Xk0 006
Chapter: Scripting Orchestration And Automation
1. File Formats
Infrastructure as Code (IaC) tools rely on structured text-based file formats to define, automate, and version control system configurations and cloud infrastructure. Two of the most widely used formats are YAML and JSON. Each serves different purposes depending on the tool, environment, and user preference.
1. YAML Ain’t Markup Language (YAML)
YAML is a concise and human-friendly format ideal for configuration files and scripting inputs. It is used heavily in tools such as Ansible, Kubernetes, GitHub Actions, and Docker Compose.
Example (Ansible playbook):
yaml
- name: Install Apache on web servers hosts: web tasks: - name: Install Apache apt: name: apache2 state: present
Characteristics:
- Uses indentation to define structure instead of brackets or braces.
- Supports complex nested data structures (lists, maps).
- Comments are allowed using #, making files easier to document.
- Does not require quotation marks unless needed for special characters or spacing.