MariaDB Configuration

The MariaDB configuration is going to closely match that of the last chapter, minus a few of the steps, so I am not going to go into too much detail.

The default variables for this part of the role in roles/stack-config/defaults/main.yml are:

mariadb:  bind: "127.0.0.1"  server_config: "/etc/my.cnf.d/mariadb-server.cnf"  username: "root"  password: "Pa55W0rd123"  hosts:    - "127.0.0.1"    - "::1"    - "{{ ansible_nodename }}"    - "localhost"

As you can see, we are now using a nested variable, and we have removed root access on the host wildcard, the %, as the first part of the task in roles/stack-config/tasks/main.yml binds MariaDB to the localhost:

- name: configure the mariadb bind address  lineinfile:  dest: "{{ mariadb.server_config ...

Get Learn Ansible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.