Add galera_data_dir variable
Control mysql datadir with variable. Decrease code dublication since path is heavily used in different places. If path needs to be changed overriding config won't be enough. Change-Id: I6fcefe216236ffea60da5fee42aad47c6f7da133
This commit is contained in:
parent
ebc0417919
commit
5884ee918e
@ -97,6 +97,7 @@ galera_root_user: root
|
||||
# WARNING: This option is deprecated and will be removed in v12.0
|
||||
galera_gcache_size: 1024M
|
||||
|
||||
galera_data_dir: /var/lib/mysql
|
||||
galera_max_heap_table_size: 32M
|
||||
galera_tmp_table_size: 32M
|
||||
galera_tmp_dir: /var/lib/mysql/#tmp
|
||||
|
5
releasenotes/notes/galera_data_dir-98c9606407532be0.yaml
Normal file
5
releasenotes/notes/galera_data_dir-98c9606407532be0.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
Implemented variable ``galera_data_dir`` that control datadir for MariaDB
|
||||
databases. Defaults to `/var/lib/mysql`.
|
@ -93,7 +93,7 @@
|
||||
- name: Run galera secure
|
||||
command: "/usr/local/bin/galera_secure_node"
|
||||
args:
|
||||
creates: "/var/lib/mysql/osa_default_secured"
|
||||
creates: "{{ galera_data_dir }}/osa_default_secured"
|
||||
warn: no
|
||||
when:
|
||||
- ansible_facts['pkg_mgr'] != "apt"
|
||||
@ -110,7 +110,7 @@
|
||||
mode: "{{ item.mode|default('0755') }}"
|
||||
recurse: "{{ item.recurse|default('false') }}"
|
||||
with_items:
|
||||
- { path: "/var/lib/mysql", owner: "mysql", mode: "02755" }
|
||||
- { path: "{{ galera_data_dir }}", owner: "mysql", mode: "02755" }
|
||||
- { path: "{{ galera_tmp_dir }}", owner: "mysql", mode: "02755" }
|
||||
- { path: "/etc/mysql/conf.d" }
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
# need to wait for it to finish to avoid race conditions
|
||||
- name: Wait for MySQL Upgrade to finish
|
||||
wait_for:
|
||||
path: /var/lib/mysql/mysql_upgrade_info
|
||||
path: "{{ galera_data_dir }}/mysql_upgrade_info"
|
||||
search_regex: "^{{ galera_major_version }}.{{ galera_minor_version }}"
|
||||
|
||||
# NOTE(noonedeadpunk): We don't need to verify hostname when connectig to socket
|
||||
|
@ -43,4 +43,4 @@ fi
|
||||
|
||||
# Create a marker file to ensure this script is not run again
|
||||
systemctl unset-environment MYSQLD_OPTS
|
||||
touch "/var/lib/mysql/osa_default_secured"
|
||||
touch "{{ galera_data_dir }}/osa_default_secured"
|
||||
|
@ -27,7 +27,7 @@ user = mysql
|
||||
collation-server = utf8_general_ci
|
||||
init-connect = 'SET NAMES utf8'
|
||||
character-set-server = utf8
|
||||
datadir = /var/lib/mysql
|
||||
datadir = {{ galera_data_dir }}
|
||||
tmpdir = {{ galera_tmp_dir }}
|
||||
ignore_db_dirs = {{ galera_ignore_db_dirs | join(',') }}
|
||||
|
||||
@ -45,8 +45,8 @@ ssl-key = {{ galera_ssl_key }}
|
||||
# LOGGING #
|
||||
log-queries-not-using-indexes = {{ galera_unindexed_query_logging }}
|
||||
slow-query-log = {{ galera_slow_query_logging }}
|
||||
log-bin = /var/lib/mysql/mariadb-bin
|
||||
log-bin-index = /var/lib/mysql/mariadb-bin.index
|
||||
log-bin = {{ galera_data_dir }}/mariadb-bin
|
||||
log-bin-index = {{ galera_data_dir }}/mariadb-bin.index
|
||||
expire-logs-days = 7
|
||||
log_slave_updates = 1
|
||||
log_bin_trust_function_creators = 1
|
||||
|
@ -36,7 +36,7 @@ galera_server_required_distro_packages:
|
||||
|
||||
galera_etc_conf_file: "/etc/mysql/my.cnf"
|
||||
galera_etc_include_dir: "/etc/mysql/conf.d"
|
||||
galera_var_run_socket: "/var/lib/mysql/mysql.sock"
|
||||
galera_var_run_socket: "{{ galera_data_dir }}/mysql.sock"
|
||||
|
||||
_galera_mariadb_server_package: "MariaDB-server"
|
||||
|
||||
@ -74,4 +74,4 @@ galera_client_distro_packages:
|
||||
galera_devel_distro_packages:
|
||||
- MariaDB-devel
|
||||
|
||||
galera_unix_socket: "/var/lib/mysql/mysql.sock"
|
||||
galera_unix_socket: "{{ galera_data_dir }}/mysql.sock"
|
||||
|
Loading…
Reference in New Issue
Block a user