Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lmdb: add lmdb management #95

Merged
merged 4 commits into from
Feb 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## v1.6.2 (UNRELEASED)

NEW FEATURES:
- Create directory, set the ownership and permissions for LMDB databases

## v1.6.1 (2020-10-01)

BUG FIXES:
Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ pdns_mysql_databases_credentials:
- "localhost"
```

Notice that this must only containes the credentials
Notice that this must only contain the credentials
for the `gmysql` backends provided in `pdns_backends`.

```yaml
Expand All @@ -221,6 +221,13 @@ pdns_sqlite_databases_locations: []
Locations of the SQLite3 databases that have to be created if using the
`gsqlite3` backend.

```yaml
pdns_lmdb_databases_locations: []
```

Locations of the LMDB databases that have to be created if using the
`lmdb` backend.

## Example Playbooks

Run as a master using the bind backend (when you already have a `named.conf` file):
Expand Down
5 changes: 5 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,8 @@ pdns_mysql_databases_credentials: {}
# NOTE: Requries the SQLite CLI tools to be available in the machine and the gsqlite3
# backend to be installed on the machine.
pdns_sqlite_databases_locations: []

# This will create the PowerDNS Authoritative Server backend LMDB database
# in the given locations.
# NOTE: Requries lmdb backend to be installed on the machine.
pdns_lmdb_databases_locations: []
10 changes: 10 additions & 0 deletions tasks/database-lmdb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---

- name: Ensure that the directories containing the PowerDNS LMDB databases exist
file:
name: "{{ item | dirname }}"
owner: "{{ pdns_user }}"
group: "{{ pdns_group }}"
state: directory
mode: 0750
with_items: "{{ pdns_lmdb_databases_locations }}"
6 changes: 6 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@
- db
- sqlite

- include: database-lmdb.yml
when: "pdns_lmdb_databases_locations | length > 0"
tags:
- db
- lmdb

- include: configure.yml
tags:
- config
Expand Down