prompt for snmp community

This commit is contained in:
Pi
2019-02-21 13:27:41 -05:00
parent 93f8cd5eea
commit 383a1dcf35
2 changed files with 4 additions and 2 deletions

View File

@@ -14,4 +14,6 @@
- hosts: pi
roles:
- snmpd
vars_prompt:
- name: rocommunity
prompt: "Enter SNMP RO community name"

View File

@@ -13,7 +13,7 @@
regexp: "{{ item.regexp }}"
line: "{{ item.line }}"
with_items:
- { regexp: '^\s+rocommunity\s+public\s+default\s+-V\s+systemonly', line: ' rocommunity public' }
- { regexp: '^\s+rocommunity\s+public\s+default\s+-V\s+systemonly', line: ' rocommunity {{ rocommunity }}' }
- { regexp: '^agentAddress\s+udp:127.0.0.1:161', line: 'agentAddress udp:161' }
tags: configure_snmpd
become: true