diff options
author | Ole Mathias Heggem <olemathias.aa.heggem@gmail.com> | 2023-11-23 20:14:24 +0100 |
---|---|---|
committer | Ole Mathias Heggem <olemathias.aa.heggem@gmail.com> | 2023-11-23 20:14:24 +0100 |
commit | abd3fba2abb66738c9eac00d3ed86e965584e4a8 (patch) | |
tree | e72f1a30dfec9295f0e09812d73b50c2f2a3973d /ansible/roles/snmp/tasks | |
parent | 09710c061d5b8ae86b3dfe49f4b8936c13a10535 (diff) |
fix: cleanup and format ansible playbook
Diffstat (limited to 'ansible/roles/snmp/tasks')
-rw-r--r-- | ansible/roles/snmp/tasks/main.yml | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/ansible/roles/snmp/tasks/main.yml b/ansible/roles/snmp/tasks/main.yml index 6056a25..85a88cd 100644 --- a/ansible/roles/snmp/tasks/main.yml +++ b/ansible/roles/snmp/tasks/main.yml @@ -1,25 +1,29 @@ - name: Create data directory - file: + ansible.builtin.file: path: /opt/gondul/data state: directory mode: 0755 -- name: register mibdir - stat: + +- name: Register mibdir + ansible.builtin.stat: path: /opt/gondul/data/mibs register: mibdir + - name: Get mibs - command: /opt/gondul/extras/tools/get_mibs.sh + 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 - copy: + ansible.builtin.copy: dest: /etc/systemd/system/gondul-snmp.service src: gondul-snmp.service notify: restart gondul-snmp + - name: Enable snmp service - systemd: + ansible.builtin.systemd: name: gondul-snmp.service enabled: yes - notify: restart gondul-snmp + notify: restart gondul-snmp
\ No newline at end of file |