Automated WordPress Deployment with Ansible Roles

Summary

This project leverages Ansible to deploy and configure WordPress in a modular and reproducible way, eliminating manual steps and ensuring consistency across environments.

Context

Traditional WordPress installation involves:

    • Setting up the server and packages one by one.

    • Manually configuring Apache, PHP, and the database.

    • Risk of human error and environment drift.

Challenge

    • Design clear, reusable Ansible roles.

    • Automate the installation of Apache, PHP, MariaDB, and WordPress.

    • Enable environment-specific variables and secure credential management.

Solution

    1. Ansible Roles:
        • apache: installs and configures the web server.

        • php: adds required extensions.

        • mariadb: sets up the user, database, and hardening.

        • wordpress: downloads, configures, and sets permissions.

    1. Main Playbook (site.yml): orchestrates role execution.

    1. Variables: defined in group_vars for environment parameterization.

    1. Security: uses Ansible Vault for sensitive credentials.

Technologies

    • Ansible ≥ 2.9

    • Modular roles

    • Ubuntu 22.04

    • Ansible Vault

Results

    • Full deployment in minutes.

    • Identical environments for development, testing, and production.

    • Reduced error rates and configuration time.

Evidence

Scroll al inicio