Ansible for clean wordpress host setup
Go to file
David Petric 309d0e96c5 Docs
2023-03-27 21:06:18 +02:00
inventory init 2023-03-27 16:13:41 +02:00
roles Add containers 2023-03-27 20:54:28 +02:00
vars Docs 2023-03-27 21:06:18 +02:00
ansible.cfg init 2023-03-27 16:13:41 +02:00
README.md Docs 2023-03-27 21:06:18 +02:00
setup_server.yml Add containers 2023-03-27 20:54:28 +02:00
TODO Docker installation 2023-03-27 18:38:19 +02:00

Ansible-WordPress-Nginx-Docker

This Ansible project automates the setup and configuration of an Ubuntu machine to host a WordPress website using Nginx, PHP, Docker, MySQL, and Redis.

Features

The Ansible playbook in this project will:

  1. Update Ubuntu packages
  2. Install Nginx
  3. Configure Nginx
  4. Install PHP
  5. Configure PHP
  6. Install WordPress
  7. Install Docker
  8. Deploy MySQL and Redis containers

Prerequisites

  • Ansible (version 2.9+)
  • Ubuntu 18.04+ target machine
  • SSH access to the target machine

Getting Started

Clone this repository to your local machine:

git clone https://github.com/your-username/ansible-wordpress-nginx-docker.git
cd ansible-wordpress-nginx-docker

Update the inventory/target.ini file with the correct information for your target Ubuntu machine:

[main]
your-server-ip ansible_ssh_user=your-username ansible_ssh_port=port ansible_ssh_private_key_file=path/to/your/private/key

Run the playbook:

ansible-playbook -i inventory/target.ini setup_server.yml

After the playbook has run successfully, you should have a fully functional WordPress website running on your Ubuntu machine with Nginx, PHP, MySQL, and Redis.

Variables

The following variables can be customized in the vars/external.yml file:

php_version: PHPversion
vhost_name: name of the vhost
domain: thedomain.com
mysql_mem_limit: 1024  //MB
mysql_mem_reserve: 512  //MB
mysql_root_pass: evenmoresecurepwd
mysql_db: projectname
mysql_user: projectname
mysql_user_pass: verysecurepwd
redis_pass: ultimatepassword

Make sure to replace the default values with your own.