refactor: streamline Ansible playbook and logrotate configurations

- Removed environment variable lookups for logrotate settings in logrotate configuration files, replacing them with hardcoded values.
- Updated the Ansible playbook to simplify project root, deploy user, and old server configurations by removing environment variable dependencies.
- Added tasks to copy Zsh configuration files from an old server to the new server, ensuring proper permissions and cleanup of temporary files.
- Enhanced logrotate configurations for bots and system logs to ensure consistent management of log files.
This commit is contained in:
2025-09-19 13:00:19 +03:00
parent f7b08ae9e8
commit 8595fc5886
4 changed files with 231 additions and 36 deletions

View File

@@ -4,9 +4,9 @@
{{ project_root }}/bots/*/logs/*.log {
daily
missingok
rotate {{ lookup('env', 'LOGROTATE_RETENTION_DAYS') | default('30') }}
{% if lookup('env', 'LOGROTATE_COMPRESS') | default('true') | lower == 'true' %}compress{% endif %}
{% if lookup('env', 'LOGROTATE_DELAYCOMPRESS') | default('true') | lower == 'true' %}delaycompress{% endif %}
rotate 30
compress
delaycompress
notifempty
create 0644 {{ deploy_user }} {{ deploy_user }}
postrotate
@@ -20,9 +20,9 @@
{{ project_root }}/bots/*/bot_stderr.log {
daily
missingok
rotate {{ lookup('env', 'LOGROTATE_RETENTION_DAYS') | default('30') }}
{% if lookup('env', 'LOGROTATE_COMPRESS') | default('true') | lower == 'true' %}compress{% endif %}
{% if lookup('env', 'LOGROTATE_DELAYCOMPRESS') | default('true') | lower == 'true' %}delaycompress{% endif %}
rotate 30
compress
delaycompress
notifempty
create 0644 {{ deploy_user }} {{ deploy_user }}
postrotate