Skip to content

Commit

Permalink
snmp teardown playbook
Browse files Browse the repository at this point in the history
  • Loading branch information
mbukatov committed Nov 10, 2017
1 parent b5470f2 commit b232411
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions test_teardown.snmp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---

- hosts: usm_client
remote_user: root
vars:
qe_snmp_user: "tendrlTrapUser"
tasks:

- name: Stop and disable snmptrapd
service:
name: snmptrapd
state: stopped
enabled: no

- name: Remove tendrluser (SNMPv3 user) from snmptrapd.conf
lineinfile:
dest: /etc/snmp/snmptrapd.conf
regexp: "{{ item }}"
state: absent
with_items:
- '^authUser.*{{ qe_snmp_user }}'
- '^createUser.*{{ qe_snmp_user }}'

- hosts: usm_server
remote_user: root
vars:
qe_snmp_user: "tendrlTrapUser"
qe_snmp_auth_pass: "sL0pdokt4Y6FXc5XXp5KS0wuj6cWZPAEYfPv9z5NGH4="
qe_snmp_priv_pass : "jHaJ6V2523gu1PfNu0FGa44lkx2yVOznaCpbbQDBew4="
handlers:
- name: restart tendrl-notifier
service:
name=tendrl-notifier
state=restarted
tasks:

- name: Remove snmp.conf.yaml file
file:
dest: /etc/tendrl/notifier/snmp.conf.yaml
state: absent
notify:
- restart tendrl-notifier

0 comments on commit b232411

Please sign in to comment.