aboutsummaryrefslogtreecommitdiffstats
path: root/ansible/roles/snmp/tasks/main.yml
blob: 33e479b7a0840bd5616e8f5115d0aefb8fadd0cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
- name: Create data directory
  ansible.builtin.file:
    path: /opt/gondul/data
    state: directory
    mode: 0755

- name: Register mibdir
  ansible.builtin.stat:
    path: /opt/gondul/data/mibs
  register: mibdir

- name: Get mibs
  ansible.builtin.command: /opt/gondul/extras/tools/get_mibs.sh
  args:
     chdir: /opt/gondul/data/
  when: not mibdir.stat.exists
  notify: Restart gondul-snmp

- name: Add systemd service file for gondul-snmp
  ansible.builtin.copy:
      dest: /etc/systemd/system/gondul-snmp.service
      src: gondul-snmp.service
  notify: Restart gondul-snmp

- name: Enable snmp service
  ansible.builtin.systemd:
     name: gondul-snmp.service
     enabled: yes
  notify: Restart gondul-snmp