geerlingguy / ansible-role-mysql

Ansible Role - MySQL
https://galaxy.ansible.com/geerlingguy/mysql/
MIT License
1.06k stars 863 forks source link

Additional configuration files does not work as expected #553

Open pavlozt opened 1 month ago

pavlozt commented 1 month ago

Simply changing a additional files does not cause a restart mysql and handler notify. default value for ansible.builtin.template must be force = True : https://github.com/geerlingguy/ansible-role-mysql/blob/9f580ee10411edc5a12345edeac3dd2c69e9834e/tasks/configure.yml#L34

When the file is not actually different in content, the change will not occur anyway. This is how the ansible template module works.

pavlozt commented 1 month ago

The question is not so straightforward. This is what I read in the documentation:

A list of files that should override the default global my.cnf. Each item in the array requires a "src" parameter which is a path to a file. An optional "force" parameter can force the file to be updated each time ansible runs.

How should this be perceived? In fact, the file will not be ovewritten every time, but only when changes are made on the ansible side.

In this case, you have selected overwrite_global_mycnf: true

I am waiting for your decision as a Creator.