No Description

Edin Sarajlic 904e90724b README: unroll hard-break new lines. This allows the reader to reflow text per their wishes 1 month ago
defaults f2bbcb3589 Allow specifying via variable whether to install automysqlbackup 1 month ago
tasks 1893eb395b Refactor: rename files for readability, replacing _ with - 1 month ago
templates 0eab60c49d Refactor: add spaces between variable delimiter and variable name 1 month ago
README 904e90724b README: unroll hard-break new lines. This allows the reader to reflow text per their wishes 1 month ago

README

An Ansible role for installing and configuring a MySQL (MariaDB) server.

This role can most likely be used on any Debian-derived distro.

Clone this git repo into your Ansible's role directory, e.g.:

git clone ansible-mysqlserver.git roles/mysqlserver

This role performs the following actions:
- Installs the MySQL (MariaDB) server software
- Installs 'automysqlbackup' (default config performs nightly backups of all DBs)
- Installs 'python-mysqldb' (allows Ansible to perform tasks on the MySQL server, such as creating databases)

Variables to define to use this role:
- mysqlserver_root_password : MySQL root user's clear-text password (will be set)

See defaults/main.yml for the list of variables that can be defined

Variables to define for tasks/configure-autologin-mycnf.yml:
- mysqlcli_user : The OS-user for which to configure my.cnf
- mysqlserver_mycnf_user : The DB-user for auto-login
- mysqlserver_mycnf_password : The DB-user's clear-text password for auto-login

--
NOTE: The below task is provided for convenience, use with discretion.

This role provides an optional task (setup-app-db.yml) that can be used to bootstrap a database, user, and privileges - as required by *most* types of webapps.

Variables to define:
- db_name : The name of the database to create
- db_username : The username of the user to create for the above database instance
- db_password : The clear-text password of the above user

To use the task, create a play for each database/user/privilege combo you require, e.g.:
- name: Database for ExampleCMS for MyWebsite
hosts: mywebsitehost

roles:
- mysqlserver

tasks:
- include: roles/mysqlserver/tasks/setup-app-db.yml

vars:
db_name: ecms_mywebsite
db_username: ecms_mywebsite_user
db_password: supersecretpassword