{"id":27088992,"url":"https://github.com/devops-works/ansible-backup-mysql","last_synced_at":"2025-09-01T06:37:01.467Z","repository":{"id":98717829,"uuid":"423104398","full_name":"devops-works/ansible-backup-mysql","owner":"devops-works","description":"Bbackup MySQL \u0026 friends using mysqldump, with optional encryption \u0026 object storage offload","archived":false,"fork":false,"pushed_at":"2021-10-31T10:34:45.000Z","size":18,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-06T06:37:55.772Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devops-works.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-31T09:30:23.000Z","updated_at":"2021-10-31T15:09:00.000Z","dependencies_parsed_at":"2023-05-24T22:30:18.828Z","dependency_job_id":null,"html_url":"https://github.com/devops-works/ansible-backup-mysql","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/devops-works/ansible-backup-mysql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devops-works%2Fansible-backup-mysql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devops-works%2Fansible-backup-mysql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devops-works%2Fansible-backup-mysql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devops-works%2Fansible-backup-mysql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devops-works","download_url":"https://codeload.github.com/devops-works/ansible-backup-mysql/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devops-works%2Fansible-backup-mysql/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265445806,"owners_count":23766577,"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":[],"created_at":"2025-04-06T06:37:13.268Z","updated_at":"2025-07-15T16:42:38.444Z","avatar_url":"https://github.com/devops-works.png","language":"Shell","readme":"# MySQL backup role\n\nThis role adds a cron to backup MySQL \u0026 friends using mysqldump.\n\nOptionally encrypts backups using provided GPG keys.\n\nOptionally copies backups to object storage (S3 or GCS).\n\n## Requirements\n\n- `mysqldump` must be present on the system.\n- [influxevent](https://github.com/devops-works/ansible-influxevent) must be\n  installed if metrology is used \n\n## Role Variables\n\n- `backup_mysql_exclude` (default: \"\"): `grep` exclude pattern for databases\n- `backup_mysql_keep` (default: 30): how many backups do we keep locally\n- `backup_mysql_s3bucket` (default: \"\"): S3 bucket to export backups to\n- `backup_mysql_gcloudbucket` (default: \"\"): GCS bucket to export backups to\n- `backup_mysql_destination` (default: \"/var/backups/mysql/\"): path to store\n  local backups in\n- `backup_mysql_cron_time` (default: \"15 */2 * * 0-7\"): cron entry for\n  backups\n- `backup_mysql_gpg_keys` (default: []): list of gpg keys URLS to\n  encrypt backups for\n- `backup_mysql_user`: backup user\n- `backup_mysql_password`: backup password\n\n## Encryption\n\nIf `backup_mysql_gpg_keys` is populated with GPG keys URLs, backups will\nbe encrypted for those keys. When no keys are provided, backup will not be\nencrypted.\n\nIf encryption is used, **only encrypted backups will be pushed to object\nstorage**.\n\nIf encryption is not used, **unencrypted backups will be pushed to object\nstorage**.\n\nEach object in the `backup_mysql_gpg_keys` list must have an `id` and a `url`\nattribute:\n\n```\nmariadb_backup_gpg_keys:\n  - url: https://gitlab.com/alice.gpg\n    id: AAAA40FC29B8AAAA\n  - url: https://gitlab.com/bob.gpg\n    id: BBBBE221A5D7BBBB\n```\n\n## Object storage\n\nBuckets must be set in `backup_mysql_s3bucket` or `backup_mysql_gcloudbucket`\nif you want to offload backups to object storage.\n\nThis role expects objects storage to be already setup if you intend to use it.\n`s3cmd` and `gsutil` are used respectively for AWS S3 and GCS.\n\nSee [ansible-gcloud](https://github.com/devops-works/ansible-gcloud) for GCS.\n\nFor GCS, we recomment configuring the bucket with:\n\n- a lifecycle policy to expunge old backups (see Lifecycle in bucket settings)\n- a retention policy to ensure backup immutability (see Protction in bucket\n  settings)\n\n## Metrology support\n\nIf `backup_mysql_influxevent` and `telegraf_output_influxdb` are set, the role\nwill use [`influxevent`](https://gitlab.com/devopsworks/tools/influxevent) to\nsend backup events to an influxdb server.\n\nInfluxEvent must be installed if you intend to use it (see\nhttps://github.com/devops-works/ansible-influxevent).\n\nThe following variables are required:\n\n- `telegraf_output_influxdb.database`\n- `telegraf_output_influxdb.urls`\n- `telegraf_output_influxdb.username`\n- `telegraf_output_influxdb.password`\n\nSee https://github.com/devops-works/ansible-telegraf#variables for more\ninformation on those vars.\n\n## Dependencies\n\nNone\n\n## Warning\n\nTry this role many times and ensure it fits your needs before using it for\nproduction...\n\n## License\n\nMIT\n\n## Author Information\n\n[@devops-works](https://github.com/devops-works)\n\nPatches welcome!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevops-works%2Fansible-backup-mysql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevops-works%2Fansible-backup-mysql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevops-works%2Fansible-backup-mysql/lists"}