Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New module mysql_info - Gather information about MySQL servers #55434

Open
wants to merge 12 commits into
base: devel
from

Conversation

Projects
None yet
6 participants
@Andersson007
Copy link
Contributor

commented Apr 17, 2019

SUMMARY

New module mysql_info - Gather information about MySQL servers

ISSUE TYPE
  • New Module Pull Request
EXAMPLES
- name: Collect all possible information using passwordless root access
  mysql_info:
    login_user: root

- name: Get MySQL version with non-default credentials
  mysql_info:
    login_user: mysuperuser
    login_password: mysuperpass
    filter: version

- name: Collect all info except settings and roles by root
  mysql_info:
    login_user: root
    login_password: rootpass
    filter: "!settings,!roles"

- name: Collect info about databases and version using ~/.my.cnf as a credential file
  become: yes
  mysql_info:
    filter:
    - databases
    - version

- name: Collect info about databases and version using ~alice/.my.cnf as a credential file
  become: yes
  mysql_info:
    config_file: /home/alice/.my.cnf
    filter:
    - databases
RETURN

Example of return values

    "version": {
        "major": 5, 
        "minor": 5, 
        "release": 60
    }
    "databases": {
        "information_schema": {
            "size": 73728
        }, 
        "mysql": {
            "size": 656594
        }, 
    "engines": {
        "CSV": {
            "Comment": "CSV storage engine", 
            "Savepoints": "NO", 
            "Support": "YES", 
            "Transactions": "NO", 
            "XA": "NO"
        }, 
        "InnoDB": {
            "Comment": "Percona-XtraDB, Supports transactions, row-level locking, and foreign keys", 
            "Savepoints": "YES", 
            "Support": "DEFAULT", 
            "Transactions": "YES", 
            "XA": "YES"
        }, 
        "MyISAM": {
            "Comment": "MyISAM storage engine", 
            "Savepoints": "NO", 
            "Support": "YES", 
            "Transactions": "NO", 
            "XA": "NO"
        }, 
    }, 
    "master_status": {
        "Binlog_Do_DB": "", 
        "Binlog_Ignore_DB": "mysql", 
        "File": "mysql-bin.000001", 
        "Position": 769
    }, 
    "roles": {
        "10.44.1.124": {
            "replication_user": {
                "Alter_priv": "N", 
                "Alter_routine_priv": "N", 
                "Create_priv": "N", 
                "Create_routine_priv": "N", 
                "Create_tablespace_priv": "N", 
                "Create_tmp_table_priv": "N", 
                "Create_user_priv": "N", 
                "Create_view_priv": "N", 
                "Delete_priv": "N", 
                "Drop_priv": "N", 
                "Event_priv": "N", 
                "Execute_priv": "N", 
                "File_priv": "N", 
                "Grant_priv": "N", 
                "Index_priv": "N", 
                "Insert_priv": "N", 
                "Lock_tables_priv": "N", 
                "Password": "*E0A25BDCE20352AD0F0EB6706C5FE1F6299D2263", 
                "Process_priv": "N", 
                "References_priv": "N", 
                "Reload_priv": "N", 
                "Repl_client_priv": "N", 
                "Repl_slave_priv": "Y", 
                "Select_priv": "N", 
                "Show_db_priv": "N", 
                "Show_view_priv": "N", 
                "Shutdown_priv": "N", 
                "Super_priv": "N", 
                "Trigger_priv": "N", 
                "Update_priv": "N", 
                "authentication_string": "", 
                "max_connections": 0, 
                "max_questions": 0, 
                "max_updates": 0, 
                "max_user_connections": 0, 
                "plugin": "", 
                "ssl_cipher": "", 
                "ssl_type": "", 
                "x509_issuer": "", 
                "x509_subject": ""
            }
        }, 
    "settings": {
        "innodb_adaptive_flushing": "ON", 
        "innodb_adaptive_flushing_method": "estimate", 
        "innodb_adaptive_hash_index": "ON", 
        "innodb_adaptive_hash_index_partitions": 1, 
        "innodb_additional_mem_pool_size": 8388608, 
        "innodb_autoextend_increment": 8, 
        "innodb_autoinc_lock_mode": 1, 
        "innodb_blocking_buffer_pool_restore": "OFF", 
        "innodb_buffer_pool_instances": 1, 
        "innodb_buffer_pool_populate": "OFF", 
        "innodb_buffer_pool_restore_at_startup": 0, 
        "innodb_buffer_pool_shm_checksum": "ON", 
        "innodb_buffer_pool_shm_key": 0, 
        "innodb_buffer_pool_size": 134217728, 
        "innodb_change_buffering": "all", 
        "innodb_checkpoint_age_target": 0, 
        "innodb_checksums": "ON", 
        "innodb_commit_concurrency": 0, 
        "innodb_concurrency_tickets": 500, 
        "innodb_corrupt_table_action": "assert", 
        "innodb_data_file_path": "ibdata1:10M:autoextend", 
        "innodb_data_home_dir": "", 
        "innodb_dict_size_limit": 0, 
        "innodb_doublewrite": "ON", 
        "innodb_doublewrite_file": "", 
        "innodb_fake_changes": "OFF", 
        "innodb_fast_checksum": "OFF", 
        "innodb_fast_shutdown": 1, 
        "innodb_file_format": "Antelope", 
        "innodb_file_format_check": "ON", 
        "innodb_file_format_max": "Antelope", 
        "innodb_file_per_table": "OFF", 
        "innodb_flush_log_at_trx_commit": 1, 
        "innodb_flush_method": "", 
        "innodb_flush_neighbor_pages": "area", 
        "innodb_force_load_corrupted": "OFF", 
        "innodb_force_recovery": 0, 
        "innodb_ibuf_accel_rate": 100, 
        "innodb_ibuf_active_contract": 1, 
        "innodb_ibuf_max_size": 67092480, 
        "innodb_import_table_from_xtrabackup": 0, 
        "innodb_io_capacity": 200, 
        "innodb_kill_idle_transaction": 0, 
        "innodb_large_prefix": "OFF", 
        "innodb_lazy_drop_table": 0, 
        "innodb_lock_wait_timeout": 50, 
        "innodb_locking_fake_changes": "ON", 
        "innodb_locks_unsafe_for_binlog": "OFF", 
        "innodb_log_block_size": 512, 
        "innodb_log_buffer_size": 8388608, 
        "innodb_log_file_size": 5242880, 
        "innodb_log_files_in_group": 2, 
        "innodb_log_group_home_dir": "./", 
        "innodb_max_bitmap_file_size": 104857600, 
        "innodb_max_changed_pages": 1000000, 
        "innodb_max_dirty_pages_pct": 75, 
        "innodb_max_purge_lag": 0, 
        "innodb_merge_sort_block_size": 1048576, 
        "innodb_mirrored_log_groups": 1, 
        "innodb_old_blocks_pct": 37, 
        "innodb_old_blocks_time": 0, 
        "innodb_open_files": 300, 
        "innodb_page_size": 16384, 
        "innodb_print_all_deadlocks": "OFF", 
        "innodb_purge_batch_size": 20, 
        "innodb_purge_threads": 1, 
        "innodb_random_read_ahead": "OFF", 
        "innodb_read_ahead": "linear", 
        "innodb_read_ahead_threshold": 56, 
        "innodb_read_io_threads": 4, 
        "innodb_recovery_stats": "OFF", 
        "innodb_recovery_update_relay_log": "OFF", 
        "innodb_replication_delay": 0, 
        "innodb_rollback_on_timeout": "OFF", 
        "innodb_rollback_segments": 128, 
        "innodb_show_locks_held": 10, 
        "innodb_show_verbose_locks": 0, 
        "innodb_simulate_comp_failures": 0, 
        "innodb_spin_wait_delay": 6, 
        "innodb_stats_auto_update": 1, 
        "innodb_stats_method": "nulls_equal", 
        "innodb_stats_modified_counter": 0, 
        "innodb_stats_on_metadata": "ON", 
        "innodb_stats_sample_pages": 8, 
        "innodb_stats_traditional": "ON", 
        "innodb_stats_update_need_lock": 1, 
        "innodb_strict_mode": "OFF", 
        "innodb_support_xa": "ON", 
        "innodb_sync_spin_loops": 30, 
        "innodb_table_locks": "ON", 
        "innodb_thread_concurrency": 0, 
        "innodb_thread_concurrency_timer_based": "OFF", 
        "innodb_thread_sleep_delay": 10000, 
        "innodb_track_changed_pages": "OFF", 
        "innodb_use_atomic_writes": "OFF", 
        "innodb_use_fallocate": "OFF", 
        "innodb_use_global_flush_log_at_trx_commit": "ON", 
        "innodb_use_native_aio": "ON", 
        "innodb_use_stacktrace": "OFF", 
        "innodb_use_sys_malloc": "ON", 
        "innodb_use_sys_stats_table": "OFF", 
        "innodb_version": "5.5.59-MariaDB-38.11", 
        "innodb_write_io_threads": 4, 
    }, 
    "slave_hosts": {
        "2": {
            "Host": "", 
            "Master_id": 1, 
            "Port": 3306
        }
    }, 
@ansibot

This comment has been minimized.

@Andersson007 Andersson007 force-pushed the Andersson007:mysql_info branch from 73b6458 to 3a7a6b1 Apr 17, 2019

@bmalynovytch

This comment has been minimized.

Copy link
Contributor

commented Apr 17, 2019

-label needs_triage

@Andersson007 Andersson007 force-pushed the Andersson007:mysql_info branch from b793599 to 9fae596 Apr 17, 2019

@Andersson007 Andersson007 reopened this Apr 17, 2019

@Andersson007 Andersson007 reopened this Apr 17, 2019

@Andersson007

This comment has been minimized.

Copy link
Contributor Author

commented Apr 17, 2019

@abadger , please, look at the changes in basic.py and converter.py.
Waiting for your answer

@Andersson007 Andersson007 force-pushed the Andersson007:mysql_info branch from f1b2496 to 85c814c Apr 23, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Apr 23, 2019

@Jmainguy @Xyon @banyek @bmalynovytch @bmildren @michaelcoburn @Oneiroi @tolland

As a maintainer of a module in the same namespace this new module has been submitted to, your vote counts for shipits. Please review this module and add shipit if you would like to see it merged.

click here for bot help

@Andersson007

This comment has been minimized.

Copy link
Contributor Author

commented Apr 23, 2019

ready_for_review

Andersson007 added some commits Apr 24, 2019

@Andersson007

This comment has been minimized.

Copy link
Contributor Author

commented Apr 24, 2019

@bmalynovytch , changed the args string as you like, ready for your review

@Andersson007

This comment has been minimized.

Copy link
Contributor Author

commented Apr 25, 2019

Percona guys @michaelcoburn and @Oneiroi , could you please look at this one?
I'm waiting for this module will be merged.
Maybe then I could help with opened issues/PRs/new modules for MySQL.

@cmfrtl

This comment has been minimized.

Copy link

commented Apr 29, 2019

shipit

@Andersson007

This comment has been minimized.

Copy link
Contributor Author

commented May 3, 2019

@tcraxs , could you please look at this ?

@Andersson007

This comment has been minimized.

Copy link
Contributor Author

commented May 8, 2019

@bmalynovytch ping, lets do something with it. I'll review at least 2 MySQL PRs (on your choice) after this one is merged ;)

@Andersson007 Andersson007 reopened this May 8, 2019

@ansibot ansibot removed the stale_ci label May 8, 2019

@bmalynovytch

This comment has been minimized.

Copy link
Contributor

commented May 8, 2019

@Andersson007 Hahaha ! 😄
I'll try to give it an eye ASAP 👍

@ansibot ansibot added the stale_ci label May 16, 2019

@Andersson007 Andersson007 reopened this May 17, 2019

@ansibot ansibot removed the stale_ci label May 17, 2019

@ansibot ansibot added the stale_ci label May 25, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.