Skip to content

Commit fdb4b78

Browse files
WIP: Ensure Galera cluster functionality under FreeBSD
1 parent 4814dd0 commit fdb4b78

File tree

13 files changed

+244
-55
lines changed

13 files changed

+244
-55
lines changed

.aar-doc.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
---
2+
output_file: README.md
3+
output_mode: replace
4+
output_template: |
5+
<!-- BEGIN_ANSIBLE_DOCS -->
6+
# {{ role }}
7+
8+
{{ metadata.galaxy_info.description }}
9+
10+
## Supported Operating Systems
11+
12+
- Debian 12
13+
- Ubuntu 24.04, 22.04
14+
- FreeBSD [Proserver](https://infrastructure.punkt.de/de/produkte/proserver.html)
15+
16+
## Role Arguments
17+
18+
{% for entrypoint in argument_specs.keys() %}
19+
20+
{% if "description" in argument_specs[entrypoint] %}
21+
{%- if argument_specs[entrypoint].description is string -%}
22+
{{ argument_specs[entrypoint].description }}
23+
{% else %}
24+
{%- for line in argument_specs[entrypoint].description -%}
25+
{{ line }}
26+
27+
{% endfor -%}
28+
{% endif -%}
29+
{% endif -%}
30+
31+
{% if entrypoint_options[entrypoint] | length > 1 -%}
32+
{% for path, options in entrypoint_options[entrypoint][1:] -%}
33+
#### Options for `{{ path | reject('eq', 'main') | join(".") }}`
34+
35+
|Option|Description|Type|Required|Default|
36+
|---|---|---|---|---|
37+
{%- for name, details in options.items() %}
38+
| `{{ name }}` | {{ details.display_description }} | {{ details.display_type }} | {{ details.display_required }} | {{ details.display_default }} |
39+
{%- endfor %}
40+
41+
{% endfor -%}
42+
43+
{% endif -%}
44+
45+
{% if entrypoint in entrypoint_choices -%}
46+
{% for path, choices in entrypoint_choices[entrypoint] -%}
47+
#### Choices for {{ path | join(" > ") }}
48+
49+
|Choice|
50+
|---|
51+
{%- for item in choices %}
52+
| {{ item }} |
53+
{%- endfor %}
54+
55+
{% endfor -%}
56+
{% endif -%}
57+
{% else -%}
58+
59+
This entrypoint has no options.
60+
61+
{% endfor -%}
62+
63+
## Dependencies
64+
65+
{%- if ("dependencies" in metadata) and (metadata.dependencies | length > 0) %}
66+
{%- for dependency in metadata.dependencies %}
67+
{%- if dependency.src %}
68+
- [{{ dependency.role }}]({{ dependency.src }})
69+
{%- else %}
70+
- {{ dependency.role }}
71+
{%- endif %}
72+
{%- if dependency.when %}
73+
- **Condition**: `{{ dependency.when }}`
74+
{%- endif %}
75+
{%- endfor %}
76+
{%- else %}
77+
None.
78+
{%- endif %}
79+
80+
## Installation
81+
Add this role to the requirements.yml of your playbook as follows:
82+
```yaml
83+
roles:
84+
- name: {{ role }}
85+
src: https://github.com/punktDe/ansible-proserver-mariadb
86+
```
87+
88+
Afterwards, install the role by running `ansible-galaxy install -r requirements.yml`
89+
90+
## Example Playbook
91+
92+
```yaml
93+
- hosts: all
94+
roles:
95+
- name: mariadb
96+
```
97+
98+
<!-- END_ANSIBLE_DOCS -->

.ansible-lint

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
---
22
skip_list:
3-
- 'risky-shell-pipe'
4-
- 'role-name'
3+
- meta-no-info
4+
- var-naming[no-role-prefix]
5+
- name[template]
56

67
warn_list:
8+
- no-handler
79
- package-latest
10+
- risky-shell-pipe
811
- unnamed-task
9-
- command-instead-of-shell
10-
- no-handler
12+
13+
exclude_paths:
14+
- .ansible/

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# EditorConfig: http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
end_of_line = lf
9+
insert_final_newline = true
10+
11+
# 2 space indentation for YAML
12+
[{*.yml,*.yaml}]
13+
indent_style = space
14+
indent_size = 2

.envrc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
if [ -n "$DIRENV_DIFF" ]; then
3+
# Do not `set -e` unless we're being run from direnv
4+
set -e
5+
fi
6+
7+
if [ ! -f venv-ansible-proserver-mariadb/bin/activate ]; then
8+
echo "Creating a virtual Python environment"
9+
uv -q venv --allow-existing --seed venv-ansible-proserver-mariadb
10+
fi
11+
12+
echo "Activating the Python virtual environment"
13+
. venv-ansible-proserver-mariadb/bin/activate
14+
15+
echo "Installing Python requirements"
16+
uv -q pip install -r requirements.txt
17+
18+
export GITHUB_ACTIONS=maybe
19+
export ANSIBLE_HASH_BEHAVIOUR=merge

.github/workflows/test.yml

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,42 +5,57 @@ on:
55
push:
66
workflow_dispatch:
77

8+
env:
9+
ANSIBLE_ROLES_PATH: roles
10+
ANSIBLE_HASH_BEHAVIOUR: merge
11+
812
jobs:
913
lint:
1014
runs-on: ubuntu-latest
1115
steps:
1216
- name: Checkout
1317
uses: actions/checkout@v3
1418

19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v5
21+
1522
- name: Set up Python
16-
uses: actions/setup-python@v2
17-
with:
18-
python-version: '3.x'
23+
run: uv python install
1924

20-
- name: Install dependencies.
21-
run: pip install yamllint ansible-lint ansible
25+
- name: Install dependencies
26+
run: |
27+
uv -q venv --allow-existing --seed .venv
28+
. .venv/bin/activate
29+
uv -q pip install -r requirements.txt
2230
2331
- name: Run ansible-lint
24-
run: "ansible-lint"
32+
run: |
33+
. .venv/bin/activate
34+
ansible-lint
2535
2636
molecule:
37+
strategy:
38+
matrix:
39+
os: [ubuntu-2204, ubuntu-2404, debian-12]
2740
runs-on: ubuntu-latest
2841
steps:
2942
- name: Checkout
3043
uses: actions/checkout@v3
3144

45+
- name: Install uv
46+
uses: astral-sh/setup-uv@v5
47+
3248
- name: Set up Python
33-
uses: actions/setup-python@v2
34-
with:
35-
python-version: '3.x'
49+
run: uv python install
3650

3751
- name: Install dependencies.
3852
run: |
39-
python -m pip install --upgrade pip
40-
pip install ansible docker molecule molecule-plugins
41-
42-
- name: Install Galaxy dependencies.
43-
run: ansible-galaxy collection install community.docker community.mysql
53+
uv -q venv --allow-existing --seed .venv
54+
. .venv/bin/activate
55+
uv -q pip install -r requirements.txt
56+
ansible-galaxy install -r requirements.yml
4457
4558
- name: Run molecule
46-
run: "molecule test"
59+
run: |
60+
. .venv/bin/activate
61+
molecule test -p ${{ matrix.os }}

.gitignore

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
.DS_Store
22
*.pyc
33
__pycache__
4-
files/
54
.idea
5+
.vscode
6+
/*.retry
7+
/.fact_cache
8+
/venv/
9+
debug.log
10+
id_ed25519*
11+
/venv*/
12+
.collections
13+
roles
14+
.roles
15+
.venv
16+
.ansible

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
repos:
33
- repo: https://github.com/ansible/ansible-lint.git
4-
rev: v6.22.1
4+
rev: v25.2.1
55
hooks:
66
- id: ansible-lint
77
files: \.(yaml|yml)$

.yamllint

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,15 @@
11
---
2-
# Based on ansible-lint config
32
extends: default
43

54
rules:
5+
line-length: disable
6+
truthy:
7+
allowed-values: ['true', 'false', 'yes', 'no']
8+
comments:
9+
min-spaces-from-content: 1
610
braces:
11+
min-spaces-inside: 0
712
max-spaces-inside: 1
8-
level: error
9-
brackets:
10-
max-spaces-inside: 1
11-
level: error
12-
colons:
13-
max-spaces-after: -1
14-
level: error
15-
commas:
16-
max-spaces-after: -1
17-
level: error
18-
comments: disable
19-
comments-indentation: disable
20-
document-start: disable
21-
empty-lines:
22-
max: 3
23-
level: error
24-
hyphens:
25-
level: error
26-
indentation: disable
27-
key-duplicates: enable
28-
line-length: disable
29-
new-line-at-end-of-file: disable
30-
new-lines:
31-
type: unix
32-
trailing-spaces: disable
33-
truthy: disable
13+
14+
ignore: |
15+
.cache
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
2-
dependencies: []
3-
42
galaxy_info:
5-
author: "Punkt.de"
3+
author: "punkt.de"
64
license: "MIT"
5+
role_name: mariadb
76
description: "MariaDB role for Proserver"
8-
role_name: "proserver_mariadb"
97
namespace: "punktde"
108
min_ansible_version: "2.15"
9+
platforms: []

requirements.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
ansible
2+
ansible-lint
3+
docker
4+
molecule<25.2.0
5+
molecule-plugins
6+
yamllint
7+
requests
8+
aar-doc

0 commit comments

Comments
 (0)