From fa539a4ac8ce62c5f3124632a7b7fa48726ec97d Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Mon, 14 Sep 2015 18:46:57 -0500 Subject: [PATCH] adds the config_template to galera_server The change modifies the galera_server template tasks such that it's now using the config_template action plugin. This change will make so that config files can be dynamically updated, by a deployer, at run time, without requiring the need to modify the in tree templates or defaults. Partially implements: blueprint tunable-openstack-configuration Change-Id: I6f34dff6e3a8ab8d2aad6a413b9a59f325c1be7b --- .../roles/galera_server/defaults/main.yml | 5 ++++ .../tasks/galera_post_install.yml | 28 +++++++++++++++++-- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/playbooks/roles/galera_server/defaults/main.yml b/playbooks/roles/galera_server/defaults/main.yml index 06858bddbb..5b499e7ddc 100644 --- a/playbooks/roles/galera_server/defaults/main.yml +++ b/playbooks/roles/galera_server/defaults/main.yml @@ -104,3 +104,8 @@ galera_debconf_items: # Galera slow/unindexed query logging galera_slow_query_logging: 0 galera_unindexed_query_logging: 0 + +## Tunable overrides +galera_my_cnf_overrides: {} +galera_cluster_cnf_overrides: {} +galera_debian_cnf_overrides: {} diff --git a/playbooks/roles/galera_server/tasks/galera_post_install.yml b/playbooks/roles/galera_server/tasks/galera_post_install.yml index dcdbc31020..3d24245c8d 100644 --- a/playbooks/roles/galera_server/tasks/galera_post_install.yml +++ b/playbooks/roles/galera_server/tasks/galera_post_install.yml @@ -28,15 +28,37 @@ tags: - galera-config +- name: Drop mariadb config(s) + config_template: + src: "{{ item.src }}" + dest: "{{ item.dest }}" + owner: "root" + group: "root" + mode: "0644" + config_overrides: "{{ item.config_overrides }}" + config_type: "{{ item.config_type }}" + with_items: + - src: my.cnf.j2 + dest: /etc/mysql/my.cnf + config_overrides: "{{ galera_my_cnf_overrides }}" + config_type: "ini" + - src: cluster.cnf.j2 + dest: /etc/mysql/conf.d/cluster.cnf + config_overrides: "{{ galera_cluster_cnf_overrides }}" + config_type: "ini" + - src: debian.cnf.j2 + dest: /etc/mysql/debian.cnf + config_overrides: "{{ galera_debian_cnf_overrides }}" + config_type: "ini" + tags: + - galera-client-user-config + - name: Drop mariadb config(s) template: src: "{{ item.src }}" dest: "{{ item.dest }}" mode: "{{ item.mode|default('0644') }}" with_items: - - { src: my.cnf.j2, dest: /etc/mysql/my.cnf } - - { src: cluster.cnf.j2, dest: /etc/mysql/conf.d/cluster.cnf } - - { src: debian.cnf.j2, dest: /etc/mysql/debian.cnf } - { src: mysql_defaults.j2, dest: /etc/default/mysql } notify: Restart mysql tags: