community.proxysql
community.proxysql copied to clipboard
Add support for enable_load_data_local_infile variable
SUMMARY
Add support for setting enable_load_data_local_infile variable
ISSUE TYPE
- Feature Pull Request
COMPONENT NAME
proxysql role
@jpiron thanks for your contribution.
The variable mysql-enable_load_data_local_infile was introduced with proxysql 2.3.0. So when you use this role with proxysql_version: 2.2.2, the installation will fail
failed: [localhost] (item={'key': 'enable_load_data_local_infile', 'value': {'variable': 'enable_load_data_local_infile', 'variable_value': False}}) => {"ansible_loop_var": "item", "changed": false, "item": {"key": "enable_load_data_local_infile", "value": {"variable": "enable_load_data_local_infile", "variable_value": false}}, "msg": "The variable \"mysql-enable_load_data_local_infile\" was not found"}
unfortunately, we have no compliance how long we support proxysql versions < 2.3.0.
Can you please cover this like you did the last time?
Sure I'll add this on monday
It's updated
@jpiron I still got an error when trying to install 2.2.2 e.g.
---
- hosts: localhost
become: yes
vars:
proxysql_version: 2.2.2
roles:
- proxysql
results in
RUNNING HANDLER [proxysql : proxysql | handler | manage mysql config] *****
...
failed: [localhost] (item={'key': 'enable_load_data_local_infile', 'value': {'variable': 'enable_load_data_local_infile', 'variable_value': False}}) => {"ansible_loop_var": "item", "changed": false, "item": {"key": "enable_load_data_local_infile", "value": {"variable": "enable_load_data_local_infile", "variable_value": false}}, "msg": "The variable \"mysql-enable_load_data_local_infile\" was not found"}
....
I might be wrong but my understanding of the issue is that the default /etc/proxysql.cnf that ships with the 2.2.2 proxysql version doesn't contain the enable_load_data_local_infile` variable. Therefore the variable isn't loaded into proxysql runtime.
The manage mysql config handler calls the proxysql_global_variables that only performs updates on already proxysql-runtime-loaded variables.
As a result, it fails here: https://github.com/ansible-collections/community.proxysql/blob/main/plugins/modules/proxysql_global_variables.py#L232
Shouldn't the module perform an INSERT if the get_config returns False ?
@jpiron sorry for the late reply, I was out of office.
Shouldn't the module perform an
INSERTif theget_configreturnsFalse?
That might work I think. Are we sure that there are not side-effects when inserting new global variables to proxysql?
I suppose, I need to check
That might work I think. Are we sure that there are not side-effects when inserting new global variables to proxysql?
I've inserted a random name variable. It looks like that it doesn't made any problems...
Sorry for the late answer, I didn't get the time to work on this lately. I'll try to manage some time to implement this.