mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-29 05:41:25 -07:00
Changes made in documentation (EXAMPLES section added)
Minor identation fixes
This commit is contained in:
parent
d752919637
commit
1a6cb15ee6
1 changed files with 67 additions and 56 deletions
|
@ -105,6 +105,17 @@ options:
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
EXAMPLES = '''
|
||||||
|
# Stop mysql slave thread
|
||||||
|
- mysql_replication: mode=stopslave
|
||||||
|
|
||||||
|
# Get master binlog file name and binlog position
|
||||||
|
- mysql_replication: mode=getmaster
|
||||||
|
|
||||||
|
# Change master to master server 192.168.1.1 and use binary log 'mysql-bin.000009' with position 4578
|
||||||
|
- mysql_replication: mode=changemaster master_host=192.168.1.1 master_log_file=mysql-bin.000009 master_log_pos=4578
|
||||||
|
'''
|
||||||
|
|
||||||
import ConfigParser
|
import ConfigParser
|
||||||
import os
|
import os
|
||||||
import warnings
|
import warnings
|
||||||
|
@ -290,11 +301,11 @@ def main():
|
||||||
masterstatus = get_master_status(cursor)
|
masterstatus = get_master_status(cursor)
|
||||||
try:
|
try:
|
||||||
module.exit_json(
|
module.exit_json(
|
||||||
File=masterstatus[0],
|
File=masterstatus[0],
|
||||||
Position=masterstatus[1],
|
Position=masterstatus[1],
|
||||||
Binlog_Do_DB=masterstatus[2],
|
Binlog_Do_DB=masterstatus[2],
|
||||||
Binlog_Ignore_DB=masterstatus[3]
|
Binlog_Ignore_DB=masterstatus[3]
|
||||||
)
|
)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
module.fail_json(msg="Server is not configured as mysql master")
|
module.fail_json(msg="Server is not configured as mysql master")
|
||||||
|
|
||||||
|
@ -302,47 +313,47 @@ def main():
|
||||||
slavestatus = get_slave_status(cursor)
|
slavestatus = get_slave_status(cursor)
|
||||||
try:
|
try:
|
||||||
module.exit_json(
|
module.exit_json(
|
||||||
Slave_IO_State=slavestatus[0],
|
Slave_IO_State=slavestatus[0],
|
||||||
Master_Host=slavestatus[1],
|
Master_Host=slavestatus[1],
|
||||||
Master_User=slavestatus[2],
|
Master_User=slavestatus[2],
|
||||||
Master_Port=slavestatus[3],
|
Master_Port=slavestatus[3],
|
||||||
Connect_Retry=slavestatus[4],
|
Connect_Retry=slavestatus[4],
|
||||||
Master_Log_File=slavestatus[5],
|
Master_Log_File=slavestatus[5],
|
||||||
Read_Master_Log_Pos=slavestatus[6],
|
Read_Master_Log_Pos=slavestatus[6],
|
||||||
Relay_Log_File=slavestatus[7],
|
Relay_Log_File=slavestatus[7],
|
||||||
Relay_Log_Pos=slavestatus[8],
|
Relay_Log_Pos=slavestatus[8],
|
||||||
Relay_Master_Log_File=slavestatus[9],
|
Relay_Master_Log_File=slavestatus[9],
|
||||||
Slave_IO_Running=slavestatus[10],
|
Slave_IO_Running=slavestatus[10],
|
||||||
Slave_SQL_Running=slavestatus[11],
|
Slave_SQL_Running=slavestatus[11],
|
||||||
Replicate_Do_DB=slavestatus[12],
|
Replicate_Do_DB=slavestatus[12],
|
||||||
Replicate_Ignore_DB=slavestatus[13],
|
Replicate_Ignore_DB=slavestatus[13],
|
||||||
Replicate_Do_Table=slavestatus[14],
|
Replicate_Do_Table=slavestatus[14],
|
||||||
Replicate_Ignore_Table=slavestatus[15],
|
Replicate_Ignore_Table=slavestatus[15],
|
||||||
Replicate_Wild_Do_Table=slavestatus[16],
|
Replicate_Wild_Do_Table=slavestatus[16],
|
||||||
Replicate_Wild_Ignore_Table=slavestatus[17],
|
Replicate_Wild_Ignore_Table=slavestatus[17],
|
||||||
Last_Errno=slavestatus[18],
|
Last_Errno=slavestatus[18],
|
||||||
Last_Error=slavestatus[19],
|
Last_Error=slavestatus[19],
|
||||||
Skip_Counter=slavestatus[20],
|
Skip_Counter=slavestatus[20],
|
||||||
Exec_Master_Log_Pos=slavestatus[21],
|
Exec_Master_Log_Pos=slavestatus[21],
|
||||||
Relay_Log_Space=slavestatus[22],
|
Relay_Log_Space=slavestatus[22],
|
||||||
Until_Condition=slavestatus[23],
|
Until_Condition=slavestatus[23],
|
||||||
Until_Log_File=slavestatus[24],
|
Until_Log_File=slavestatus[24],
|
||||||
Until_Log_Pos=slavestatus[25],
|
Until_Log_Pos=slavestatus[25],
|
||||||
Master_SSL_Allowed=slavestatus[26],
|
Master_SSL_Allowed=slavestatus[26],
|
||||||
Master_SSL_CA_File=slavestatus[27],
|
Master_SSL_CA_File=slavestatus[27],
|
||||||
Master_SSL_CA_Path=slavestatus[28],
|
Master_SSL_CA_Path=slavestatus[28],
|
||||||
Master_SSL_Cert=slavestatus[29],
|
Master_SSL_Cert=slavestatus[29],
|
||||||
Master_SSL_Cipher=slavestatus[30],
|
Master_SSL_Cipher=slavestatus[30],
|
||||||
Master_SSL_Key=slavestatus[31],
|
Master_SSL_Key=slavestatus[31],
|
||||||
Seconds_Behind_Master=slavestatus[32],
|
Seconds_Behind_Master=slavestatus[32],
|
||||||
Master_SSL_Verify_Server_Cert=slavestatus[33],
|
Master_SSL_Verify_Server_Cert=slavestatus[33],
|
||||||
Last_IO_Errno=slavestatus[34],
|
Last_IO_Errno=slavestatus[34],
|
||||||
Last_IO_Error=slavestatus[35],
|
Last_IO_Error=slavestatus[35],
|
||||||
Last_SQL_Errno=slavestatus[36],
|
Last_SQL_Errno=slavestatus[36],
|
||||||
Last_SQL_Error=slavestatus[37],
|
Last_SQL_Error=slavestatus[37],
|
||||||
Replicate_Ignore_Server_Ids=slavestatus[38],
|
Replicate_Ignore_Server_Ids=slavestatus[38],
|
||||||
Master_Server_Id=slavestatus[39]
|
Master_Server_Id=slavestatus[39]
|
||||||
)
|
)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
module.fail_json(msg="Server is not configured as mysql slave")
|
module.fail_json(msg="Server is not configured as mysql slave")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue