Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 621d5310a3 | |||
| 6377a56d95 | |||
| dbd72f43a4 | |||
| 9f236b6fa5 | |||
| b4a0874deb | |||
| c51216ff9b | |||
| 7debdfcb93 | |||
| da016343c0 | |||
| bf749ebbde |
@@ -177,7 +177,7 @@ version:
|
||||
vaultwarden: "1.35.4"
|
||||
gitea: "1.25.5"
|
||||
redis: "8.6.1"
|
||||
immich: "v2.7.4"
|
||||
immich: "v2.7.5"
|
||||
actualbudget: "26.3.0"
|
||||
paperless: "2.20.13"
|
||||
vikunja: "2.2.2"
|
||||
|
||||
@@ -115,18 +115,10 @@
|
||||
become: true
|
||||
tags: ["init", "site", "install-packages"]
|
||||
|
||||
- name: Install CLI tools
|
||||
- name: Set CLI tools
|
||||
ansible.builtin.include_role:
|
||||
name: "console"
|
||||
tasks_from: "services/set_cli_tools"
|
||||
apply:
|
||||
tags: ["init", "site", "tools"]
|
||||
tags: ["init", "site", "tools"]
|
||||
|
||||
- name: Install chromium with font
|
||||
ansible.builtin.include_role:
|
||||
name: "console"
|
||||
tasks_from: "services/set_chromium"
|
||||
apply:
|
||||
tags: ["init", "site", "chromium"]
|
||||
tags: ["init", "site", "chromium"]
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
- name: Reload postgresql
|
||||
ansible.builtin.command:
|
||||
/usr/bin/podman exec -u postgres postgresql sh -c "pg_ctl reload"
|
||||
when: not (is_postgresql_init_run | default(false))
|
||||
when: is_postgresql_init.stat.exists
|
||||
changed_when: false
|
||||
listen: "notification_reload_postgresql"
|
||||
ignore_errors: true # noqa: ignore-errors
|
||||
@@ -24,7 +24,7 @@
|
||||
enabled: true
|
||||
daemon_reload: true
|
||||
scope: "user"
|
||||
when: not (is_postgresql_init_run | default(false))
|
||||
when: is_postgresql_init.stat.exists
|
||||
changed_when: false
|
||||
listen: "notification_restart_postgresql"
|
||||
ignore_errors: true # noqa: ignore-errors
|
||||
|
||||
@@ -55,6 +55,8 @@
|
||||
no_log: true
|
||||
|
||||
- name: Initiate ldap (When = false, If DB data does not exist in postgresql, activate this block)
|
||||
# The reason why this task doesn't use the way to check ".init" file is this tasks can override original database.
|
||||
# Absent of ".init" file cannot guarantee DB is empty.
|
||||
when: false
|
||||
become: true
|
||||
block:
|
||||
|
||||
@@ -88,15 +88,13 @@
|
||||
no_log: true
|
||||
|
||||
- name: Check data directory empty
|
||||
ansible.builtin.find:
|
||||
paths: "{{ node['home_path'] }}/containers/postgresql/data/"
|
||||
hidden: true
|
||||
file_type: "any"
|
||||
ansible.builtin.stat:
|
||||
path: "{{ node['home_path'] }}/containers/postgresql/data/.init"
|
||||
become: true
|
||||
register: "is_data_dir_empty"
|
||||
register: "is_postgresql_init"
|
||||
|
||||
- name: Prepare initiating DB
|
||||
when: is_data_dir_empty.matched == 0
|
||||
when: not is_postgresql_init.stat.exists
|
||||
become: true
|
||||
block:
|
||||
# `init/pg_cluster.sql` should be fetched from postgresql's backup directory before running initiating
|
||||
@@ -118,9 +116,14 @@
|
||||
loop: "{{ connected_services }}"
|
||||
loop_control:
|
||||
index_var: index_num
|
||||
- name: Set is_postgresql_init_run
|
||||
ansible.builtin.set_fact:
|
||||
is_postgresql_init_run: true
|
||||
|
||||
- name: Create .init file
|
||||
ansible.builtin.file:
|
||||
path: "{{ node['home_path'] }}/containers/postgresql/data/.init"
|
||||
state: "touch"
|
||||
mode: "0644"
|
||||
owner: "{{ ansible_user }}"
|
||||
group: "svadmins"
|
||||
|
||||
- name: Deploy container file
|
||||
ansible.builtin.template:
|
||||
|
||||
@@ -13,7 +13,7 @@ Image=docker.io/gitea/gitea:{{ version['containers']['gitea'] }}
|
||||
ContainerName=gitea
|
||||
HostName=gitea
|
||||
|
||||
PublishPort=3000:3000/tcp
|
||||
PublishPort={{ services['gitea']['ports']['http'] }}:3000/tcp
|
||||
|
||||
Volume=%h/data/containers/gitea:/data:rw
|
||||
Volume=%h/containers/gitea/ssl:/etc/ssl/gitea:ro
|
||||
|
||||
@@ -10,7 +10,7 @@ theme: 'auto'
|
||||
# Server configuration
|
||||
server:
|
||||
# TLS will be applied on caddy
|
||||
address: 'tcp://:9091/'
|
||||
address: 'tcp://:{{ services['authelia']['ports']['http'] }}/'
|
||||
|
||||
# Log configuration
|
||||
log:
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
import crowdsec_log
|
||||
route {
|
||||
crowdsec
|
||||
reverse_proxy host.containers.internal:9091
|
||||
reverse_proxy host.containers.internal:{{ services['authelia']['ports']['http'] }}
|
||||
}
|
||||
}
|
||||
# test.ilnmors.com {
|
||||
|
||||
@@ -203,12 +203,11 @@ loki.relabel "caddy_relabel" {
|
||||
loki.process "journal_parser" {
|
||||
forward_to = [loki.write.loki.receiver]
|
||||
// Severity parsing
|
||||
// If content of log includes "level" information, change the level
|
||||
stage.logfmt {
|
||||
mapping = {
|
||||
"content_level" = "level",
|
||||
}
|
||||
stage.regex {
|
||||
// Regex to extract the log level from the content.
|
||||
expression = "(?i)(?:level[\"\\s:=]+|\\[|\\s|^)(?P<content_level>info|warn|warning|error|debug|fatal|critical|trace)(?:[\"\\]\\s]|$)"
|
||||
}
|
||||
|
||||
stage.labels {
|
||||
values = {
|
||||
"level" = "content_level",
|
||||
|
||||
@@ -21,9 +21,9 @@ ProtectHome=tmpfs
|
||||
InaccessiblePaths=/boot /root
|
||||
|
||||
{% if node['name'] == 'infra' %}
|
||||
BindReadOnlyPaths=/home/infra/containers/postgresql/backups
|
||||
BindReadOnlyPaths=%h/containers/postgresql/backups
|
||||
{% elif node['name'] == 'app' %}
|
||||
BindReadOnlyPaths=/home/app/data
|
||||
BindReadOnlyPaths=%h/data
|
||||
{% endif %}
|
||||
# In root namescope, %u always bring 0
|
||||
BindPaths=/etc/kopia
|
||||
|
||||
Reference in New Issue
Block a user