From 931f3c74a78774f319acfb6867ff9742b9b46e3d Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Tue, 16 Feb 2021 21:15:10 +0200 Subject: [PATCH] Configure my.cnf for server when galera_root_user is not root When galera_root_user is set to non-root user current behaviour is to place my.cnf file as a part of the server setup, however this non-root user is not created yet. User creation is handled after server proper bootstrap and handlers flush. Having my.cnf file in place makes bootstrap script fail, since it tries to use credentials from this file which are not valid yet. Instead we allow client part of the role to configure my.cnf on metal deployments and set galera_root_user credentials in it once user is properly created Change-Id: I88edfe87fd134bdbcf199a48443fc063740a8604 --- tasks/galera_server_post_install.yml | 1 + tasks/main.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tasks/galera_server_post_install.yml b/tasks/galera_server_post_install.yml index 175f3652..8a3e63b2 100644 --- a/tasks/galera_server_post_install.yml +++ b/tasks/galera_server_post_install.yml @@ -124,6 +124,7 @@ config_overrides: "{{ galera_client_my_cnf_overrides }}" config_type: "ini" mode: "0600" + condition: "{{ (galera_root_user == 'root') }}" notify: - Manage LB - Restart all mysql diff --git a/tasks/main.yml b/tasks/main.yml index 3c4df25f..186f897c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -27,7 +27,7 @@ - include_tasks: galera_client_main.yml when: - galera_install_client | bool - - inventory_hostname not in galera_cluster_members + - inventory_hostname not in galera_cluster_members or galera_root_user != 'root' - include_tasks: galera_server_main.yml when: