summaryrefslogtreecommitdiff
path: root/roles/atop/tasks/main.yml
diff options
context:
space:
mode:
authorDmitry Ilvokhin <d@ilvokhin.com>2024-01-06 18:31:09 +0000
committerDmitry Ilvokhin <d@ilvokhin.com>2024-01-06 18:31:09 +0000
commita2f60b8691706d67c1b5446a78f8bebd541f554c (patch)
tree1ad6835d702d361805f2c04ff5a2babbb0c71076 /roles/atop/tasks/main.yml
parentdb46530e3349439f4417efab5af7b38e1ad928d1 (diff)
downloadinfra-a2f60b8691706d67c1b5446a78f8bebd541f554c.tar.gz
infra-a2f60b8691706d67c1b5446a78f8bebd541f554c.tar.bz2
infra-a2f60b8691706d67c1b5446a78f8bebd541f554c.zip
Migrate essential role to playbook completely
Diffstat (limited to 'roles/atop/tasks/main.yml')
-rw-r--r--roles/atop/tasks/main.yml38
1 files changed, 38 insertions, 0 deletions
diff --git a/roles/atop/tasks/main.yml b/roles/atop/tasks/main.yml
new file mode 100644
index 0000000..7617f68
--- /dev/null
+++ b/roles/atop/tasks/main.yml
@@ -0,0 +1,38 @@
+- name: Install atop
+ ansible.builtin.package:
+ name:
+ - atop
+ state: present
+
+- name: Setup per-minute atop snapshot
+ ansible.builtin.lineinfile:
+ dest: /etc/default/atop
+ state: present
+ regexp: '^#?LOGINTERVAL='
+ line: 'LOGINTERVAL=60'
+ owner: root
+ group: root
+ mode: u+rw,g+r,o+r
+ notify:
+ - Restart atop
+
+- name: Setup logrotate to save 7 days of logs for atop
+ ansible.builtin.lineinfile:
+ dest: /etc/default/atop
+ state: present
+ regexp: '^#?LOGGENERATIONS='
+ line: 'LOGGENERATIONS=7'
+ owner: root
+ group: root
+ mode: u+rw,g+r,o+r
+ notify:
+ - Restart atop
+
+- name: Enable atop systemd service and logrotate timer
+ ansible.builtin.service:
+ name: '{{ item }}'
+ enabled: yes
+ state: started
+ loop:
+ - atop
+ - atop-rotate.timer