Skip to content

Commit 6c7ec98

Browse files
Modify garb tasks and templates for FreeBSD compatibility
1 parent fb3f559 commit 6c7ec98

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

tasks/config_garb.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
---
22
- name: Confiure garb (garb.cnf)
3-
when: mariadb.galera.arbitrator
3+
when: mariadb.galera.arbitrator and ansible_system == "Linux"
44
ansible.builtin.template:
55
src: garb.cnf
66
dest: /etc/default/garb
77
owner: root
88
mode: "0644"
99
notify: Restart garb
10+
11+
- name: Confiure garb (rc.conf.d/garb)
12+
when: mariadb.galera.arbitrator and ansible_system == "FreeBSD"
13+
ansible.builtin.template:
14+
src: rc.conf.d/garb
15+
dest: /usr/local/etc/rc.conf.d/garb
16+
owner: root
17+
mode: "0644"
18+
notify: Restart garb

templates/bin/galera_new_cluster

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
echo 'mysql_args="--wsrep-new-cluster"' >> /usr/local/etc/rc.conf.d/mysql-server
33
service mysql-server start
4-
sed -i -e '/^mysql_args/d' /usr/local/etc/rc.conf.d/mysql-server
4+
sed -i"" '/^mysql_args/d' /usr/local/etc/rc.conf.d/mysql-server

templates/rc.conf.d/garb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
garb_enable=YES
2+
garb_galera_nodes="{% for node_vars in mariadb_galera_cluster_nodes | map('extract', hostvars) %}{{ node_vars.mariadb['my.cnf'].galera.wsrep_node_address }}{% if not loop.last %},{% endif %}{% endfor %}"
3+
garb_galera_group="{{ mariadb['my.cnf'].galera.wsrep_cluster_name }}"

0 commit comments

Comments
 (0)