From 29a4376533bec129868e91929844b687c5bc8c1f Mon Sep 17 00:00:00 2001 From: Mega Tonnage Date: Thu, 24 Oct 2019 23:01:06 +1100 Subject: [PATCH 1/3] Fix windows registry editing task --- tasks/distribution/Windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/distribution/Windows.yml b/tasks/distribution/Windows.yml index bba5664..1eb170a 100644 --- a/tasks/distribution/Windows.yml +++ b/tasks/distribution/Windows.yml @@ -9,7 +9,7 @@ - name: 'windows : setting SNMP' win_regedit: - path: 'HKLM:\\SYSTEM\\CurrentControlSet\\Services\\SNMP\\Parameters\\{{ item.path }}' + path: 'HKLM:\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\{{ item.path }}' name: '{{ item.name }}' type: '{{ item.type }}' data: '{{ item.data }}' From 72da7adfc66b56318784b63f7450964d2273059e Mon Sep 17 00:00:00 2001 From: Mega Tonnage Date: Thu, 24 Oct 2019 23:56:40 +1100 Subject: [PATCH 2/3] Fix address misspelling: /adress/address/ - will break existing playbooks --- README.md | 6 +++--- defaults/main.yml | 8 ++++---- .../Microsoft Windows 10 Pro-10.0.17763.0.yml | 4 ++-- tasks/distribution/Windows.yml | 4 ++-- templates/snmp/snmpd.conf.j2 | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 74081f8..7df6e23 100644 --- a/README.md +++ b/README.md @@ -23,9 +23,9 @@ ansible-galaxy install sbaerlocher.snmp | snmp_encryption | snmp_encryption | SNMP Encryption | | snmp_contact | | Optional: System Contact | | snmp_location | | Optional: System Location | -| snmp_agentadress_protocol.ipvX | udp / udp6 | Optional: SNMP Protocol, X for ipv4 or ipv6 -| snmp_agentadress_adress.ipvX | {{ ansible_default_ipv4.address }} / {{ ansible_default_ipv6.address }} | Optional: SNMP bind address, X for ipv4 or ipv6 | -| snmp_agentadress_port.ipvX | 161 / 161 | Optional: SNMP port, X for ipv4 or ipv6 | +| snmp_agentaddress_protocol.ipvX | udp / udp6 | Optional: SNMP Protocol, X for ipv4 or ipv6 +| snmp_agentaddress_address.ipvX | {{ ansible_default_ipv4.address }} / {{ ansible_default_ipv6.address }} | Optional: SNMP bind address, X for ipv4 or ipv6 | +| snmp_agentaddress_port.ipvX | 161 / 161 | Optional: SNMP port, X for ipv4 or ipv6 | ## Dependencies diff --git a/defaults/main.yml b/defaults/main.yml index 2f3d8ca..291d917 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -5,18 +5,18 @@ snmp_additional_packages: [] snmp_encryption: snmp_encryption snmp_extension_scripts: '/usr/local/lib/snmpd' snmp_logging_options: '' -snmp_access_adress: 0.0.0.0 +snmp_access_address: 0.0.0.0 snmp_monitoring_server: 0.0.0.0 snmp_password: snmp_password snmp_user: snmp -snmp_agentadress_protocol: +snmp_agentaddress_protocol: ipv4: udp ipv6: udp6 -snmp_agentadress_adress: +snmp_agentaddress_address: ipv4: "{{ ansible_default_ipv4.address if ansible_default_ipv4.address is defined else '127.0.0.1' }}" ipv6: "{{ ansible_default_ipv6.address if ansible_default_ipv6.address is defined else '::1' }}" -snmp_agentadress_port: +snmp_agentaddress_port: ipv4: 161 ipv6: 161 diff --git a/tasks/distribution/Microsoft Windows 10 Pro-10.0.17763.0.yml b/tasks/distribution/Microsoft Windows 10 Pro-10.0.17763.0.yml index 1de095e..280ba3c 100644 --- a/tasks/distribution/Microsoft Windows 10 Pro-10.0.17763.0.yml +++ b/tasks/distribution/Microsoft Windows 10 Pro-10.0.17763.0.yml @@ -31,7 +31,7 @@ - path: PermittedManagers name: '1' type: string - data: '{{ snmp_access_adress | default() }}' + data: '{{ snmp_access_address | default() }}' - path: RFC1156Agent name: sysContact type: string @@ -47,7 +47,7 @@ # notify: # - restart win snmp -- name: 'windows : set remote IP-Adresss' +- name: 'windows : set remote IP-Address' set_fact: snmp_remoteip: "{{ lookup('dig', snmp_monitoring_server ) }}" when: not snmp_monitoring_server | ipaddr diff --git a/tasks/distribution/Windows.yml b/tasks/distribution/Windows.yml index 1eb170a..3d943a3 100644 --- a/tasks/distribution/Windows.yml +++ b/tasks/distribution/Windows.yml @@ -17,7 +17,7 @@ - path: PermittedManagers name: '1' type: string - data: '{{ snmp_access_adress | default() }}' + data: '{{ snmp_access_address | default() }}' - path: RFC1156Agent name: sysContact type: string @@ -33,7 +33,7 @@ notify: - restart win snmp -- name: 'windows : set remote IP-Adresss' +- name: 'windows : set remote IP-Address' set_fact: snmp_remoteip: "{{ lookup('dig', snmp_monitoring_server ) }}" when: not snmp_monitoring_server | ipaddr diff --git a/templates/snmp/snmpd.conf.j2 b/templates/snmp/snmpd.conf.j2 index 039bdb7..08acb5a 100644 --- a/templates/snmp/snmpd.conf.j2 +++ b/templates/snmp/snmpd.conf.j2 @@ -4,10 +4,10 @@ createUser {{ snmp_user }} SHA {{ snmp_password }} AES {{ snmp_encryption }} rouser {{ snmp_user }} priv {% if ansible_default_ipv4.address is defined %} -agentAddress {{ snmp_agentadress_protocol.ipv4 }}:{{ snmp_agentadress_adress.ipv4 }}:{{ snmp_agentadress_port.ipv4 }} +agentAddress {{ snmp_agentaddress_protocol.ipv4 }}:{{ snmp_agentaddress_address.ipv4 }}:{{ snmp_agentaddress_port.ipv4 }} {% endif %} {% if ansible_default_ipv6.address is defined %} -agentAddress {{ snmp_agentadress_protocol.ipv6 }}:{{ snmp_agentadress_adress.ipv6 }}:{{ snmp_agentadress_port.ipv6 }} +agentAddress {{ snmp_agentaddress_protocol.ipv6 }}:{{ snmp_agentaddress_address.ipv6 }}:{{ snmp_agentaddress_port.ipv6 }} {% endif %} {% if snmp_location is defined %} From ca13d462d485856cacdb9870c62f9b0e225512b2 Mon Sep 17 00:00:00 2001 From: Mega Tonnage Date: Fri, 25 Oct 2019 00:06:09 +1100 Subject: [PATCH 3/3] Revert "Fix address misspelling: /adress/address/ - will break existing playbooks" - moved to branch This reverts commit 72da7adfc66b56318784b63f7450964d2273059e. --- README.md | 6 +++--- defaults/main.yml | 8 ++++---- .../Microsoft Windows 10 Pro-10.0.17763.0.yml | 4 ++-- tasks/distribution/Windows.yml | 4 ++-- templates/snmp/snmpd.conf.j2 | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 7df6e23..74081f8 100644 --- a/README.md +++ b/README.md @@ -23,9 +23,9 @@ ansible-galaxy install sbaerlocher.snmp | snmp_encryption | snmp_encryption | SNMP Encryption | | snmp_contact | | Optional: System Contact | | snmp_location | | Optional: System Location | -| snmp_agentaddress_protocol.ipvX | udp / udp6 | Optional: SNMP Protocol, X for ipv4 or ipv6 -| snmp_agentaddress_address.ipvX | {{ ansible_default_ipv4.address }} / {{ ansible_default_ipv6.address }} | Optional: SNMP bind address, X for ipv4 or ipv6 | -| snmp_agentaddress_port.ipvX | 161 / 161 | Optional: SNMP port, X for ipv4 or ipv6 | +| snmp_agentadress_protocol.ipvX | udp / udp6 | Optional: SNMP Protocol, X for ipv4 or ipv6 +| snmp_agentadress_adress.ipvX | {{ ansible_default_ipv4.address }} / {{ ansible_default_ipv6.address }} | Optional: SNMP bind address, X for ipv4 or ipv6 | +| snmp_agentadress_port.ipvX | 161 / 161 | Optional: SNMP port, X for ipv4 or ipv6 | ## Dependencies diff --git a/defaults/main.yml b/defaults/main.yml index 291d917..2f3d8ca 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -5,18 +5,18 @@ snmp_additional_packages: [] snmp_encryption: snmp_encryption snmp_extension_scripts: '/usr/local/lib/snmpd' snmp_logging_options: '' -snmp_access_address: 0.0.0.0 +snmp_access_adress: 0.0.0.0 snmp_monitoring_server: 0.0.0.0 snmp_password: snmp_password snmp_user: snmp -snmp_agentaddress_protocol: +snmp_agentadress_protocol: ipv4: udp ipv6: udp6 -snmp_agentaddress_address: +snmp_agentadress_adress: ipv4: "{{ ansible_default_ipv4.address if ansible_default_ipv4.address is defined else '127.0.0.1' }}" ipv6: "{{ ansible_default_ipv6.address if ansible_default_ipv6.address is defined else '::1' }}" -snmp_agentaddress_port: +snmp_agentadress_port: ipv4: 161 ipv6: 161 diff --git a/tasks/distribution/Microsoft Windows 10 Pro-10.0.17763.0.yml b/tasks/distribution/Microsoft Windows 10 Pro-10.0.17763.0.yml index 280ba3c..1de095e 100644 --- a/tasks/distribution/Microsoft Windows 10 Pro-10.0.17763.0.yml +++ b/tasks/distribution/Microsoft Windows 10 Pro-10.0.17763.0.yml @@ -31,7 +31,7 @@ - path: PermittedManagers name: '1' type: string - data: '{{ snmp_access_address | default() }}' + data: '{{ snmp_access_adress | default() }}' - path: RFC1156Agent name: sysContact type: string @@ -47,7 +47,7 @@ # notify: # - restart win snmp -- name: 'windows : set remote IP-Address' +- name: 'windows : set remote IP-Adresss' set_fact: snmp_remoteip: "{{ lookup('dig', snmp_monitoring_server ) }}" when: not snmp_monitoring_server | ipaddr diff --git a/tasks/distribution/Windows.yml b/tasks/distribution/Windows.yml index 3d943a3..1eb170a 100644 --- a/tasks/distribution/Windows.yml +++ b/tasks/distribution/Windows.yml @@ -17,7 +17,7 @@ - path: PermittedManagers name: '1' type: string - data: '{{ snmp_access_address | default() }}' + data: '{{ snmp_access_adress | default() }}' - path: RFC1156Agent name: sysContact type: string @@ -33,7 +33,7 @@ notify: - restart win snmp -- name: 'windows : set remote IP-Address' +- name: 'windows : set remote IP-Adresss' set_fact: snmp_remoteip: "{{ lookup('dig', snmp_monitoring_server ) }}" when: not snmp_monitoring_server | ipaddr diff --git a/templates/snmp/snmpd.conf.j2 b/templates/snmp/snmpd.conf.j2 index 08acb5a..039bdb7 100644 --- a/templates/snmp/snmpd.conf.j2 +++ b/templates/snmp/snmpd.conf.j2 @@ -4,10 +4,10 @@ createUser {{ snmp_user }} SHA {{ snmp_password }} AES {{ snmp_encryption }} rouser {{ snmp_user }} priv {% if ansible_default_ipv4.address is defined %} -agentAddress {{ snmp_agentaddress_protocol.ipv4 }}:{{ snmp_agentaddress_address.ipv4 }}:{{ snmp_agentaddress_port.ipv4 }} +agentAddress {{ snmp_agentadress_protocol.ipv4 }}:{{ snmp_agentadress_adress.ipv4 }}:{{ snmp_agentadress_port.ipv4 }} {% endif %} {% if ansible_default_ipv6.address is defined %} -agentAddress {{ snmp_agentaddress_protocol.ipv6 }}:{{ snmp_agentaddress_address.ipv6 }}:{{ snmp_agentaddress_port.ipv6 }} +agentAddress {{ snmp_agentadress_protocol.ipv6 }}:{{ snmp_agentadress_adress.ipv6 }}:{{ snmp_agentadress_port.ipv6 }} {% endif %} {% if snmp_location is defined %}