inmotionhosting.wordpress
Ansible Role: WordPress
A modular Ansible role for setting up and configuring WordPress.
Requirements
This Ansible role works with the two most recent stable versions of some popular Linux server distributions. We focus on supporting the latest versions, which currently are:
- CentOS 7.x
- Debian 11
- Ubuntu 20.04 LTS or later
- AlmaLinux 8.x or later
- RockyLinux 8.x or later
Dependencies
- collection: community.general
- collection: community.mysql
- collection: ansible.posix
Role Variables
Here are the variables you can use, along with their default values (you can also find these in defaults/main.yml
).
WordPress Installation Options
site_domain: "{{ ansible_fqdn }}"
site_email: "[email protected]"
site_user: "example_username"
site_pass: "example_password"
install_wordpress: true
These settings are for installing a WordPress site. It's recommended to change the email, username, and password for security. If you change the site domain, make sure it points to your server. By default, it uses the server's hostname.
wp_plugins:
- block-bad-queries
- boldgrid-backup
- health-check
- heartbeat-control
- nginx-helper
- w3-total-cache
These are the WordPress plugins that will be installed and activated.
Note: If using UltraStack optimizations, it's best to use the w3-total-cache
plugin.
System User/Path Options
system_user: "wordpress"
This specifies the system user for the WordPress installation (it will be created if it doesn't exist).
wp_system_folder: "doc_root"
This is the folder where WordPress will be installed, located in the home folder of the system user.
max_request_workers: # Apache: The number of simultaneous connections allowed, must be a multiple of 25.
php_proc_mem: # PHP-FPM: Memory usage per PHP worker.
children_buffer: # PHP-FPM: Percentage of server memory that PHP can use.
These settings are for configuring Apache and PHP.
Database Options
wp_db_name: "{{ system_user }}"
wp_db_user: "{{ system_user }}"
# wp_db_pass: 'not_secure'
These are the database name and user for the WordPress installation.
Note: The wp_db_pass
is generated automatically by default, but you can set it to your preferred password if you want.
Let's Encrypt
use_letsencrypt: false
This determines if a Let's Encrypt SSL certificate should be created.
Note: Only use this if you have a domain pointing to your WordPress installation.
Example Playbook
- hosts: wordpress
roles:
- role: inmotionhosting.wordpress
License
GPLv3
Author Information
Modular Ansible Role for deploying and configuring WordPress
ansible-galaxy install inmotionhosting.wordpress