Coder Social home page Coder Social logo

mysql's Introduction

ANXS - MySQL Build Status

Ansible role that installs MySQL on (for now) Ubuntu variants. Features include:

  • Installation of MySQL and it's dependencies
  • Basic configuration
  • Standard hardening (root password, removal of test databases)
  • Add databases
  • Add users
  • Setup of monit process supervision

Requirements & Dependencies

  • Tested on Ansible 1.4 or higher.
  • ANXS.monit if you want monit protection (in that case, you should set monit_protection: true)

Variables

# Basic settings
mysql_port: 3306                        # The port on which mysql listens
mysql_bind_address: '0.0.0.0'           # The address the mysql server binds on
mysql_root_password: ''                 # The new root password
mysql_default_root_password: ''         # The root password
mysql_ppa: ''                           # Install MySQL from PPA repository
mysql_apt_key: ''

# Fine Tuning
mysql_key_buffer: '16M'
mysql_max_allowed_packet: '128M'
mysql_thread_stack: '192K'
mysql_cache_size: 8
mysql_myisam_recover: 'BACKUP'
mysql_max_connections: 100
mysql_table_cache: 64
mysql_thread_concurrency: 10
mysql_query_cache_limit: '1M'
mysql_query_cache_size: '16M'
mysql_character_set_server: 'utf8'
mysql_collation_server: 'utf8_general_ci'
mysql_mysqldump_max_allowed_packet: '128M'
mysql_isamchk_key_buffer: '16M'

# InnoDB tuning
mysql_innodb_file_per_table: 'innodb_file_per_table'
mysql_innodb_flush_method: 'fdatasync'
mysql_innodb_buffer_pool_size: '128M'
mysql_innodb_flush_log_at_trx_commit: 1
mysql_innodb_lock_wait_timeout: 50
mysql_innodb_log_buffer_size: '1M'
mysql_innodb_log_file_size: '5M'

# List of databases to be created (optional)
mysql_databases:
  - name: foobar
    collation: "utf8_general_ci"        # optional, defaults to "utf8_general_ci"
    encoding: "utf8"                    # optional, defaults to "utf8"

# List of users to be created (optional)
mysql_users:
  - name: baz
    pass: pass
    priv: "*.*:ALL"                     # optional, defaults to "*.*:ALL"
    host: "%"                           # optional, defaults to "localhost"

# GLOBAL Setting
monit_protection: false                 # true or false, requires ANXS.monit

# List of apt packages to install
mysql_packages:
  - mysql-server
  - mysql-client
  - python-mysqldb

Setting/Updating the root Password

If You would like to change your mysql root password using this role, ensure you use the following variables in your play:

mysql_default_root_password: <Your current root password>
mysql_root_password: <Your new root password>

Testing

This project comes with a VagrantFile, this is a fast and easy way to test changes to the role, fire it up with vagrant up, provision the box with either:

vagrant provision

This also happens automatically after the first vagrant up, or:

ansible-playbook test.yml -i vagrant-inventory --sudo

This is the ansible way, and will easily allow command line arguments like --tags and -e

See vagrant docs for getting setup with vagrant

License

Licensed under the MIT License. See the LICENSE file for details.

Feedback, bug-reports, requests, ...

Are welcome!

mysql's People

Contributors

pjan avatar soupdiver avatar otakup0pe avatar ajsalminen avatar tinnet avatar ahelal avatar budlight avatar bhcopeland avatar lepture avatar retr0h avatar maximethoonsen avatar oskarpearson avatar nbz4live avatar zealot128 avatar

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.