Compare commits
2 commits
227eeb1671
...
4c0b3c9812
| Author | SHA1 | Date | |
|---|---|---|---|
| 4c0b3c9812 | |||
|
4574dbf4ba |
11 changed files with 100 additions and 3 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
# renovate: datasource=docker depName=git.hamburg.ccc.de/ccchh/oci-images/nextcloud
|
# renovate: datasource=docker depName=git.hamburg.ccc.de/ccchh/oci-images/nextcloud
|
||||||
nextcloud__version: 33
|
nextcloud__version: 33
|
||||||
# renovate: datasource=docker depName=docker.io/library/postgres
|
# renovate: datasource=docker depName=docker.io/library/postgres
|
||||||
nextcloud__postgres_version: 15.18
|
nextcloud__postgres_version: 18.4
|
||||||
nextcloud__fqdn: cloud.hamburg.ccc.de
|
nextcloud__fqdn: cloud.hamburg.ccc.de
|
||||||
nextcloud__data_dir: /data/nextcloud
|
nextcloud__data_dir: /data/nextcloud
|
||||||
nextcloud__extra_configuration: "{{ lookup('ansible.builtin.template', 'resources/chaosknoten/cloud/nextcloud/extra_configuration.config.php.j2') }}"
|
nextcloud__extra_configuration: "{{ lookup('ansible.builtin.template', 'resources/chaosknoten/cloud/nextcloud/extra_configuration.config.php.j2') }}"
|
||||||
|
|
|
||||||
|
|
@ -291,3 +291,5 @@ msmtp_hosts:
|
||||||
renovate_hosts:
|
renovate_hosts:
|
||||||
hosts:
|
hosts:
|
||||||
renovate:
|
renovate:
|
||||||
|
secrets_hosts:
|
||||||
|
hosts:
|
||||||
|
|
|
||||||
2
inventories/external/hosts.yaml
vendored
2
inventories/external/hosts.yaml
vendored
|
|
@ -22,3 +22,5 @@ infrastructure_authorized_keys_hosts:
|
||||||
ansible_pull_hosts:
|
ansible_pull_hosts:
|
||||||
hosts:
|
hosts:
|
||||||
status:
|
status:
|
||||||
|
secrets_hosts:
|
||||||
|
hosts:
|
||||||
|
|
|
||||||
|
|
@ -57,3 +57,5 @@ ansible_pull_hosts:
|
||||||
light:
|
light:
|
||||||
waybackproxy:
|
waybackproxy:
|
||||||
yate:
|
yate:
|
||||||
|
secrets_hosts:
|
||||||
|
hosts:
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,13 @@
|
||||||
tags:
|
tags:
|
||||||
- base_config
|
- base_config
|
||||||
|
|
||||||
|
- name: Ensure secrets deployment on secrets_hosts
|
||||||
|
hosts: secrets_hosts
|
||||||
|
roles:
|
||||||
|
- secrets
|
||||||
|
tags:
|
||||||
|
- secrets
|
||||||
|
|
||||||
- name: Ensure systemd-networkd config deployment on systemd_networkd_hosts
|
- name: Ensure systemd-networkd config deployment on systemd_networkd_hosts
|
||||||
hosts: systemd_networkd_hosts
|
hosts: systemd_networkd_hosts
|
||||||
roles:
|
roles:
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ services:
|
||||||
- POSTGRES_DB=mailmandb
|
- POSTGRES_DB=mailmandb
|
||||||
- POSTGRES_USER=mailman
|
- POSTGRES_USER=mailman
|
||||||
- "POSTGRES_PASSWORD={{ secret__lists__postgres_password }}"
|
- "POSTGRES_PASSWORD={{ secret__lists__postgres_password }}"
|
||||||
image: docker.io/library/postgres:12-alpine
|
image: docker.io/library/postgres:18-alpine
|
||||||
volumes:
|
volumes:
|
||||||
- /opt/mailman/database:/var/lib/postgresql/data
|
- /opt/mailman/database:/var/lib/postgresql/data
|
||||||
networks:
|
networks:
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
services:
|
services:
|
||||||
database:
|
database:
|
||||||
image: docker.io/library/postgres:15-alpine
|
image: docker.io/library/postgres:18-alpine
|
||||||
environment:
|
environment:
|
||||||
- "POSTGRES_USER=pretalx"
|
- "POSTGRES_USER=pretalx"
|
||||||
- "POSTGRES_PASSWORD={{ secret__pretalx_db_password }}"
|
- "POSTGRES_PASSWORD={{ secret__pretalx_db_password }}"
|
||||||
|
|
|
||||||
24
roles/secrets/README.md
Normal file
24
roles/secrets/README.md
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
# Role `secrets`
|
||||||
|
|
||||||
|
Allows storing the given secret contents in the configured files.
|
||||||
|
|
||||||
|
## Supported Distributions
|
||||||
|
|
||||||
|
Should work on Debian-based distributions.
|
||||||
|
|
||||||
|
## Required Arguments
|
||||||
|
|
||||||
|
None.
|
||||||
|
|
||||||
|
## Optional Arguments
|
||||||
|
|
||||||
|
- `secrets__secrets`: List of secrets.
|
||||||
|
Defaults to the empty list (`[ ]`).
|
||||||
|
- `secrets__secrets.*.name`: (File)name for the secret (in the `/etc/ansible_secrets` directory).
|
||||||
|
- `secrets__secrets.*.content`: The secret content to store.
|
||||||
|
- `secrets__secrets.*.owner`: The owner of the secret file.
|
||||||
|
Defaults to `root`.
|
||||||
|
- `secrets__secrets.*.group`: The group of the secret file.
|
||||||
|
Defaults to `root`.
|
||||||
|
- `secrets__secrets.*.mode`: The mode of the secret file.
|
||||||
|
Defaults to `0640`.
|
||||||
1
roles/secrets/defaults/main.yaml
Normal file
1
roles/secrets/defaults/main.yaml
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
secrets__secrets: [ ]
|
||||||
6
roles/secrets/meta/argument_specs.yaml
Normal file
6
roles/secrets/meta/argument_specs.yaml
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
argument_specs:
|
||||||
|
main:
|
||||||
|
options:
|
||||||
|
secrets__secrets:
|
||||||
|
type: list
|
||||||
|
required: false
|
||||||
53
roles/secrets/tasks/main.yaml
Normal file
53
roles/secrets/tasks/main.yaml
Normal file
|
|
@ -0,0 +1,53 @@
|
||||||
|
- name: validate secret configs
|
||||||
|
ansible.builtin.validate_argument_spec:
|
||||||
|
argument_spec: "{{ required_data }}"
|
||||||
|
provided_arguments:
|
||||||
|
config: "{{ item }}"
|
||||||
|
loop: "{{ secrets__secrets }}"
|
||||||
|
loop_control:
|
||||||
|
label: "{{ item.name }}"
|
||||||
|
vars:
|
||||||
|
required_data:
|
||||||
|
config:
|
||||||
|
type: dict
|
||||||
|
required: true
|
||||||
|
options:
|
||||||
|
name:
|
||||||
|
type: str
|
||||||
|
required: true
|
||||||
|
content:
|
||||||
|
type: str
|
||||||
|
required: true
|
||||||
|
owner:
|
||||||
|
type: str
|
||||||
|
required: false
|
||||||
|
default: root
|
||||||
|
group:
|
||||||
|
type: str
|
||||||
|
required: false
|
||||||
|
default: root
|
||||||
|
mode:
|
||||||
|
type: str
|
||||||
|
required: false
|
||||||
|
default: "0640"
|
||||||
|
|
||||||
|
- name: ensure secrets directory exists
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "/etc/ansible_secrets"
|
||||||
|
state: directory
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: "0750"
|
||||||
|
become: true
|
||||||
|
|
||||||
|
- name: ensure secrets are present
|
||||||
|
ansible.builtin.copy:
|
||||||
|
content: "{{ item.content }}"
|
||||||
|
dest: "/etc/ansible_secrets/{{ item.name }}"
|
||||||
|
mode: "{{ item.mode | default('0640') }}"
|
||||||
|
owner: "{{ item.owner | default('root') }}"
|
||||||
|
group: "{{ item.group | default('root') }}"
|
||||||
|
become: true
|
||||||
|
loop: "{{ secrets__secrets }}"
|
||||||
|
loop_control:
|
||||||
|
label: "{{ item.name }}"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue