Skip to content

Commit

Permalink
Stop the service and remove the /var/lib/snmp/snmpd.conf file before …
Browse files Browse the repository at this point in the history
…updating

This fixes an issue where the generates hashes are not being re-generated on Debian.
Stopping the previous service, deleting the file will cause snmpd to re-generate the /var/lib/snmp/snmpd.conf config file with the new authentication hashes.
  • Loading branch information
MatthieuCoder authored Dec 27, 2024
1 parent 03e902f commit 203b963
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,20 @@
- snmpd
- snmpd-install

- name: stop the snmp service for editing

Check warning on line 23 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.
ansible.builtin.service:
name: snmpd
state: "stopped"
tags:
- configuration
- snmpd
- snmpd-start-stop-service

- name: delete the old snmp /var/lib/snmp/snmpd.conf

Check warning on line 32 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.
ansible.builtin.file:
state: absent
path: /var/lib/snmp/snmpd.conf

- name: update configuration file - /etc/default/snmpd.conf

Check warning on line 37 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.
ansible.builtin.template:
src: etc/default/snmpd.j2
Expand Down

0 comments on commit 203b963

Please sign in to comment.