Initial commit: Ansible configuration for monitoring stack
Contains: - Production inventory (inventories/production/hosts) - VictoriaMetrics installation (playbooks/monitoring/install_victoriametrics.yml) - Vault setup and secrets management (playbooks/vault/) - Base system configuration (playbooks/infrastructure/) - Directory structure for monitoring components
This commit is contained in:
31
playbooks/infrastructure/01-system-update.yml
Normal file
31
playbooks/infrastructure/01-system-update.yml
Normal file
@ -0,0 +1,31 @@
|
||||
---
|
||||
- name: System update and cleanup
|
||||
hosts: all_except_ansible
|
||||
become: yes
|
||||
|
||||
tasks:
|
||||
- name: Stop unattended upgrades
|
||||
systemd:
|
||||
name: unattended-upgrades
|
||||
state: stopped
|
||||
|
||||
- name: Clean any apt locks
|
||||
shell: |
|
||||
pkill -9 apt-get apt dpkg 2>/dev/null || true
|
||||
rm -f /var/lib/apt/lists/lock /var/lib/dpkg/lock*
|
||||
dpkg --configure -a 2>/dev/null || true
|
||||
ignore_errors: yes
|
||||
|
||||
- name: Update apt cache
|
||||
apt:
|
||||
update_cache: yes
|
||||
cache_valid_time: 86400
|
||||
|
||||
- name: Upgrade system packages
|
||||
apt:
|
||||
upgrade: safe
|
||||
autoremove: yes
|
||||
|
||||
- name: Clean apt cache
|
||||
apt:
|
||||
autoclean: yes
|
||||
Reference in New Issue
Block a user