Skip to content

Commit c65d261

Browse files
committed
ansible: Install atop on Debian based hosts and default to 10s intervals
atop is useful to be able to debug what happened historically.
1 parent 1878716 commit c65d261

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

ansible/roles/base/defaults/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
---
22
__base_packages:
3+
- atop
34
- curl
45
- git
56
- jq
67
- python3-pip
78
- vim
9+
10+
atop_interval: 10

ansible/roles/base/tasks/setup-Debian.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,33 @@
1616
state: stopped
1717
enabled: no
1818
masked: yes
19+
20+
- name: Setup atop
21+
become: true
22+
ansible.builtin.copy:
23+
dest: "/etc/default/atop"
24+
content: |
25+
# This file is generated by Ansible, do not modify
26+
LOGOPTS="-R"
27+
LOGINTERVAL={{ atop_interval }}
28+
LOGGENERATIONS=28
29+
LOGPATH=/var/log/atop
30+
mode: 0644
31+
owner: root
32+
group: root
33+
register: atop_conf
34+
35+
36+
- name: Start and Enable atop
37+
become: yes
38+
ansible.builtin.service:
39+
name: atop
40+
state: started
41+
enabled: yes
42+
43+
- name: restart atop
44+
become: yes
45+
service:
46+
name: atop
47+
state: restarted
48+
when: atop_conf.changed

0 commit comments

Comments
 (0)