removed insertafter and corrected syntax

This commit is contained in:
2023-07-18 09:56:28 +02:00
parent 289f813f95
commit bc2fc0dc6e

View File

@@ -59,18 +59,16 @@
- name: server | snmpd | set sysLocation - name: server | snmpd | set sysLocation
lineinfile: lineinfile:
path: "{{ snmpd_conf }}" path: "{{ snmpd_conf }}"
line: "^sysLocation.*$" regexp: '^sysLocation.*$'
state: present state: present
line: "sysLocation {{ snmp_location }}" line: "sysLocation {{ snmp_location }}"
insertafter: "# SECTION: System Information Setup"
- name: server | snmpd | set sysContact - name: server | snmpd | set sysContact
lineinfile: lineinfile:
path: "{{ snmpd_conf }}" path: "{{ snmpd_conf }}"
line: "^sysContact.*$" regexp: '^sysContact.*$'
state: present state: present
line: "sysContact {{ snmp_contact }}" line: "sysContact {{ snmp_contact }}"
insertafter: "# SECTION: System Information Setup"
- name: server | snmpd | enable service on all interfaces - name: server | snmpd | enable service on all interfaces
lineinfile: lineinfile: