ansible / ansible.builtin / v2.3.3.0-1 / module / proxysql_mysql_users Adds or removes mysql users from proxysql admin interface. | "added in version" 2.3 of ansible.builtin" Authors: Ben Mildren (@bmildren) stableinterface | supported by communityansible.builtin.proxysql_mysql_users (v2.3.3.0-1) — module
pip
Install with pip install ansible==2.3.3.0.post1
The M(proxysql_mysql_users) module adds or removes mysql users using the proxysql admin interface.
--- # This example adds a user, it saves the mysql user config to disk, but # avoids loading the mysql user config to runtime (this might be because # several users are being added and the user wants to push the config to # runtime in a single batch using the M(proxysql_manage_config) module). It # uses supplied credentials to connect to the proxysql admin interface. - proxysql_mysql_users: login_user: 'admin' login_password: 'admin' username: 'productiondba' state: present load_to_runtime: False
# This example removes a user, saves the mysql user config to disk, and # dynamically loads the mysql user config to runtime. It uses credentials # in a supplied config file to connect to the proxysql admin interface. - proxysql_mysql_users: config_file: '~/proxysql.cnf' username: 'mysqlboy' state: absent
state: choices: - present - absent default: present description: - When C(present) - adds the user, when C(absent) - removes the user. active: description: - A user with I(active) set to C(False) will be tracked in the database, but will be never loaded in the in-memory data structures. If omitted the proxysql database default for I(active) is C(True). backend: default: true description: - If I(backend) is set to C(True), this (username, password) pair is used for authenticating to the ProxySQL instance. use_ssl: description: - If I(use_ssl) is set to C(True), connections by this user will be made using SSL connections. If omitted the proxysql database default for I(use_ssl) is C(False). frontend: default: true description: - If I(frontend) is set to C(True), this (username, password) pair is used for authenticating to the mysqld servers against any hostgroup. password: description: - Password of the user connecting to the mysqld or ProxySQL instance. username: description: - Name of the user connecting to the mysqld or ProxySQL instance. required: true login_host: default: 127.0.0.1 description: - The host used to connect to ProxySQL admin interface. login_port: default: 6032 description: - The port used to connect to ProxySQL admin interface. login_user: default: None description: - The username used to authenticate to ProxySQL admin interface. config_file: default: '' description: - Specify a config file from which login_user and login_password are to be read. fast_forward: description: - If I(fast_forward) is set to C(True), I(fast_forward) will bypass the query processing layer (rewriting, caching) and pass through the query directly as is to the backend server. If omitted the proxysql database default for I(fast_forward) is C(False). save_to_disk: default: true description: - Save mysql host config to sqlite db on disk to persist the configuration. default_schema: description: - The schema to which the connection should change to by default. login_password: default: None description: - The password used to authenticate to ProxySQL admin interface. load_to_runtime: default: true description: - Dynamically load mysql host config to runtime memory. max_connections: description: - The maximum number of connections ProxySQL will open to the backend for this user. If omitted the proxysql database default for I(max_connections) is 10000. default_hostgroup: description: - If there is no matching rule for the queries sent by this user, the traffic it generates is sent to the specified hostgroup. If omitted the proxysql database default for I(use_ssl) is 0. transaction_persistent: description: - If this is set for the user with which the MySQL client is connecting to ProxySQL (thus a "frontend" user), transactions started within a hostgroup will remain within that hostgroup regardless of any other rules. If omitted the proxysql database default for I(transaction_persistent) is C(False).
stdout: description: The mysql user modified or removed from proxysql returned: On create/update will return the newly modified user, on delete it will return the deleted record. sample": changed: true msg: Added user to mysql_users state: present user: active: '1' backend: '1' default_hostgroup: '1' default_schema: null fast_forward: '0' frontend: '1' max_connections: '10000' password: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER schema_locked: '0' transaction_persistent: '0' use_ssl: '0' username: guest_ro username: guest_ro type: dict