AI Skill Report Card

Provisioning Infrastructure Ansible

B+75·Jan 16, 2026
YAML
--- name: provisioning-infrastructure-ansible description: Provisions and configures infrastructure using Ansible playbooks and automation. Use when setting up servers, configuring services, or automating CLI/API operations. --- # Infrastructure Provisioning with Ansible
YAML
# site.yml - Basic server setup --- - hosts: webservers become: yes tasks: - name: Install nginx package: name: nginx state: present - name: Start and enable nginx systemd: name: nginx state: started enabled: yes - name: Configure firewall ufw: rule: allow port: '80'

Run: ansible-playbook -i inventory site.yml

Recommendation
Add more concrete input/output examples showing before/after server states or actual command executions with their results
  1. Inventory Setup - Define target hosts and groups
  2. Playbook Structure - Create role-based organization
  3. Variable Management - Set environment-specific configs
  4. Task Implementation - Write idempotent tasks
  5. Testing - Run with --check and --diff
  6. Deployment - Execute against target environments

Progress checklist for complex deployments:

  • Inventory configured with proper groups
  • Variables defined per environment
  • Playbooks tested with --check
  • Backup/rollback plan in place
  • Monitoring configured for new services
Recommendation
Include a complete inventory file example in Quick Start to make it immediately runnable

Example 1: Docker Container Deployment Input: Deploy application stack with database

YAML
- name: Deploy app stack hosts: docker_hosts tasks: - name: Create app network docker_network: name: app_network - name: Deploy database docker_container: name: postgres image: postgres:13 networks: - name: app_network env: POSTGRES_DB: "{{ app_db_name }}"

Example 2: API Automation Input: Configure cloud resources via API

YAML
- name: Provision AWS resources hosts: localhost tasks: - name: Create security group ec2_group: name: web-sg description: Web server security group rules: - proto: tcp ports: - 80 - 443 cidr_ip: 0.0.0.0/0
Recommendation
Expand the Testing section with specific commands and expected outputs for validation workflows
  • Use roles for reusable components: roles/nginx/tasks/main.yml
  • Encrypt secrets with ansible-vault: ansible-vault encrypt group_vars/production/secrets.yml
  • Tag tasks for selective runs: tags: [config, deploy]
  • Set fact caching for performance: fact_caching = memory
  • Use handlers for service restarts: notify: restart nginx
  • Template configurations with Jinja2: template: src=nginx.conf.j2 dest=/etc/nginx/nginx.conf
  • Don't hardcode values - Use variables and templates instead
  • Avoid shell/command modules when native modules exist
  • Don't skip idempotency - Tasks should be safe to run multiple times
  • Don't ignore changed_when - Set appropriate conditions for task reporting
  • Avoid running as root unnecessarily - Use become only when needed
  • Don't mix environments - Keep staging/production inventories separate
0
Grade B+AI Skill Framework
Scorecard
Criteria Breakdown
Quick Start
11/15
Workflow
11/15
Examples
15/20
Completeness
15/20
Format
11/15
Conciseness
11/15