xolyu.mariadb
MariaDB
Installs and sets up the MariaDB database server. It also creates databases and users.
Requirements
System package
python3-mysqldb
is needed for Ansible's MySQL modules:mysql_user
andmysql_db
.To automatically manage these packages, use the
php_ensure_requirements
variable.
Dependencies
- Requires the
Community.Mysql
collection.
Role Variables
mariadb_ensure_requirements
Installs the required packages.
Type: bool
Default:no
mariadb_enabled_on_startup
Indicates if the MariaDB service should start automatically.
Type: bool
Default:yes
mariadb_secure_installation
Decides if the "secure installation" section should run, similar to MariaDB's script.
Options:on_install
,always
,never
Default:on_install
mariadb_config_style
Sets how the configuration is managed.single_cnf
means only the mainmariadb.cnf
file is modified.included_cnf
means the directory for included files is managed as well.none
means no changes are made.
Options:single_cnf
,included_cnf
,none
Default:single_cnf
mariadb_root_username
The username for MariaDB's root user, typicallyroot
.
Type: str
Default:root
mariadb_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:yes
mariadb_root_home
The home directory for the root user, used if the root password is set without UNIX socket auth.
Type: str
Default:/root
mariadb_root_auth_update
Authentication methods for the root user are set during installation unless this variable is true.
Type: bool
Default:no
mariadb_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.cnf
file 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.cnf
file.
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.1
mariadb_datadir
Ensures the data directory has the correct permissions.
Default:/var/lib/mysql
mariadb_encoding
Encoding settings for MariaDB.
Default:utf8mb4
mariadb_collation
Collation settings for MariaDB.
Default:utf8mb4_general_ci
mariadb_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