{"id":21400276,"url":"https://github.com/oefenweb/ansible-percona-server-tools","last_synced_at":"2025-07-13T21:31:15.044Z","repository":{"id":54227280,"uuid":"42239872","full_name":"Oefenweb/ansible-percona-server-tools","owner":"Oefenweb","description":"Ansible role to manage percona-server server (or any other flavour of MySQL) in Debian-like systems","archived":false,"fork":false,"pushed_at":"2023-11-02T11:06:10.000Z","size":158,"stargazers_count":12,"open_issues_count":2,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2023-11-02T11:37:29.168Z","etag":null,"topics":["ansible","debian","percona-server","replication","slave-replication","tools","ubuntu"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Oefenweb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2015-09-10T11:13:35.000Z","updated_at":"2022-06-18T04:16:01.000Z","dependencies_parsed_at":"2023-10-01T20:41:37.964Z","dependency_job_id":null,"html_url":"https://github.com/Oefenweb/ansible-percona-server-tools","commit_stats":null,"previous_names":[],"tags_count":55,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oefenweb%2Fansible-percona-server-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oefenweb%2Fansible-percona-server-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oefenweb%2Fansible-percona-server-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oefenweb%2Fansible-percona-server-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Oefenweb","download_url":"https://codeload.github.com/Oefenweb/ansible-percona-server-tools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225917743,"owners_count":17544943,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","debian","percona-server","replication","slave-replication","tools","ubuntu"],"created_at":"2024-11-22T15:20:32.891Z","updated_at":"2024-11-22T15:20:33.586Z","avatar_url":"https://github.com/Oefenweb.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"## percona-server-tools\n\n[![CI](https://github.com/Oefenweb/ansible-percona-server-tools/workflows/CI/badge.svg)](https://github.com/Oefenweb/ansible-percona-server-tools/actions?query=workflow%3ACI)\n[![Ansible Galaxy](http://img.shields.io/badge/ansible--galaxy-percona--server--tools-blue.svg)](https://galaxy.ansible.com/Oefenweb/percona_server_tools)\n\nManage [percona-server](https://www.percona.com/software/mysql-database/percona-server) server (or any other flavour of MySQL) in Debian-like systems.\n\n#### Requirements\n\n* `mysql` (will not be installed)\n* `mysqld`, version `\u003e= 5.5` (will not be installed)\n\n#### Variables\n\n##### Reset root password\n\nUses the `debian-sys-maint` from `/etc/mysql/debian.cnf` to login with.\n\n* `percona_server_tools_reset_root_password`: [default: `{}`]:\n* `percona_server_tools_reset_root_password.run`: [default: `false`]: Whether or not to run `reset-root-password.yml`\n\n* `percona_server_tools_reset_root_password.root_password`: [required]: Root password\n* `percona_server_tools_reset_root_password.unsafe_variables`: [optional, default: `[]`]: Variables (e.g. from `plugins`) that cause `mysqld` not to start when started with `--skip-grant-tables` (e.g. `^query_response_time_`)\n\n##### Resize InnoDB logs\n\nRemoves the current InnoDB log files in a safe way.\n\n* `percona_server_tools_reset_ib_logfile`: [default: `{}`]:\n* `percona_server_tools_reset_ib_logfile.run`: [default: `false`]: Whether or not to run `reset-ib-logfile.yml`\n\n* `percona_server_tools_reset_ib_logfile.check_innodb_shutdown_mode`: [default: `true`]: Whether or not to check the InnoDB shutdown mode\n* `percona_server_tools_reset_ib_logfile.ib_logfiles`: [default: `[/var/lib/mysql/ib_logfile0, /var/lib/mysql/ib_logfile1]`]: InnoDB logs to resize\n\n##### Setup slave replication (using `xtrabackup`)\n\nSets up slave replication on one or more slaves from a healthy master. Assumes that the slaves are able to pull backups using `rsync` over `ssh`, so ssh (keys) need to be set up.\n\n**Notes**\n\n* Recommends using the `any_errors_fatal` [option](http://docs.ansible.com/ansible/playbooks_delegation.html#interrupt-execution-on-any-error) to interrupt execution on any error\n\n- - -\n\n* `percona_server_tools_setup_slave_replication`: [default: `{}`]:\n* `percona_server_tools_setup_slave_replication.run`: [default: `false`]: Whether or not to run `setup-slave-replication.yml`\n\n* `percona_server_tools_setup_slave_replication.inventory`: [required]: Inventory section\n* `percona_server_tools_setup_slave_replication.inventory.master`: [required]: The inventory hostname of the master server (e.g. `db-01.example.com`)\n* `percona_server_tools_setup_slave_replication.inventory.slaves`: [required]: The inventory hostname(s) of the slave server(s) (e.g. `[db-02.example.com, db-03.example.com]`)\n\n* `percona_server_tools_setup_slave_replication.innobackupex`: [required]: Innobackupex section\n* `percona_server_tools_setup_slave_replication.innobackupex.user`: [optional]: Specifies the user (i.e., the MySQL username used when connecting to the server) to login as, if that's not the current user. It is passed to the `mysql` child process without alteration\n* `percona_server_tools_setup_slave_replication.innobackupex.password`: [optional]: Specifies the password to use when connecting to the database. It is passed to the `mysql` child process without alteration\n* `percona_server_tools_setup_slave_replication.innobackupex.parallel`: [optional]: Specifies the number of threads the `xtrabackup` child process should use to back up files concurrently\n* `percona_server_tools_setup_slave_replication.innobackupex.rsync`: [optional]: Use the `rsync` utility to optimize local file transfers. When this option is specified, `innobackupex` uses `rsync` to copy all non-InnoDB files instead of spawning a separate `cp` for each file, which can be much faster for servers with a large number of databases or tables\n* `percona_server_tools_setup_slave_replication.innobackupex.backup_dir`: [required]: Specifies the backup directory\n* `percona_server_tools_setup_slave_replication.innobackupex.use_memory`: [optional]: Specifies the amount of memory in bytes for `xtrabackup` to use for crash recovery while preparing a backup\n\n* `percona_server_tools_setup_slave_replication.master`: [required]: Master section\n* `percona_server_tools_setup_slave_replication.master.host`: [required]: Specifies the `MASTER_HOST`, needed to setup the replication, but also the pull backups from the master (`rsync` over `ssh`) (e.g. `{{ hostvars['db-01.example.com']['ansible_eth1']['ipv4']['address'] }}`)\n* `percona_server_tools_setup_slave_replication.master.user`: [required]: Specifies the `MASTER_USER` (e.g. `replicator`)\n* `percona_server_tools_setup_slave_replication.master.password`: [required]: Specifies the `MASTER_PASSWORD`\n\n* `percona_server_tools_setup_slave_replication.ssh_opts`: [optional]: SSH options (e.g. `['-o Ciphers=arcfour']`)\n\n##### Setup master replication (using `xtrabackup`)\n\nSets up master replication on one master from a healthy master. Assumes that the master is able to pull backups using `rsync` over `ssh`, so ssh (keys) need to be set up. Also assumes that there are **no writes on the (secondary) master** during the run of this playbook.\n\n**Notes**\n\n* Recommends using the `any_errors_fatal` [option](http://docs.ansible.com/ansible/playbooks_delegation.html#interrupt-execution-on-any-error) to interrupt execution on any error\n* Requires `master(1|2).user` to have both `GRANT REPLICATION SLAVE` and `REPLICATION CLIENT` grants\n\n- - -\n\n* `percona_server_tools_setup_master_replication.run`: [default: `false`]: Whether or not to run `setup-master-replication.yml`\n\n* `percona_server_tools_setup_master_replication.inventory.master1`: [required]: The inventory hostname of the (primary) master server (e.g. `db-01.example.com`)\n* `percona_server_tools_setup_master_replication.inventory.master2`: [required]: The inventory hostname of the (secondary) master server (e.g. `db-02.example.com`)\n\n* `percona_server_tools_setup_master_replication.innobackupex.user`: [optional]: Specifies the user (i.e., the MySQL username used when connecting to the server) to login as, if that's not the current user. It is passed to the `mysql` child process without alteration\n* `percona_server_tools_setup_master_replication.innobackupex.password`: [optional]: Specifies the password to use when connecting to the database. It is passed to the `mysql` child process without alteration\n* `percona_server_tools_setup_master_replication.innobackupex.parallel`: [optional]: Specifies the number of threads the `xtrabackup` child process should use to back up files concurrently\n* `percona_server_tools_setup_master_replication.innobackupex.rsync`: [optional]: Use the `rsync` utility to optimize local file transfers. When this option is specified, `innobackupex` uses `rsync` to copy all non-InnoDB files instead of spawning a separate `cp` for each file, which can be much faster for servers with a large number of databases or tables\n* `percona_server_tools_setup_master_replication.innobackupex.backup_dir`: [required]: Specifies the backup directory\n* `percona_server_tools_setup_master_replication.innobackupex.use_memory`: [optional]: Specifies the amount of memory in bytes for `xtrabackup` to use for crash recovery while preparing a backup\n\n* `percona_server_tools_setup_master_replication.master1.host`: [required]: Specifies the `MASTER_HOST` (on `master2`), needed to setup the replication, but also the pull backups from the master (`rsync` over `ssh`) (e.g. `{{ hostvars[percona_server_tools_setup_slave_replication_master]['ansible_eth1']['ipv4']['address'] }}`)\n* `percona_server_tools_setup_master_replication.master1.user`: [required]: Specifies the `MASTER_USER` (e.g. `replicator`)\n* `percona_server_tools_setup_master_replication.master1.password`: [required]: Specifies the `MASTER_PASSWORD`\n* `percona_server_tools_setup_master_replication.master2.host`: [required]: Specifies the `MASTER_HOST` (on `master1`), needed to setup the replication, but also the pull backups from the master (`rsync` over `ssh`) (e.g. `{{ hostvars[percona_server_tools_setup_slave_replication_master]['ansible_eth1']['ipv4']['address'] }}`)\n* `percona_server_tools_setup_master_replication.master2.user`: [default: `master1.user`]: Same as above\n* `percona_server_tools_setup_master_replication.master2.password`: [default: `master1.password`]: Same as above\n\n* `percona_server_tools_setup_master_replication.ssh_opts`: [optional]: SSH options (e.g. `['-o Ciphers=arcfour']`)\n\n## Dependencies\n\nNone\n\n## Recommended\n\n* `percona-client` ([see](https://github.com/Oefenweb/ansible-percona-client))\n* `percona-server` ([see](https://github.com/Oefenweb/ansible-percona-server))\n* `ssh-keys` ([see](https://github.com/Oefenweb/ansible-ssh-keys))\n\n#### Example(s)\n\n##### Reset root password\n\n```yaml\n---\n- hosts: all\n  roles:\n    - oefenweb.percona-server-tools\n  vars:\n    percona_server_tools_reset_root_password:\n      run: true\n      root_password: '6j~14F(Um~@nAz4hn6dT'\n```\n\n##### Resize InnoDB logs\n\n```yaml\n---\n- hosts: all\n  roles:\n    - oefenweb.percona-server-tools\n  vars:\n    percona_server_tools_reset_ib_logfile:\n      run: true\n```\n\n##### Setup slave replication\n\n```yaml\n---\n- hosts: all\n  roles:\n    - oefenweb.percona-server-tools\n  vars:\n    percona_server_tools_setup_slave_replication:\n      run: true\n      inventory:\n        master: db-01.example.com\n        slaves:\n          - db-02.example.com\n\n      innobackupex:\n        backup_dir: /tmp/xtrabackup\n\n      master:\n        host: \"{{ hostvars[percona_server_tools_setup_slave_replication_master]['ansible_eth1']['ipv4']['address'] }}\"\n        user: replicator\n        password: 'Z$8\u003eYM\"KUVRv6sW#=O-A'\n```\n\n##### Setup master replication\n\n```yaml\n---\n- hosts: all\n  roles:\n    - oefenweb.percona-server-tools\n  vars:\n    percona_server_tools_setup_master_replication:\n      run: true\n      inventory:\n        master1: db-01.example.com\n        master2: db-02.example.com\n\n      innobackupex:\n        backup_dir: /tmp/xtrabackup\n\n      master1:\n        host: \"{{ hostvars['db-01.example.com']['ansible_eth1']['ipv4']['address'] }}\"\n        user: replicator\n        password: 'Z$8\u003eYM\"KUVRv6sW#=O-A'\n      master2:\n        host: \"{{ hostvars['db-02.example.com']['ansible_eth1']['ipv4']['address'] }}\"\n```\n\n#### License\n\nMIT\n\n#### Author Information\n\nMischa ter Smitten\n\n#### Feedback, bug-reports, requests, ...\n\nAre [welcome](https://github.com/Oefenweb/ansible-percona-server-tools/issues)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foefenweb%2Fansible-percona-server-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foefenweb%2Fansible-percona-server-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foefenweb%2Fansible-percona-server-tools/lists"}