Default variable details

Some of debops.mariadb_server default variables have more extensive configuration than simple strings or lists, here you can find documentation and examples for them.


The role uses /etc/mysql/conf.d/mysqld.cnf configuration file to manage the MariaDB/MySQL server configuration. This configuration file is generated by a template that uses the mariadb_server__mysqld_options variable to get the configuration data. The configuration itself is split among several variables located in defaults/main.yml file.

A minimal configuration is stored as a YAML dictionary. Keys of the dictionary as MariaDB configuration option names, and values of the dictionary are the configuration values. All values are automatically quoted in the generated configuration file.

Example configuration section:

  'query_cache_type': '0'
  'key_buffer': '16M'

The dictionary keys without values will be written in the configuration file with correct notation.

Alternative configuration notation is to use a YAML list, each element of a list being a YAML dictionary in the above format. An example:


  - 'query_cache_type': '0'
    'key_buffer': '16M'

  - 'skip_name_resolve':

Yet another alternative format can be used if you use certain keys in the YAML dictionary. The template checks for presence of the name or section keys, and if found, changes to a different format that uses YAML dictionary keys:

Required for the main options. Name of the option to add.
Required for the definiton of a configuration section. Create new section of the configuration file, written in square brackets.
Optional. Either present or absent. If not specified or present, a given section or option will be added in the configuration file; if absent, option or section won't be added.
Optional. Add a comment to a given option or section.
Optional for main options. If specified, set a value of a given option.
Optional. A YAML dictionary or list of YAML dictionaries with options to include in a given section, or multiple options specified together as a group. If it's specified, values of name and value are ignored.



  - section: 'mysqld'
    comment: 'Global MariaDB server options'

      - name: 'skip_name_resolve'

      - name: 'key_buffer'
        value: '16M'

      - name: 'query_cache_type'
        value: '0'
        state: 'present'