Skip to content

pantarei/ansible-role-mysql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ansible Role for MySQL

Build Status GitHub tag GitHub license

Ansible Role for MySQL Installation.

Requirements

This role require Ansible 2.0 or higher.

This role was designed for Ubuntu Server 14.04 LTS and Ubuntu Server 16.04 LTS.

Role Variables

parameter required default choices comments
mysql_root_pass yes Default mysql root user password.
mysql_root_user yes root Default mysql root user name.
mysql_basedir yes /usr The path to the MySQL installation directory.
mysql_bind_address yes 0.0.0.0 The MySQL server listens on a single network socket for TCP/IP connections.
mysql_datadir yes /var/lib/mysql The path to the MySQL data directory.
mysql_expire_logs_days yes 16 The number of days for automatic binary log file removal.
mysql_innodb_autoinc_lock_mode yes 2
  • 0
  • 1
  • 2
The lock mode to use for generating auto-increment values.
mysql_innodb_buffer_pool_size yes 256M The size in bytes of the buffer pool, the memory area where InnoDB caches table and index data.
mysql_innodb_doublewrite yes 1 If this variable is enabled (the default), InnoDB stores all data twice, first to the doublewrite buffer, then to the actual data files.
mysql_innodb_file_format yes barracuda The file format to use for new InnoDB tables. Currently, Antelope and Barracuda are supported.
mysql_innodb_file_per_table yes 1 When innodb_file_per_table is enabled (the default in 5.6.6 and higher), InnoDB stores the data and indexes for each newly created table in a separate .ibd file, rather than in the system tablespace.
mysql_innodb_flush_log_at_trx_commit yes 2 Controls the balance between strict ACID compliance for commit operations, and higher performance that is possible when commit-related I/O operations are rearranged and done in batches.
mysql_innodb_large_prefix yes 1 When this option is enabled, index key prefixes longer than 767 bytes (up to 3072 bytes) are allowed for InnoDB tables that use the DYNAMIC and COMPRESSED row formats.
mysql_innodb_locks_unsafe_for_binlog yes 1 This variable affects how InnoDB uses gap locking for searches and index scans.
mysql_key_buffer_size yes 256M Index blocks for MyISAM tables are buffered and are shared by all threads.
mysql_lc_messages_dir yes /usr/share/mysql The directory where error messages are located.
mysql_log_error yes /var/log/mysql/error.log The location of the error log, or empty if the server is writing error message to the standard error output.
mysql_max_allowed_packet yes 128M The maximum size of one packet or any generated/intermediate string, or any parameter sent by the mysql_stmt_send_long_data() C API function.
mysql_max_binlog_size yes 128M If a write to the binary log causes the current log file size to exceed the value of this variable, the server rotates the binary logs (closes the current file and opens the next one).
mysql_max_connections yes 128 The maximum permitted number of simultaneous client connections.
mysql_myisam_recover_options yes BACKUP
  • OFF
  • DEFAULT
  • BACKUP
  • FORCE
  • QUICK
Set the MyISAM storage engine recovery mode.
mysql_nice yes 0 Use the nice program to set the server's scheduling priority to the given value.
mysql_pid_file yes /var/run/mysqld/mysqld.pid The path name of the process ID file.
mysql_port yes 3306 The port number that the server should use when listening for TCP/IP connections.
mysql_query_cache_limit yes 8M Do not cache results that are larger than this number of bytes.
mysql_query_cache_size yes 32M The amount of memory allocated for caching query results.
mysql_socket yes /var/run/mysqld/mysqld.sock On Unix platforms, this variable is the name of the socket file that is used for local client connections.
mysql_table_open_cache yes 512 The number of open tables for all threads.
mysql_thread_cache_size yes 8 How many threads the server should cache for reuse.
mysql_thread_stack yes 256K The stack size for each thread.
mysql_tmpdir yes /tmp The path of the directory to use for creating temporary files.
mysql_user yes mysql Run the mysqld server as the user having the name user_name or the numeric user ID user_id.

Dependencies

No additional role dependencies.

Example Playbook

- hosts: all
  roles:
    - role: hswong3i.mysql

License

Author Information

About

Ansible Role for MySQL Installation.

Resources

License

Stars

Watchers

Forks

Packages

No packages published