stancel.git_download_wordpress

git_download_wordpress

======================

Ansible role to download and install a specific version of WordPress.

Requirements

Make sure you have MySQL, MariaDB, or Percona Server and a web server (Apache or Nginx) set up. This guide assumes you are using a Debian-based Linux system (like Ubuntu) with a web server document root at /var/www/html for WordPress installation. You can change these settings if needed.

Role Variables

  • Installation Type: Specify if it's a "new", "upgrade", or "restore" installation. "new" and "upgrade" will install files from Git, while "restore" will not use Git and expects files to be restored later.
git_download_wordpress_installation_type: "new"
  • Environment Type: Indicate if this is for "dev", "qa", or "prod". Only "prod" will deploy cron jobs.
git_download_wordpress_environment_type: "prod"
  • Release Version: Choose the Git tagged release of WordPress. If using a Git branch, comment this out.
git_download_wordpress_tagged_release_version: "5.9.2"
  • Database User: Name of the database user for the application.
git_download_wordpress_db_user: "wordpressDbUser"
  • Database Password: Password for the database user.
git_download_wordpress_db_password: "some-really-secure-password"
  • MySQL Root Password: Root password for your database instance to create the database and user.
git_download_wordpress_mysql_root_password: "your MySQL root password"
  • Use Bedrock: Set to true if you want to use Bedrock WordPress, otherwise it's false.
git_download_wordpress_use_bedrock: false
  • Website URL: Website URL, used only if using WP Bedrock.
git_download_wordpress_wp_home: "https://mywebsite.com"
  • Shared Server: Specify if the installation is on a shared server. Default is false.
git_download_wordpress_using_shared_server: false
  • PHP Version: Version of PHP to use (default is 8.1).
git_download_wordpress_php_version: 8.1
  • Custom Bedrock Repo: If you're using a different Bedrock repository, specify it here; otherwise, leave it empty.
git_download_wordpress_custom_bedrock_git_repo: ""
  • Custom Standard WP Repo: If using a different repository for Standard WordPress, specify it here; otherwise, leave it empty.
git_download_wordpress_custom_standard_wp_git_repo: ""
  • Standard WP Repo: Default repository for Standard WP.
git_download_standard_wordpress_git_repo: "[email protected]:WordPress/WordPress.git"
  • Bedrock WP Repo: Default repository for Bedrock WordPress.
git_download_wordpress_standard_bedrock_git_repo: "[email protected]:roots/bedrock.git"
  • Git Branch: If using a branch from your own fork instead of a tagged release, fill this in and comment out the tagged release variable. Default is empty.
git_download_wordpress_git_branch: ""
  • Database Name: Name of the database to create (default is "wordpress").
git_download_wordpress_db_name: "wordpress"
  • Database Encoding: The default character set for the database (default is "utf8mb4").
git_download_wordpress_db_encoding: "utf8mb4"
  • Database Collation: The default collation for the database (default is "utf8mb4_unicode_ci").
git_download_wordpress_db_collation: "utf8mb4_unicode_ci"
  • Database Host: The address for the application database (default is 'localhost').
git_download_wordpress_db_host: "localhost"
  • Disable Updates: Set to true to stop automatic updates in WordPress (default is false).
git_download_wordpress_auto_update_disable: false
  • Core Update Level: Define the level of updates:
    • true: All updates enabled
    • false: All updates disabled
    • minor: Minor updates enabled, others disabled
git_download_wordpress_core_update_level: 'minor'
  • Web Files Path: The root directory for the web server where files will be stored.
git_download_wordpress_web_files_path: "/var/www"
git_download_wordpress_web_directory_for_application: "/html"
  • Web User: Linux username for your web server (default is "www-data").
git_download_wordpress_web_user: "www-data"
  • Web Group: Linux group for your web server (default is "www-data").
git_download_wordpress_web_group: "www-data"
  • Manage Packages: Enable or disable package management with apt (default is true).
git_download_wordpress_manage_packages: true
  • PHP.ini Configurations: Flags to control PHP settings (default is true).
git_download_wordpress_configure_mysqli_allow_local_infile: true
git_download_wordpress_configure_memory_limit: true
git_download_wordpress_configure_post_max_size: true
git_download_wordpress_configure_upload_max_filesize: true
git_download_wordpress_configure_max_input_time: true
git_download_wordpress_configure_max_execution_time: true
git_download_wordpress_configure_php_timezone: true
  • Install Composer: Set to true to install Composer (default is true).
git_download_wordpress_install_composer: true

Dependencies

This role works best with Nginx as the web server. Use stancel.nginx_install for installing Nginx before running this role. If using Bedrock WP, install the WP CLI program first with sbaerlocher.wp-cli.

Example Playbook

Copy and modify defaults/main.yml to create your vars/main.yml.

- hosts: your_webserver
  vars_files:
    - vars/main.yml
  roles:
    - stancel.git_download_wordpress

Or specify variables directly in your playbook.

- hosts: your_webserver 
  vars:
    git_download_wordpress_tagged_release_version: "5.3.2"
    git_download_wordpress_db_user: "wordpressDbUser"
    git_download_wordpress_db_password: "some-really-secure-password"
    git_download_wordpress_mysql_root_password: "your-MySQL-root-password"
  roles:
    - stancel.git_download_wordpress

License

GPLv3

Author Information

Brad Stancel

Informazioni sul progetto

Downloads and installs a chosen release of WordPress or Bedrock WP to a specified path. Also installs PHP 8.1, Composer, updates PHP config options for NginX and sets up needed templates.

Installa
ansible-galaxy install stancel.git_download_wordpress
Licenza
Unknown
Download
79
Proprietario