Note
This plugin is part of the community.proxysql collection (version 1.3.0).
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
.
To use it in a playbook, specify: community.proxysql.proxysql_query_rules_fast_routing
.
New in version 1.1.0: of community.proxysql
The below requirements are needed on the host that executes this module.
Parameter | Choices/Defaults | Comments |
---|---|---|
comment string | Default: "" | Free form text field, usable for a descriptive comment of the query rule. |
config_file path | Default: "" | Specify a config file from which login_user and login_password are to be read. |
destination_hostgroup integer / required | Route matched queries to this hostgroup. This happens unless there is a started transaction and the logged in user has transaction_persistent set to True (refer to community.proxysql.proxysql_mysql_users). | |
flagIN integer | Default: 0 | 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). |
force_delete boolean |
| 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 True . |
load_to_runtime boolean |
| Dynamically load config to runtime memory. |
login_host string | Default: "127.0.0.1" | The host used to connect to ProxySQL admin interface. |
login_password string | The password used to authenticate to ProxySQL admin interface. | |
login_port integer | Default: 6032 | The port used to connect to ProxySQL admin interface. |
login_unix_socket string | The socket used to connect to ProxySQL admin interface. | |
login_user string | The username used to authenticate to ProxySQL admin interface. | |
save_to_disk boolean |
| Save config to sqlite db on disk to persist the configuration. |
schemaname string / required | Filtering criteria matching schemaname, a query will match only if the connection uses schemaname as its default schema. | |
state string |
| When present , adds the rule. When absent , removes the rule. |
username string / required | Filtering criteria matching username, a query will match only if the connection is made with the correct username. |
Note
check_mode
.--- # 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: yes load_to_runtime: yes
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
stdout dictionary | On create/update will return the newly modified rule, in all other cases will return a list of rules that match the supplied criteria. | The mysql user modified or removed from proxysql. Sample: {'changed': True, 'msg': 'Added rule to mysql_query_rules_fast_routing', 'rules': [{'comment': '', 'destination_hostgroup': 1, 'flagIN': '0', 'schemaname': 'default', 'username': 'user_ro'}], 'state': 'present'} |
© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/community/proxysql/proxysql_query_rules_fast_routing_module.html