diff --git a/README.md b/README.md index 6b6a716..20f959d 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ Whether the global my.cnf should be overwritten each time this role is run. Sett mysql_config_include_files: [] -A list of files that should override the default global my.cnf. Each item in the array requires a "src" parameter which is a path to a file. An optional "force" parameter can force the file to be updated each time ansible runs. +A list of files that should override the default global my.cnf. Each item in the array requires a "src" parameter which is a path to a file. An optional "force" parameter can force the file to be updated each time ansible runs. mysql_databases: [] diff --git a/defaults/main.yml b/defaults/main.yml index 69bb143..5987d8e 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -71,10 +71,8 @@ mysql_log_error: /var/log/mysql.err mysql_syslog_tag: mysql mysql_config_include_files: [] -# Full example: -# mysql_config_include_files: -# - src: path/relative/to/playbook/file.cnf -# - { src: path/relative/to/playbook/anotherfile.cnf, force: yes } +# - src: path/relative/to/playbook/file.cnf +# - { src: path/relative/to/playbook/anotherfile.cnf, force: yes } # Databases. diff --git a/tasks/configure.yml b/tasks/configure.yml index c0ccd5b..493152a 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -16,7 +16,7 @@ owner: root group: root mode: 0755 - when: mysql_config_include_files|length + when: mysql_config_include_files | length - name: Copy my.cnf override files into include directory. template: @@ -25,7 +25,7 @@ owner: root group: root mode: 0644 - force: "{{ item.force|default(False) }}" + force: "{{ item.force | default(False) }}" with_items: mysql_config_include_files notify: restart mysql diff --git a/templates/my.cnf.j2 b/templates/my.cnf.j2 index c16c5ab..ed9c766 100644 --- a/templates/my.cnf.j2 +++ b/templates/my.cnf.j2 @@ -97,9 +97,10 @@ max_allowed_packet = {{ mysql_mysqldump_max_allowed_packet }} [mysqld_safe] pid-file = {{ mysql_pid_file }} -{% if mysql_config_include_files|length %} +{% if mysql_config_include_files | length %} # * IMPORTANT: Additional settings that can override those from this file! # The files must end with '.cnf', otherwise they'll be ignored. # !includedir {{ mysql_config_include_dir }} -{% endif %} \ No newline at end of file +{% endif %} +