Giter Site home page Giter Site logo

ansible-role-mysql's Introduction

Ansible Role: mysql

Install and configure MySQL or MariaDB server on RHEL/CentOS.

Requirements

Replication configuration

System Firewall must disabled or open mysql port default is 3306.

Role Variables

defaults/main.yml

  • mysql_root_username: root
  • mysql_root_password: root
  • mysql_character: ""
  • mysql_port: 3306
  • mysql_bind_address: 0.0.0.0
  • mysql_datadir: "/var/lib/mysql"
  • mysql_max_connections: "700"
  • mysql_max_connect_errors: "1844674407370954751"
  • mysql_key_buffer_size: "256M"
  • mysql_max_allowed_packet: "1M"
  • mysql_table_open_cache: "256"
  • mysql_sort_buffer_size: "1M"
  • mysql_read_buffer_size: "1M"
  • mysql_read_rnd_buffer_size: "4M"
  • mysql_myisam_sort_buffer_size: "64M"
  • mysql_thread_cache_size: "8"
  • mysql_query_cache_size: "16M"
  • mysql_thread_concurrency: 8
  • mysql_wait_timeout: "28800"
  • mysql_log_bin: "mysql-bin"
  • mysql_log_bin_index: "mysql-bin.index"
  • mysql_binlog_format: "mixed"
  • mysql_relay_log: "mysql-relay-bin"
  • mysql_relay_log_index: "mysql-relay-bin.index"
  • mysql_innodb_data_home_dir: "{{ mysql_datadir }}"
  • mysql_innodb_data_file_path: "ibdata1:10M:autoextend"
  • mysql_innodb_log_group_home_dir: "{{ mysql_datadir }}"
  • mysql_innodb_buffer_pool_size: "2048M"
  • mysql_innodb_additional_mem_pool_size: "20M"
  • mysql_innodb_log_file_size: "512M"
  • mysql_innodb_log_buffer_size: "8M"
  • mysql_innodb_flush_log_at_trx_commit: "1"
  • mysql_innodb_lock_wait_timeout: "50"
  • mysql_innodb_extra: ""
  • mysql_mysqldump_max_allowed_packet: "16M"
  • mysql_myisamchk_key_buffer_size: "256M"
  • mysql_myisamchk_sort_buffer_size: "256M"
  • mysql_myisamchk_read_buffer: "2M"
  • mysql_myisamchk_write_buffer: "2M"
  • mysql_users: []
  • mysql_replication_role: ""
  • mysql_server_id: "1"
  • mysql_slave_server_id: "2"
  • mysql_replication_master: ""
  • mysql_replication_user: []
  • mysql_character: ""
  • mysql_extra: ""

RedHat6 to see vars/redhat-6.yml

RedHat7 to see vars/redhat-7.yml

Dependencies

None.

Example Playbook

- name: Install MySQL server.
  hosts: mysql
  vars:
    mysql_root_username: root
    mysql_root_password: root
    mysql_users:
      - { name: "root", host: "%", password: "root", priv: "*.*:GRANT,ALL" }
    mysql_innodb_extra:
      innodb_rollback_on_timeout: 1
    mysql_datadir: "/data/mysql"
    mysql_character: "utf8"
    mysql_extra:
      log_bin_trust_function_creators: 1
  roles:
    - ansible-role-mysql

Author Information

z

ansible-role-mysql's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

ansible-role-mysql's Issues

Error while starting the mariadb service

Hello,

We are encountering the error when we execute the playbook. Please find the complete execution below.

$% sudo ansible-playbook -c local test.yml

PLAY [Install MariaDB server On CentOS7] ***************************************

TASK [setup] *******************************************************************
ok: [blrrndprfdb01]

TASK [ansible-role-mysql : Include OS-specific variables.] *********************
ok: [blrrndprfdb01]

TASK [ansible-role-mysql : Ensure MySQL Python libraries are installed.] *******
ok: [blrrndprfdb01]

TASK [ansible-role-mysql : Ensure MySQL packages are installed.] ***************
ok: [blrrndprfdb01] => (item=[u'mariadb', u'mariadb-server', u'mariadb-libs'])

TASK [ansible-role-mysql : Ensuer MySQL Datadir is exists.] ********************
changed: [blrrndprfdb01]

TASK [ansible-role-mysql : Copy my.cnf global MySQL configuration.] ************
ok: [blrrndprfdb01]

TASK [ansible-role-mysql : Ensure MySQL is started and enabled on boot.] *******
fatal: [blrrndprfdb01]: FAILED! => {"changed": false, "failed": true, "msg": "Unable to start service mariadb: Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.\n"}
to retry, use: --limit @/etc/ansible/ansible-role-mysql/test.retry

Can you help us resolve this issue ?

Regards,
Bharath Singh

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.