This project provides a flexible and modular Ansible playbook collection for efficiently deploying and managing web server stacks. It's designed to automate the setup of various web server configurations, integrate with PHP-FPM, and handle SSL certificate provisioning using Let's Encrypt.
- Flexible Web Server Choices: Deploy with Nginx, Apache, or a combined Nginx+Apache setup (where Nginx acts as a reverse proxy).
- PHP-FPM Integration: Seamlessly configures PHP-FPM for dynamic web application serving.
- Automated SSL Certificates: Provisions and automatically renews SSL certificates from Let's Encrypt using Certbot.
- Modular & Reusable Roles: Organized into dedicated Ansible roles for
nginx,apache,php-fpm, and commonwebserverutilities, promoting maintainability. - Environment Management: Easily configure and manage different deployment environments (e.g.,
staging,production) via structured inventory files.
-
Clone the Repository
-
Configure Your Inventory: Edit the inventory files in the
inventory/directory (e.g.,staging.yaml,host_vars/that_server.yaml,group_vars/webservers.yaml) to define your target servers, domain names, preferredweb_servertype, and other variables. -
Run the Playbook:
Execute the main playbook, specifying your inventory file:
ansible-playbook -i inventory/staging.yaml playbooks/site.yaml --ask-become-pass
(The
--ask-become-passflag will prompt for the sudo password on your target server.)