Skip to content

Commit fb3f559

Browse files
Modify garb/mariadb tasks for FreeBSD compatibility
1 parent fdb4b78 commit fb3f559

File tree

2 files changed

+24
-22
lines changed

2 files changed

+24
-22
lines changed

tasks/config_db.yaml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
---
2-
- name: Handle MariaDB nodes
3-
when: not mariadb.galera.arbitrator
2+
- name: Configure MariaDB (FreeBSD)
3+
when: ansible_system == 'FreeBSD'
44
block:
5-
- name: Configure MariaDB (FreeBSD)
6-
when: ansible_system == 'FreeBSD'
7-
block:
8-
- name: Get MariaDB server version
9-
check_mode: no
10-
ansible.builtin.shell:
11-
cmd: >-
12-
/usr/local/libexec/mysqld --version |
13-
python3 -c
14-
'import sys, re; print(re.search("Ver[\s\t]*([0-9]+\.[0-9]+)", sys.stdin.readline()).group(1))'
15-
changed_when: no
16-
register: mariadb_get_server_version_result
5+
- name: Get MariaDB server version
6+
check_mode: no
7+
ansible.builtin.shell:
8+
cmd: >-
9+
/usr/local/libexec/mysqld --version |
10+
python3 -c
11+
'import sys, re; print(re.search("Ver[\s\t]*([0-9]+\.[0-9]+)", sys.stdin.readline()).group(1))'
12+
changed_when: no
13+
register: mariadb_get_server_version_result
1714

18-
- name: Check if legacy config location must be used
19-
ansible.builtin.set_fact:
20-
mariadb_use_legacy_config_location_result: "{{ mariadb_get_server_version_result.stdout is version('10.5', '<') }}"
15+
- name: Check if legacy config location must be used
16+
ansible.builtin.set_fact:
17+
mariadb_use_legacy_config_location_result: "{{ mariadb_get_server_version_result.stdout is version('10.5', '<') }}"
2118

22-
- name: Remove obsolete my.cnf
23-
when: not mariadb_use_legacy_config_location_result
24-
ansible.builtin.file:
25-
path: "/usr/local/etc/my.cnf"
26-
state: absent
19+
- name: Remove obsolete my.cnf
20+
when: not mariadb_use_legacy_config_location_result
21+
ansible.builtin.file:
22+
path: "/usr/local/etc/my.cnf"
23+
state: absent
2724

25+
- name: Handle MariaDB nodes
26+
when: not mariadb.galera.arbitrator
27+
block:
2828
- name: Configure MariaDB (my.cnf)
2929
community.general.ini_file:
3030
path: "{{ config_filepath }}"

tasks/galera.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@
5858
ansible.builtin.template:
5959
src: bin/galera_new_cluster
6060
dest: /var/opt/galera/bin/galera_new_cluster
61+
owner: root
62+
mode: "0755"
6163

6264
- name: Initialize cluster
6365
changed_when: yes

0 commit comments

Comments
 (0)