diff --git a/changelogs/fragments/118-add-gtid_port.yml b/changelogs/fragments/118-add-gtid_port.yml new file mode 100644 index 0000000..2651464 --- /dev/null +++ b/changelogs/fragments/118-add-gtid_port.yml @@ -0,0 +1,2 @@ +bugfixes: + - modules/proxysql_backend_servers - Added missing gtid_port to proxysql_backend_servers module (https://github.com/ansible-collections/community.proxysql/pull/118). diff --git a/plugins/modules/proxysql_backend_servers.py b/plugins/modules/proxysql_backend_servers.py index 76d48b3..21a29ea 100644 --- a/plugins/modules/proxysql_backend_servers.py +++ b/plugins/modules/proxysql_backend_servers.py @@ -31,6 +31,10 @@ - The port at which the mysqld instance can be contacted. type: int default: 3306 + gtid_port: + description: + - The backend server port where ProxySQL Binlog Reader listens on for GTID tracking + type: int status: description: - ONLINE - Backend server is fully operational. @@ -150,6 +154,7 @@ "max_latency_ms": "0", "max_replication_lag": "0", "port": "3306", + "gtid_port": "0", "status": "ONLINE", "use_ssl": "0", "weight": "1" @@ -181,6 +186,12 @@ def perform_checks(module): msg="port must be a valid unix port number (0-65535)" ) + if module.params["gtid_port"] < 0 \ + or module.params["gtid_port"] > 65535: + module.fail_json( + msg="gtid_port must be a valid unix port number (0-65535)" + ) + if module.params["compression"]: if module.params["compression"] < 0 \ or module.params["compression"] > 102400: @@ -207,7 +218,8 @@ def __init__(self, module): self.hostname = module.params["hostname"] self.port = module.params["port"] - config_data_keys = ["status", + config_data_keys = ["gtid_port", + "status", "weight", "compression", "max_connections", @@ -413,6 +425,7 @@ def main(): hostgroup_id=dict(default=0, type='int'), hostname=dict(required=True, type='str'), port=dict(default=3306, type='int'), + gtid_port=dict(type='int'), status=dict(choices=['ONLINE', 'OFFLINE_SOFT', 'OFFLINE_HARD']),