system-config/playbooks/roles/snmpd/tasks/main.yaml
James E. Blair dceb09d886 Add snmpd role and add it to base
Change-Id: I00bf872e8504efb26d20832f1da82da8cfe87258
2018-08-27 07:34:36 -07:00

29 lines
618 B
YAML

- name: Include OS-specific variables
include_vars: "{{ lookup('first_found', params) }}"
vars:
params:
files: "{{ distro_lookup_path }}"
paths:
- 'vars'
- name: Install snmpd
package:
state: present
name: '{{ package }}'
- name: Write snmpd config file
template:
src: snmpd.conf
dest: /etc/snmp/snmpd.conf
mode: 0444
notify:
- Restart snmpd
# We don't usually ensure services are running, but snmp is generally
# not public facing and is easy to overlook.
- name: Enable snmpd
service:
name: "{{ service_name }}"
enabled: true
state: started