From 0d0e4ca39f8d747d37f5bfcaa1483088de8d65b0 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Tue, 2 Jul 2019 10:41:41 +0200 Subject: [PATCH] mysql: disable reverse name resolution by default. --- library/roles/mysql/defaults/main.yml | 3 ++- library/roles/mysql/templates/server.cnf.j2 | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/library/roles/mysql/defaults/main.yml b/library/roles/mysql/defaults/main.yml index a0764d0e..53c186ca 100644 --- a/library/roles/mysql/defaults/main.yml +++ b/library/roles/mysql/defaults/main.yml @@ -34,10 +34,11 @@ mysql_db_innodb_log_file_size: 64M mysql_db_innodb_log_buffer_size: 9M mysql_safe_open_files_limit: 1024 mysql_max_allowed_packet: 16M +mysql_skip_name_resolve: True mysql_listen_on_ext_int: False #mysql_db_data: -# - { name: '{{ mysql_db_name }}', collation: '{{ mysql_default_collation }}', encoding: '{{ mysql_default_encoding }}', user: '{{ mysql_db_user }}', pwd: '{{ mysql_db_pwd }}', user_grant: 'ALL', allowed_hosts: [ 'localhost', 'yyy.yyy.yyy.yyy/32' ] } +# - { name: '{{ mysql_db_name }}', collation: '{{ mysql_default_collation }}', encoding: '{{ mysql_default_encoding }}', user: '{{ mysql_db_user }}', pwd: '{{ mysql_db_pwd }}', user_grant: 'ALL', allowed_hosts: [ 'localhost', 'yyy.yyy.yyy.yyy/32', 'yyy.yyy.yyy.yyy' ] } mysql_backup_use_nagios: False mysql_backup_logdir: '{{ mysql_log_dir }}' diff --git a/library/roles/mysql/templates/server.cnf.j2 b/library/roles/mysql/templates/server.cnf.j2 index 344d04fb..6606ab03 100644 --- a/library/roles/mysql/templates/server.cnf.j2 +++ b/library/roles/mysql/templates/server.cnf.j2 @@ -16,6 +16,9 @@ net_buffer_length = 8K read_buffer_size = {{ mysqld_db_read_buffer_size }} read_rnd_buffer_size = {{ mysql_db_read_rnd_buffer_size }} myisam_sort_buffer_size = 16M +{% if mysql_skip_name_resolve %} +skip-name-resolve +{% endif %} {% if mysqld_sql_mode is defined %} sql_mode = {{ mysqld_sql_mode }}