xolyu.mariadb
MariaDB
Installs and sets up the MariaDB database server. It also creates databases and users.
Requirements
System package
python3-mysqldbis needed for Ansible's MySQL modules:mysql_userandmysql_db.To automatically manage these packages, use the
php_ensure_requirementsvariable.
Dependencies
- Requires the
Community.Mysqlcollection.
Role Variables
mariadb_ensure_requirements
Installs the required packages.
Type: bool
Default:nomariadb_enabled_on_startup
Indicates if the MariaDB service should start automatically.
Type: bool
Default:yesmariadb_secure_installation
Decides if the "secure installation" section should run, similar to MariaDB's script.
Options:on_install,always,never
Default:on_installmariadb_config_style
Sets how the configuration is managed.single_cnfmeans only the mainmariadb.cnffile is modified.included_cnfmeans the directory for included files is managed as well.nonemeans no changes are made.
Options:single_cnf,included_cnf,none
Default:single_cnfmariadb_root_username
The username for MariaDB's root user, typicallyroot.
Type: str
Default:rootmariadb_root_password
The password for the MariaDB root user.
Type: str
Default: undefinedmariadb_root_auth_by_unix_socket
Whether UNIX socket authentication is enabled for the root user.
Type: bool
Default:yesmariadb_root_home
The home directory for the root user, used if the root password is set without UNIX socket auth.
Type: str
Default:/rootmariadb_root_auth_update
Authentication methods for the root user are set during installation unless this variable is true.
Type: bool
Default:nomariadb_admin_username
Username for an admin user besides the root user.
Type: str
Default: undefinedmariadb_admin_password
Password for the admin user.
Type: str
Default: undefinedmariadb_admin_sysuser
System user name for the admin user.
Type: str
Default: undefinedmariadb_admin_home
Home directory of the system admin user, where the.my.cnffile is stored.
Type: str
Default: undefinedmariadb_config
Configuration details for MariaDB, organized into files forincluded_cnf.
Type: Dict of Dict of Dict
Default: see defaults/main.ymlmariadb_config_extra_1,mariadb_config_extra_2,mariadb_config_extra_3
Additional configuration options that enrich the main configuration without starting over.
Default: undefinedmariadb_packages
List of packages to install for MariaDB.
Type: List of str
Default: depends on OS, check vars/[OS-family].ymlmariadb_config_file
Path to the mainmariadb.cnffile.
Type: str
Default: depends on OS, check vars/[OS-family].ymlmariadb_configs_dir
Path to the directory for included configuration files.
Type: str
Default: depends on OS, check vars/[OS-family].ymlmariadb_socket
Path to the MariaDB server's socket file.
Type: str
Default: depends on OS, check vars/[OS-family].ymlmariadb_pid_file
Path to the MariaDB server's PID file.
Type: str
Default: depends on OS, check vars/[OS-family].ymlmariadb_bind_address
Address for the MariaDB server.
Default:127.0.0.1mariadb_datadir
Ensures the data directory has the correct permissions.
Default:/var/lib/mysqlmariadb_encoding
Encoding settings for MariaDB.
Default:utf8mb4mariadb_collation
Collation settings for MariaDB.
Default:utf8mb4_general_cimariadb_databases
List of databases to create.
Type: List of Dicts
Default:[]mariadb_users
List of users to create.
Type: List of Dicts
Default:[]
Example Playbook
Example playbooks showcasing how to use and set up this role.
License
GNU General Public License v3.0
Author Information
Xolyu.
ansible-galaxy install xolyu.mariadb