Skip to content

Commit

Permalink
Merge pull request #12 from inmotionhosting/innodb
Browse files Browse the repository at this point in the history
templating innodb mysql vars
  • Loading branch information
creesb committed Mar 15, 2022
2 parents d0eb519 + 78a24b3 commit 840ce90
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
8 changes: 8 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,11 @@ mysql_packages:
#

password_generate: "{{ lookup('password', '/dev/null length=15 chars=ascii_letters') }}"

#
# InnoDB Variables
#
mysql_innodb_file_per_table: 1
mysql_innodb_buffer_pool_size: 128MB
mysql_innodb_log_buffer_size: 16MB
mysql_innodb_log_file_size: 96MB
9 changes: 9 additions & 0 deletions tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,12 @@
when:
- mysql_slow_query_log_enabled is defined
- mysql_slow_query_log_enabled|bool

- name: Configre MySQL InnoDB Settings
template:
src: etc/my.cnf.d/innodb.cnf.j2
dest: "{{ mysql_config_include_dir }}/innodb.cnf"
owner: root
group: root
mode: "0644"
notify: restart mysql
7 changes: 7 additions & 0 deletions templates/etc/my.cnf.d/innodb.cnf.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# {{ ansible_managed }}
# INNODB OPTIONS
[mysqld]
innodb_file_per_table = {{ mysql_innodb_file_per_table }}
innodb_buffer_pool_size = {{ mysql_innodb_buffer_pool_size }}
innodb_log_buffer_size = {{ mysql_innodb_log_buffer_size }}
innodb_log_file_size = {{ mysql_innodb_log_file_size }}

0 comments on commit 840ce90

Please sign in to comment.