community.proxysql.proxysql_query_rules_fast_routing module – Modifies query rules for fast routing policies using the proxysql admin interface
Note
This module is part of the community.proxysql collection (version 1.5.1).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.proxysql
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: community.proxysql.proxysql_query_rules_fast_routing
.
New in community.proxysql 1.1.0
Synopsis
The community.proxysql.proxysql_query_rules_fast_routing module modifies query rules for fast routing policies and attributes using the proxysql admin interface.
Requirements
The below requirements are needed on the host that executes this module.
PyMySQL
mysqlclient
Parameters
Parameter |
Comments |
---|---|
Free form text field, usable for a descriptive comment of the query rule. Default: |
|
Specify a config file from which login_user and login_password are to be read. Default: |
|
Route matched queries to this hostgroup. This happens unless there is a started transaction and the logged in user has transaction_persistent set to |
|
Evaluated in the same way as flagIN is in mysql_query_rules and correlates to the flagOUT/apply specified in the mysql_query_rules table. (see community.proxysql.proxysql_query_rules). Default: |
|
By default, we avoid deleting more than one schedule in a single batch; however, if you need this behaviour and you are not concerned about the schedules deleted, you can set force_delete to Choices:
|
|
Dynamically load config to runtime memory. Choices:
|
|
The host used to connect to ProxySQL admin interface. Default: |
|
The password used to authenticate to ProxySQL admin interface. |
|
The port used to connect to ProxySQL admin interface. Default: |
|
The socket used to connect to ProxySQL admin interface. |
|
The username used to authenticate to ProxySQL admin interface. |
|
Save config to sqlite db on disk to persist the configuration. Choices:
|
|
Filtering criteria matching schemaname, a query will match only if the connection uses schemaname as its default schema. |
|
When Choices:
|
|
Filtering criteria matching username, a query will match only if the connection is made with the correct username. |
Notes
Note
Supports
check_mode
.
Examples
---
# This example adds a rule for fast routing
- name: Add a rule
community.proxysql.proxysql_query_rules_fast_routing:
login_user: admin
login_password: admin
username: 'user_ro'
schemaname: 'default'
destination_hostgroup: 1
comment: 'fast route user_ro to default schema'
state: present
save_to_disk: true
load_to_runtime: true
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The mysql user modified or removed from proxysql. Returned: On create/update will return the newly modified rule, in all other cases will return a list of rules that match the supplied criteria. Sample: |