{"id":19402201,"url":"https://github.com/robertdebock/ansible-role-mysql","last_synced_at":"2025-04-24T07:31:27.475Z","repository":{"id":41309097,"uuid":"115251830","full_name":"robertdebock/ansible-role-mysql","owner":"robertdebock","description":"Install and configure mysql on your system.","archived":false,"fork":false,"pushed_at":"2025-03-06T16:12:55.000Z","size":384,"stargazers_count":17,"open_issues_count":0,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-20T10:16:41.200Z","etag":null,"topics":["ansible","database","installer","mariadb","molecule","mysql","package","playbook","tox"],"latest_commit_sha":null,"homepage":"https://robertdebock.nl/","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robertdebock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"robertdebock"}},"created_at":"2017-12-24T09:07:22.000Z","updated_at":"2025-03-06T15:57:36.000Z","dependencies_parsed_at":"2023-02-15T07:46:11.805Z","dependency_job_id":"9f2c69bc-ecd4-47ac-b690-33a3abfeb603","html_url":"https://github.com/robertdebock/ansible-role-mysql","commit_stats":null,"previous_names":[],"tags_count":87,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdebock%2Fansible-role-mysql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdebock%2Fansible-role-mysql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdebock%2Fansible-role-mysql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdebock%2Fansible-role-mysql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robertdebock","download_url":"https://codeload.github.com/robertdebock/ansible-role-mysql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250582885,"owners_count":21453924,"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","database","installer","mariadb","molecule","mysql","package","playbook","tox"],"created_at":"2024-11-10T11:22:31.911Z","updated_at":"2025-04-24T07:31:27.463Z","avatar_url":"https://github.com/robertdebock.png","language":"Jinja","funding_links":["https://github.com/sponsors/robertdebock"],"categories":[],"sub_categories":[],"readme":"# [Ansible role mysql](#mysql)\n\nInstall and configure mysql on your system.\n\n|GitHub|GitLab|Downloads|Version|\n|------|------|---------|-------|\n|[![github](https://github.com/robertdebock/ansible-role-mysql/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-mysql/actions)|[![gitlab](https://gitlab.com/robertdebock-iac/ansible-role-mysql/badges/master/pipeline.svg)](https://gitlab.com/robertdebock-iac/ansible-role-mysql)|[![downloads](https://img.shields.io/ansible/role/d/robertdebock/mysql)](https://galaxy.ansible.com/robertdebock/mysql)|[![Version](https://img.shields.io/github/release/robertdebock/ansible-role-mysql.svg)](https://github.com/robertdebock/ansible-role-mysql/releases/)|\n\n## [Example Playbook](#example-playbook)\n\nThis example is taken from [`molecule/default/converge.yml`](https://github.com/robertdebock/ansible-role-mysql/blob/master/molecule/default/converge.yml) and is tested on each push, pull request and release.\n\n```yaml\n---\n- name: Converge\n  hosts: all\n  become: true\n  gather_facts: true\n\n  roles:\n    - role: robertdebock.mysql\n      mysql_port: 3307\n      mysql_databases:\n        - name: my_db\n          encoding: utf8\n          collation: utf8_bin\n        # - name: my_imported_db\n        #   # This file will be imported once at creation of the database.\n        #   initial_import: /path/to/dump.sql  # .gz or also allowed.\n      mysql_users:\n        - name: my_user\n          password: my_pass\n          priv: \"my_db.*:ALL\"\n          update_password: on_create\n```\n\nThe machine needs to be prepared. In CI this is done using [`molecule/default/prepare.yml`](https://github.com/robertdebock/ansible-role-mysql/blob/master/molecule/default/prepare.yml):\n\n```yaml\n---\n- name: Prepare\n  hosts: all\n  become: true\n  gather_facts: false\n\n  roles:\n    - role: robertdebock.bootstrap\n```\n\nAlso see a [full explanation and example](https://robertdebock.nl/how-to-use-these-roles.html) on how to use these roles.\n\n## [Role Variables](#role-variables)\n\nThe default values for the variables are set in [`defaults/main.yml`](https://github.com/robertdebock/ansible-role-mysql/blob/master/defaults/main.yml):\n\n```yaml\n---\n# defaults file for mysql\n\n# The address mysql should bind to.\nmysql_bind_address: \"127.0.0.1\"\n\n# The port to listen on.\nmysql_port: 3306\n\n# The password to set for the root user. Also stored in my.cnf\nmysql_root_password: \"s3Cur31t4.\"\n\n# The buffer pool size.\nmysql_innodb_buffer_pool_size: 1G\n\n# The io capacity.\nmysql_innodb_io_capacity: 4000\n\n# You can set the mysql(d) options here.\n# As this is a list, it's difficult to merge with another list.\n# This means you'd have to redefine the entire list and append\n# your options to it.\nmysql_configuration_options:\n  - option: bind-address\n    section: mysqld\n    value: \"{{ mysql_bind_address }}\"\n  - option: port\n    section: mysqld\n    value: \"{{ mysql_port }}\"\n  - option: socket\n    section: mysqld\n    value: \"{{ mysql_socket }}\"\n  - section: mysqld\n    option: innodb_buffer_pool_size\n    value: \"{{ mysql_innodb_buffer_pool_size }}\"\n  - section: mysqld\n    option: innodb_io_capacity\n    value: \"{{ mysql_innodb_io_capacity }}\"\n  - section: mysqld\n    option: log-bin-trust-function-creators\n    value: \"1\"\n```\n\n## [Requirements](#requirements)\n\n- pip packages listed in [requirements.txt](https://github.com/robertdebock/ansible-role-mysql/blob/master/requirements.txt).\n\n## [State of used roles](#state-of-used-roles)\n\nThe following roles are used to prepare a system. You can prepare your system in another way.\n\n| Requirement | GitHub | GitLab |\n|-------------|--------|--------|\n|[robertdebock.bootstrap](https://galaxy.ansible.com/robertdebock/bootstrap)|[![Build Status GitHub](https://github.com/robertdebock/ansible-role-bootstrap/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-bootstrap/actions)|[![Build Status GitLab](https://gitlab.com/robertdebock-iac/ansible-role-bootstrap/badges/master/pipeline.svg)](https://gitlab.com/robertdebock-iac/ansible-role-bootstrap)|\n\n## [Context](#context)\n\nThis role is a part of many compatible roles. Have a look at [the documentation of these roles](https://robertdebock.nl/) for further information.\n\nHere is an overview of related roles:\n![dependencies](https://raw.githubusercontent.com/robertdebock/ansible-role-mysql/png/requirements.png \"Dependencies\")\n\n## [Compatibility](#compatibility)\n\nThis role has been tested on these [container images](https://hub.docker.com/u/robertdebock):\n\n|container|tags|\n|---------|----|\n|[Debian](https://hub.docker.com/r/robertdebock/debian)|bullseye|\n|[EL](https://hub.docker.com/r/robertdebock/enterpriselinux)|9|\n|[Fedora](https://hub.docker.com/r/robertdebock/fedora)|all|\n|[Ubuntu](https://hub.docker.com/r/robertdebock/ubuntu)|noble, jammy|\n\nThe minimum version of Ansible required is 2.12, tests have been done to:\n\n- The previous version.\n- The current version.\n- The development version.\n\nIf you find issues, please register them in [GitHub](https://github.com/robertdebock/ansible-role-mysql/issues).\n\n## [License](#license)\n\n[Apache-2.0](https://github.com/robertdebock/ansible-role-mysql/blob/master/LICENSE).\n\n## [Author Information](#author-information)\n\n[robertdebock](https://robertdebock.nl/)\n\nPlease consider [sponsoring me](https://github.com/sponsors/robertdebock).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertdebock%2Fansible-role-mysql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobertdebock%2Fansible-role-mysql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertdebock%2Fansible-role-mysql/lists"}