← Back to all products

Ansible Playbook Collection

$39

Server provisioning and configuration playbooks for web servers, databases, monitoring, and security hardening.

📁 16 files🏷 v1.0.0
ConfigYAMLJSONMarkdownDockerAnsiblePostgreSQLNginxGrafanaPrometheus

📁 File Structure 16 files

ansible-playbook-collection/ ├── LICENSE ├── README.md ├── ansible.cfg ├── group_vars/ │ └── all.yml ├── guides/ │ └── ansible-best-practices.md ├── inventory/ │ └── hosts.yml ├── playbooks/ │ ├── docker-install.yml │ ├── monitoring-setup.yml │ ├── nginx-setup.yml │ ├── postgres-setup.yml │ ├── security-hardening.yml │ └── server-setup.yml └── roles/ └── common/ ├── defaults/ │ └── main.yml ├── handlers/ │ └── main.yml └── tasks/ └── main.yml

📖 Documentation Preview README excerpt

Ansible Playbook Collection

Production-ready playbooks for server provisioning, Docker, Nginx, PostgreSQL, monitoring, and security hardening.

Drop-in playbooks for Ubuntu 22.04+ servers. Each playbook is self-contained with inline comments, uses fully qualified collection names (FQCN), and follows Ansible best practices for idempotency and security.

What You Get

  • 6 production playbooks covering the full server lifecycle from bare metal to hardened production
  • 1 reusable role (common) with shared tasks, defaults, and handlers
  • Multi-environment inventory with production and staging groups
  • Centralized variables in group_vars with sensible defaults
  • Comprehensive guide on Ansible best practices (1500+ words)

File Tree


ansible-playbook-collection/
├── ansible.cfg                          # Project configuration
├── inventory/
│   └── hosts.yml                        # Multi-environment inventory
├── group_vars/
│   └── all.yml                          # Shared variables for all hosts
├── playbooks/
│   ├── server-setup.yml                 # Base provisioning + common role
│   ├── docker-install.yml               # Docker CE + Compose V2
│   ├── nginx-setup.yml                  # Nginx reverse proxy + TLS
│   ├── postgres-setup.yml               # PostgreSQL 16 + tuning + backups
│   ├── monitoring-setup.yml             # Node Exporter + Promtail
│   └── security-hardening.yml           # SSH + Fail2Ban + auto-upgrades
├── roles/
│   └── common/
│       ├── tasks/main.yml               # Base packages, deploy user, UFW
│       ├── defaults/main.yml            # Default variables
│       └── handlers/main.yml            # Service restart handlers
├── guides/
│   └── ansible-best-practices.md        # Best practices guide
├── README.md
├── LICENSE
└── manifest.json

Getting Started

1. Install Ansible


# Ubuntu/Debian
sudo apt update && sudo apt install -y ansible

# macOS
brew install ansible

# pip (any platform)
pip install ansible

2. Configure your inventory

Edit inventory/hosts.yml with your server IPs:

... continues with setup instructions, usage examples, and more.

📄 Code Sample .yml preview

group_vars/all.yml # Group Variables — Applied to all hosts # These defaults can be overridden per-environment or per-host. # See inventory/hosts.yml for the host/group structure. # ─── General ──────────────────────────────────────────── timezone: "UTC" locale: "en_US.UTF-8" # Deploy user — all applications run as this user deploy_user: deploy deploy_group: deploy deploy_home: /home/deploy # ─── SSH ──────────────────────────────────────────────── ssh_port: 22 ssh_allowed_users: - deploy - admin # ─── System Packages ─────────────────────────────────── # Packages installed on every server via the common role common_packages: - curl - wget - git - htop - iotop - tmux - vim - unzip - jq - net-tools - dnsutils - ca-certificates - gnupg - lsb-release - software-properties-common - apt-transport-https # ─── NTP ──────────────────────────────────────────────── ntp_servers: - 0.pool.ntp.org - 1.pool.ntp.org - 2.pool.ntp.org - 3.pool.ntp.org # ─── Firewall (UFW) ──────────────────────────────────── ufw_default_incoming: deny ufw_default_outgoing: allow ufw_allowed_ports: # ... 50 more lines ...