Ansible role that installs and configures WordPress with Nginx or Apache2.
Features include:
- Installation of any WordPress version to specified directory
- Configuration of
wp-config.php
- Fetch random salts for wp-config.php (https://api.wordpress.org/secret-key/1.1/salt/)
Using ansible-galaxy
:
$ ansible-galaxy install makarenalabs.wordpress
Using arm
(Ansible Role Manager):
$ arm install makarenalabs.wordpress
Using git
:
$ git clone https://github.com/MakarenaLabs/ansible-role-wordpress.git
- Ansible 1.4 or higher
- Curl
Here is a list of all the default variables for this role, which are also available in defaults/main.yml
.
wp_version: 5.0.3
wp_install_dir: '/var/www/html'
wp_db_name: "{{ wp_mysql_db }}"
wp_db_user: "{{ wp_mysql_user }}"
wp_db_password: "{{ wp_mysql_password }}"
wp_db_host: 'localhost'
wp_db_charset: 'utf8'
wp_db_collate: ''
wp_table_prefix: 'wp_'
wp_debug: false
wp_admin_email: '[email protected]'
wp_webserver: nginx
site_name: "{{ wp_sitename }}"
wp_mysql_db
wp_mysql_user
wp_mysql_password
wp_sitename
These variables are required!
Default webserver selected is nginx
. If you want to use apache2
you have to set wp_webserver
variable as follow:
wp_webserver: apache
---
- hosts: all
vars:
wp_version: 5.0.3
wp_mysql_db: 'database_name_here'
wp_mysql_user: 'username_here'
wp_mysql_password: 'password_here'
wp_webserver: nginx
wp_sitename: example.com
wp_admin_email: '[email protected]'
wp_install_dir: "/var/www/{{ wp_sitename }}"
roles:
- makarenalabs.wordpress
$ git clone https://github.com/MakarenaLabs/ansible-role-wordpress.git
$ cd ansible-role-wordpress
$ vagrant up
Licensed under the MIT License. See the LICENSE file for details.
Copyright © 2019 MakarenaLabs