mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-08 19:50:31 -07:00
Add two missing options
This commit is contained in:
parent
cd29b79765
commit
d60693cc9b
2 changed files with 27 additions and 1 deletions
|
@ -1,3 +1,3 @@
|
||||||
---
|
---
|
||||||
minor_changes:
|
minor_changes:
|
||||||
- "mysql_replication - add the new options: ``primary_bind``, ``primary_heartbeat_period``, ``primary_retry_count``, ``primary_ssl_crl``, ``primary_ssl_crlpath``, ``primary_tls_version``, ``ignore_server_ids``, ``do_domain_ids``, ``ignore_domain_ids``, ``privilege_checks_user``, ``require_row_format``, ``require_table_primary_key_check``, ``source_connection_auto_failover``, ``primary_compression_algorithms``, ``primary_zstd_compression_level``, ``primary_tls_ciphersuites``, ``primary_public_key_path``, ``get_primary_public_key``, ``network_namespace`` (https://github.com/ansible-collections/community.mysql/issues/59)."
|
- "mysql_replication - add the new options: ``assign_gtids_to_anonymous_transactions``, ``gtid_only``, ``primary_bind``, ``primary_heartbeat_period``, ``primary_retry_count``, ``primary_ssl_crl``, ``primary_ssl_crlpath``, ``primary_tls_version``, ``ignore_server_ids``, ``do_domain_ids``, ``ignore_domain_ids``, ``privilege_checks_user``, ``require_row_format``, ``require_table_primary_key_check``, ``source_connection_auto_failover``, ``primary_compression_algorithms``, ``primary_zstd_compression_level``, ``primary_tls_ciphersuites``, ``primary_public_key_path``, ``get_primary_public_key``, ``network_namespace`` (https://github.com/ansible-collections/community.mysql/issues/59)."
|
||||||
|
|
|
@ -235,6 +235,12 @@ options:
|
||||||
choices: ["stream", "on", "off"]
|
choices: ["stream", "on", "off"]
|
||||||
type: str
|
type: str
|
||||||
version_added: 3.6.0
|
version_added: 3.6.0
|
||||||
|
assign_gtids_to_annonymous_transactions:
|
||||||
|
description:
|
||||||
|
- Same as the C(ASSIGN_GTIDS_TO_ANNONYMOUS_TRANSACTIONS) mysql variable.
|
||||||
|
- Choices: ["OFF", "LOCAL", uuid]
|
||||||
|
type: str
|
||||||
|
version_added: 3.6.0
|
||||||
source_connection_auto_failover:
|
source_connection_auto_failover:
|
||||||
description:
|
description:
|
||||||
- Same as mysql variable.
|
- Same as mysql variable.
|
||||||
|
@ -273,6 +279,12 @@ options:
|
||||||
- Same as mysql variable.
|
- Same as mysql variable.
|
||||||
type: str
|
type: str
|
||||||
version_added: 3.6.0
|
version_added: 3.6.0
|
||||||
|
gtid_only:
|
||||||
|
description:
|
||||||
|
- Same as mysql variable.
|
||||||
|
type: bool
|
||||||
|
default: False
|
||||||
|
version_added: 3.6.0
|
||||||
connection_name:
|
connection_name:
|
||||||
description:
|
description:
|
||||||
- Name of the primary connection.
|
- Name of the primary connection.
|
||||||
|
@ -391,6 +403,7 @@ queries:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
|
@ -591,10 +604,12 @@ def main():
|
||||||
do_domain_ids=dict(type='list', elements="str"),
|
do_domain_ids=dict(type='list', elements="str"),
|
||||||
ignore_domain_ids=dict(type='list', elements="str"),
|
ignore_domain_ids=dict(type='list', elements="str"),
|
||||||
primary_delay=dict(type='int', aliases=['master_delay']),
|
primary_delay=dict(type='int', aliases=['master_delay']),
|
||||||
|
gtid_only=dict(type='bool', default=False)
|
||||||
connection_name=dict(type='str'),
|
connection_name=dict(type='str'),
|
||||||
privilege_checks_user=dict(type='str', choices=['account']),
|
privilege_checks_user=dict(type='str', choices=['account']),
|
||||||
require_row_format=dict(type='bool', default=False),
|
require_row_format=dict(type='bool', default=False),
|
||||||
require_table_primary_key_check=dict(type='str', choices=['stream', 'on', 'off']),
|
require_table_primary_key_check=dict(type='str', choices=['stream', 'on', 'off']),
|
||||||
|
assign_gtids_to_anonymous_transactions=dict(type='str')
|
||||||
source_connection_auto_failover=dict(type='bool', default=False),
|
source_connection_auto_failover=dict(type='bool', default=False),
|
||||||
network_namespace=dict(type='str'),
|
network_namespace=dict(type='str'),
|
||||||
channel=dict(type='str'),
|
channel=dict(type='str'),
|
||||||
|
@ -641,6 +656,9 @@ def main():
|
||||||
privilege_checks_user = module.params["privilege_checks_user"]
|
privilege_checks_user = module.params["privilege_checks_user"]
|
||||||
require_row_format = module.params["require_row_format"]
|
require_row_format = module.params["require_row_format"]
|
||||||
require_table_primary_key_check = module.params["require_table_primary_key_check"]
|
require_table_primary_key_check = module.params["require_table_primary_key_check"]
|
||||||
|
assign_gtids_to_anonymous_transactions = module.params["assign_gtids_to_anonymous_transactions"]
|
||||||
|
if re.fullmatch(r'^(?:[0-9A-F]{8}-[0-9A-F]{4}-[1-5][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}|off|local)$', assign_gtids_to_anonymous_transactions, re.I) is None:
|
||||||
|
module.fail_json(msg="assign_gtids_to_anonymous_transactions must be a UUID, 'OFF' or 'LOCAL'")
|
||||||
source_connection_auto_failover = module.params["source_connection_auto_failover"]
|
source_connection_auto_failover = module.params["source_connection_auto_failover"]
|
||||||
network_namespace = module.params["network_namespace"]
|
network_namespace = module.params["network_namespace"]
|
||||||
ssl_cert = module.params["client_cert"]
|
ssl_cert = module.params["client_cert"]
|
||||||
|
@ -654,6 +672,7 @@ def main():
|
||||||
primary_use_gtid = 'no'
|
primary_use_gtid = 'no'
|
||||||
else:
|
else:
|
||||||
primary_use_gtid = module.params["primary_use_gtid"]
|
primary_use_gtid = module.params["primary_use_gtid"]
|
||||||
|
gtid_only = module.params["gtid_only"]
|
||||||
connection_name = module.params["connection_name"]
|
connection_name = module.params["connection_name"]
|
||||||
channel = module.params['channel']
|
channel = module.params['channel']
|
||||||
fail_on_error = module.params['fail_on_error']
|
fail_on_error = module.params['fail_on_error']
|
||||||
|
@ -790,10 +809,17 @@ def main():
|
||||||
chm.append("REQUIRE_ROW_FORMAT=1")
|
chm.append("REQUIRE_ROW_FORMAT=1")
|
||||||
if require_table_primary_key_check is not None:
|
if require_table_primary_key_check is not None:
|
||||||
chm.append("REQUIRE_TABLE_PRIMARY_KEY_CHECK='%s'" % require_table_primary_key_check)
|
chm.append("REQUIRE_TABLE_PRIMARY_KEY_CHECK='%s'" % require_table_primary_key_check)
|
||||||
|
if assign_gtids_to_anonymous_transactions is not None:
|
||||||
|
chm.append("ASSIGN_GTIDS_TO_ANONYMOUS_FUNCTION='%s'" % assign_gtids_to_anonymous_transactions)
|
||||||
if source_connection_auto_failover:
|
if source_connection_auto_failover:
|
||||||
chm.append("SOURCE_CONNECTION_AUTO_FAILOVER=1")
|
chm.append("SOURCE_CONNECTION_AUTO_FAILOVER=1")
|
||||||
if network_namespace is not None:
|
if network_namespace is not None:
|
||||||
chm.append("NETWORK_NAMESPACE='%s'" % network_namespace)
|
chm.append("NETWORK_NAMESPACE='%s'" % network_namespace)
|
||||||
|
if gtid_only is not None:
|
||||||
|
if gtid_only:
|
||||||
|
chm.append("GTID_ONLY=1")
|
||||||
|
else:
|
||||||
|
chm.append("GTID_ONLY=0")
|
||||||
try:
|
try:
|
||||||
changeprimary(cursor, chm, connection_name, channel)
|
changeprimary(cursor, chm, connection_name, channel)
|
||||||
except mysql_driver.Warning as e:
|
except mysql_driver.Warning as e:
|
||||||
|
|
Loading…
Add table
Reference in a new issue