access: set up SNMP user for D-Link switches
This commit is contained in:
parent
e51d08c073
commit
57197d7695
8 changed files with 56 additions and 1 deletions
|
@ -7,6 +7,10 @@
|
|||
ansible_ssh_user: '{{ password.user }}'
|
||||
ansible_ssh_pass: '{{ password.pass }}'
|
||||
|
||||
- name: Generate SNMP engine ID from serial number
|
||||
set_fact:
|
||||
snmp_engine_id: '{{ (serial | sha1)[:24] }}'
|
||||
|
||||
- name: Set configuration
|
||||
ansible.netcommon.cli_config:
|
||||
config: '{{ lookup("template", "config-"~manufacturer~"-"~device_type~".j2") }}'
|
||||
|
@ -17,3 +21,6 @@
|
|||
# These lines are not displayed by 'sho ru' and always reported as different, so ignore them.
|
||||
changed_when: result.commands | reject('match', '^(no shutdown|no switchport access vlan|no voice vlan.*|switchport mode access|switchport mode hybrid|interface .*|no enable service web-server https?)$')
|
||||
notify: write config
|
||||
|
||||
- name: Run model-specific tasks
|
||||
include_tasks: '{{ manufacturer~"-"~device_type~".yml" }}'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue