Ansible script to install and configure wordpress in a simple way. Stack: CentOS8, nginx including lets-ecnrypt certs and mariadb. Define a plugin list and a theme to install them automatically. Including SMTP support.
- Clone this repository
git clone URL
- Edit hosts.yml (domain, lets-encrypt mail, theme and plugins) Template (group_vars/all/vars.yml)
production:
hosts:
HOST1:
site_domain: "{{ inventory_hostname }}"
letsencrypt_email: mail@example.com
wordpress_theme:
- name: THEMENAME # e.g. 'oceanwp'
version: THEMEVERSION # e.g. '1.8.9'
child_theme_file: CHILD_THEME_FILE # if provided in ./roles/wordpress/files
wordpress_plugins:
# use plugin name from wordpress route
# e.g. https://wordpress.org/plugins/LOOK-HERE-FOR-PLUGIN-NAME/
- name: WP_PLUGIN_NAME_A
- name: WP_PLUGIN_NAME_B
- name: WP_PLUGIN_NAME_C
- Generate secrets (db_password_user, db_password_db and if necessary smtp config) and save them to vault.yml
pwgen -n1 64
Template (group_vars/all/vault.yml)
hosts_vault:
HOST1:
db_password: DB_PASSWORD # use strong generated password
db_password_root: DB_PASSWORD_ROOT # use strong generated password
wordpress_mail: # if defined, the mail config will be set in wp-config.php
smtp_user: SMTP_USER # smtp login
smtp_pass: SMTP_PASS
smtp_host: SMTP_HOST # smtp server/host (e.g. mail.example.com)
smtp_from: SMTP_FROMT # email is send from MAIL (e.g. contact@example.com)
smtp_name: SMTP_NAME # email is send from NAME (e.g. 'My example contact')
smtp_port: SMTP_PORT
smtp_secure: tls
smtp_auth: true
smtp_debug: 0 # choos 1 for debug mode
- Generate vault password for vault.yml and encrypt the vault.yml file
ansible-vault encrypt FILE
- Deploy via ansible
ansible-playbook wordpress.yml
💻 virtUOS (University Osnabrück)
- www: virtuos.uni-osnabrueck.de
- Github: @virtUOS
👤 Florian Feyen
- Github: @ffeyen
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Give a ⭐️ if this project helped you!
This README was generated with ❤️ by readme-md-generator