From 9e3e2d65c437d614ac126ed2afe50f944102dc37 Mon Sep 17 00:00:00 2001 From: Rene Mewissen Date: Fri, 14 Jul 2023 18:49:19 +0200 Subject: [PATCH] added SNMPD sysContact --- group_vars/server | 3 ++- roles/server/tasks/utilities/snmpd.yml | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/group_vars/server b/group_vars/server index 3b7209d..1e1a82c 100644 --- a/group_vars/server +++ b/group_vars/server @@ -1,2 +1,3 @@ mta_package: "ssmtp" -defaultSysLocation: "33104 Paderborn, Im Vogtland 49a [51.76365, 8.77816]" \ No newline at end of file +defaultSysLocation: "33104 Paderborn, Im Vogtland 49a [51.76365, 8.77816]" +sysContact: "rene@mewissen.site" \ No newline at end of file diff --git a/roles/server/tasks/utilities/snmpd.yml b/roles/server/tasks/utilities/snmpd.yml index 31de3f9..b4d9d33 100644 --- a/roles/server/tasks/utilities/snmpd.yml +++ b/roles/server/tasks/utilities/snmpd.yml @@ -63,6 +63,13 @@ state: present line: "sysLocation {{ sysLocation | {{ defaultSysLocation }} }}" +- name: server | snmpd | set sysContact + lineinfile: + path: "{{ snmpd_conf }}" + line: "^sysContact.*$" + state: present + line: "sysContact {{ sysContact }}" + - name: server | snmpd | enable service on all interfaces lineinfile: path: "{{ snmpd_conf }}"