Skip to content

Commit

Permalink
ansible: Install atop on Debian based hosts and default to 10s intervals
Browse files Browse the repository at this point in the history
atop is useful to be able to debug what happened historically.
  • Loading branch information
chantra committed Sep 18, 2023
1 parent 1878716 commit c65d261
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ansible/roles/base/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
---
__base_packages:
- atop
- curl
- git
- jq
- python3-pip
- vim

atop_interval: 10
30 changes: 30 additions & 0 deletions ansible/roles/base/tasks/setup-Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,33 @@
state: stopped
enabled: no
masked: yes

- name: Setup atop
become: true
ansible.builtin.copy:
dest: "/etc/default/atop"
content: |
# This file is generated by Ansible, do not modify
LOGOPTS="-R"
LOGINTERVAL={{ atop_interval }}
LOGGENERATIONS=28
LOGPATH=/var/log/atop
mode: 0644
owner: root
group: root
register: atop_conf


- name: Start and Enable atop
become: yes
ansible.builtin.service:
name: atop
state: started
enabled: yes

- name: restart atop
become: yes
service:
name: atop
state: restarted
when: atop_conf.changed

0 comments on commit c65d261

Please sign in to comment.