diff --git a/handlers/main.yml b/handlers/main.yml index d29c376..d5824d9 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,7 +1,14 @@ # handlers file --- -- name: restart snmpd +- name: remove persistent data file + ansible.builtin.file: + path: /var/lib/snmp/snmpd.conf + state: absent + listen: restart snmpd + +- name: restart service ansible.builtin.service: name: snmpd state: restarted + listen: restart snmpd when: service_default_state | default('started') == 'started'