Fix pre-commit hooks and move directories
roles/ and inventory/ are now in playbooks/ also fixed issues reported by ansible-lint
This commit is contained in:
parent
dc398ddb6e
commit
4104057771
123 changed files with 91 additions and 39 deletions
playbooks/roles/acme_dns
37
playbooks/roles/acme_dns/tasks/main.yml
Normal file
37
playbooks/roles/acme_dns/tasks/main.yml
Normal file
|
@ -0,0 +1,37 @@
|
|||
---
|
||||
- name: Set common facts
|
||||
ansible.builtin.import_tasks: tasks/set-default-facts.yml
|
||||
|
||||
- name: Deploy {{ role_name }}
|
||||
vars:
|
||||
svc: "{{ acme_dns_svc }}"
|
||||
env: "{{ acme_dns_env }}"
|
||||
compose: "{{ acme_dns_compose }}"
|
||||
block:
|
||||
- name: Import prepare tasks for common service
|
||||
ansible.builtin.import_tasks: tasks/prepare-common-service.yml
|
||||
|
||||
- name: Setting the service config path
|
||||
ansible.builtin.set_fact:
|
||||
config_path: "{{ (service_path, 'config') | path_join }}"
|
||||
|
||||
- name: Create a service-config directory
|
||||
ansible.builtin.file:
|
||||
path: "{{ config_path }}"
|
||||
state: directory
|
||||
mode: "0700"
|
||||
|
||||
- name: Template config
|
||||
ansible.builtin.template:
|
||||
src: config.cfg.j2
|
||||
dest: "{{ (config_path, 'config.cfg') | path_join }}"
|
||||
mode: "0600"
|
||||
register: cmd_result
|
||||
|
||||
- name: Set the docker force-recreate flag
|
||||
ansible.builtin.set_fact:
|
||||
docker_force_recreate: --force-recreate
|
||||
when: cmd_result.changed # noqa: no-handler We need to handle the restart per service. Handlers don't support variables.
|
||||
|
||||
- name: Import start tasks for common service
|
||||
ansible.builtin.import_tasks: tasks/start-common-service.yml
|
32
playbooks/roles/acme_dns/templates/config.cfg.j2
Normal file
32
playbooks/roles/acme_dns/templates/config.cfg.j2
Normal file
|
@ -0,0 +1,32 @@
|
|||
[general]
|
||||
listen = "0.0.0.0:53"
|
||||
protocol = "both"
|
||||
domain = "{{ svc.domain }}"
|
||||
nsname = "{{ svc.domain }}"
|
||||
nsadmin = "{{ svc.nsadmin }}"
|
||||
records = [
|
||||
"{{ svc.domain }}. A {{ svc.records.a }}",
|
||||
"{{ svc.domain }}. AAAA {{ svc.records.aaaa }}",
|
||||
"{{ svc.domain }}. NS {{ svc.domain }}.",
|
||||
]
|
||||
debug = false
|
||||
|
||||
[database]
|
||||
engine = "postgres"
|
||||
connection = "postgres://{{ svc.db.user }}:{{ svc.db.pass }}@{{ svc.db.host }}/{{ svc.db.db }}"
|
||||
|
||||
[api]
|
||||
ip = "0.0.0.0"
|
||||
disable_registration = false
|
||||
port = "{{ svc.port }}"
|
||||
tls = "none"
|
||||
corsorigins = [
|
||||
"*"
|
||||
]
|
||||
use_header = true
|
||||
header_name = "X-Forwarded-For"
|
||||
|
||||
[logconfig]
|
||||
loglevel = "info"
|
||||
logtype = "stdout"
|
||||
logformat = "text"
|
27
playbooks/roles/acme_dns/vars/main.yml
Normal file
27
playbooks/roles/acme_dns/vars/main.yml
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
acme_dns_svc:
|
||||
domain: "{{ acme_dns.host }}"
|
||||
port: 80
|
||||
nsadmin: "{{ admin_email | regex_replace('@', '.') }}"
|
||||
records:
|
||||
a: "{{ ansible_facts.default_ipv4.address }}"
|
||||
aaaa: "{{ ansible_facts.default_ipv6.address }}"
|
||||
db:
|
||||
host: "{{ postgres.host }}"
|
||||
port: "{{ postgres.port }}"
|
||||
user: "{{ opentofu.postgresql_data.acme_dns.user }}"
|
||||
pass: "{{ opentofu.postgresql_data.acme_dns.pass }}"
|
||||
db: "{{ opentofu.postgresql_data.acme_dns.database }}"
|
||||
|
||||
acme_dns_compose:
|
||||
watchtower: true
|
||||
monitoring: true
|
||||
image: joohoi/acme-dns
|
||||
volumes:
|
||||
- ./config:/etc/acme-dns:ro
|
||||
file:
|
||||
services:
|
||||
app:
|
||||
ports:
|
||||
- "53:53"
|
||||
- 53:53/udp
|
Loading…
Add table
Add a link
Reference in a new issue