From af4f78663d9d596c9cfe2671697b61a08a5ce221 Mon Sep 17 00:00:00 2001 From: ITQ Date: Wed, 24 Dec 2025 11:38:31 +0300 Subject: [PATCH] chore: improvements in .gitignore --- .gitignore | 27 +++++++++++++++++++++++++++ .yamllint.yaml | 8 ++++++++ containers.yaml | 23 +++++++++++++++++++++++ roles/common/tasks/cron.yaml | 9 +++++++++ 4 files changed, 67 insertions(+) create mode 100644 .yamllint.yaml create mode 100644 containers.yaml create mode 100644 roles/common/tasks/cron.yaml diff --git a/.gitignore b/.gitignore index 679e57a..2e15302 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,30 @@ +# General +.DS_Store +__MACOSX/ +.AppleDouble +.LSOverride +Icon[ +] + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + # Ansible Galaxy roles external_roles/* diff --git a/.yamllint.yaml b/.yamllint.yaml new file mode 100644 index 0000000..0f6da89 --- /dev/null +++ b/.yamllint.yaml @@ -0,0 +1,8 @@ +--- +extends: default + +ignore: | + external_roles/ + +rules: + line-length: disable diff --git a/containers.yaml b/containers.yaml new file mode 100644 index 0000000..d3d9b41 --- /dev/null +++ b/containers.yaml @@ -0,0 +1,23 @@ +--- +- name: Containers + hosts: servers + gather_facts: true + become: true + serial: 100% + + pre_tasks: + - name: Ensure Docker and K3s are not both enabled + assert: + that: + - not (containers.docker.enabled and containers.k3s.enabled) + fail_msg: "Docker and K3s cannot both be enabled at the same time." + success_msg: "Configuration is valid." + + roles: + - role: geerlingguy.docker + when: containers.docker.enabled | bool + tags: docker + + - role: k3s.orchestration.k3s_server + when: containers.k3s.enabled | bool + tags: k3s diff --git a/roles/common/tasks/cron.yaml b/roles/common/tasks/cron.yaml new file mode 100644 index 0000000..50b729f --- /dev/null +++ b/roles/common/tasks/cron.yaml @@ -0,0 +1,9 @@ +--- +- name: Create cron job to prune journald logs with configurable limits + ansible.builtin.cron: + name: "Prune systemd journal logs ({{ journal_retention_days }} days, {{ journal_max_disk_limit }} disk)" + minute: "0" + hour: "2" + job: "/usr/bin/journalctl --vacuum-time={{ journal_retention_days }}d --vacuum-size={{ journal_max_disk_limit }} > /dev/null 2>&1" + user: root + state: present