58 lines
1.3 KiB
YAML
58 lines
1.3 KiB
YAML
|
# tasks file
|
||
|
---
|
||
|
- name: install dependencies
|
||
|
apt:
|
||
|
name: "{{ snmpd_dependencies }}"
|
||
|
state: "{{ apt_install_state | default('latest') }}"
|
||
|
update_cache: true
|
||
|
cache_valid_time: "{{ apt_update_cache_valid_time | default(3600) }}"
|
||
|
tags:
|
||
|
- configuration
|
||
|
- snmpd
|
||
|
- snmpd-dependencies
|
||
|
|
||
|
- name: install
|
||
|
apt:
|
||
|
name: "{{ snmpd_install }}"
|
||
|
state: "{{ apt_install_state | default('latest') }}"
|
||
|
tags:
|
||
|
- configuration
|
||
|
- snmpd
|
||
|
- snmpd-install
|
||
|
|
||
|
- name: update configuration file - /etc/default/snmpd.conf
|
||
|
template:
|
||
|
src: etc/default/snmpd.j2
|
||
|
dest: /etc/default/snmpd
|
||
|
owner: root
|
||
|
group: root
|
||
|
mode: 0644
|
||
|
notify: restart snmpd
|
||
|
tags:
|
||
|
- configuration
|
||
|
- snmpd
|
||
|
- snmpd-configuration
|
||
|
|
||
|
- name: update configuration file - /etc/snmp/snmpd.conf
|
||
|
template:
|
||
|
src: etc/snmp/snmpd.conf.j2
|
||
|
dest: /etc/snmp/snmpd.conf
|
||
|
owner: root
|
||
|
group: root
|
||
|
mode: 0600
|
||
|
notify: restart snmpd
|
||
|
tags:
|
||
|
- configuration
|
||
|
- snmpd
|
||
|
- snmpd-configuration
|
||
|
|
||
|
- name: start and enable service
|
||
|
service:
|
||
|
name: snmpd
|
||
|
state: "{{ service_default_state | default('started') }}"
|
||
|
enabled: "{{ service_default_enabled | default(true) | bool }}"
|
||
|
tags:
|
||
|
- configuration
|
||
|
- snmpd
|
||
|
- snmpd-start-enable-service
|