Skip to content

Commit

Permalink
Added missing gtid_port to proxysql_backend_servers module
Browse files Browse the repository at this point in the history
  • Loading branch information
Athanasios Koukoulis committed Oct 16, 2022
1 parent defeeae commit 6789a8c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/118-add-gtid_port.yml
Original file line number Diff line number Diff line change
@@ -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).
15 changes: 14 additions & 1 deletion plugins/modules/proxysql_backend_servers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -150,6 +154,7 @@
"max_latency_ms": "0",
"max_replication_lag": "0",
"port": "3306",
"gtid_port": "0",
"status": "ONLINE",
"use_ssl": "0",
"weight": "1"
Expand Down Expand Up @@ -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:
Expand All @@ -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",
Expand Down Expand Up @@ -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']),
Expand Down

0 comments on commit 6789a8c

Please sign in to comment.