-proper naming for role task files

This commit is contained in:
Pi
2019-02-19 16:27:21 -05:00
parent 21e246b07f
commit f21aa306cf
3 changed files with 0 additions and 0 deletions

34
roles/snmpd/tasks/main.yaml Executable file
View File

@@ -0,0 +1,34 @@
---
- hosts: pi
tasks:
- name: Install snmpd Package
become: yes
apt:
name: ['snmpd']
state: present
update_cache: true
tags: install_snmpd
- lineinfile:
path: /etc/snmp/snmpd.conf
state: present
backrefs: yes
regexp: "{{ item.regexp }}"
line: "{{ item.line }}"
with_items:
- { regexp: '^\s+rocommunity\s+public\s+default\s+-V\s+systemonly', line: ' rocommunity public' }
- { regexp: '^agentAddress\s+udp:127.0.0.1:161', line: 'agentAddress udp:161' }
tags: configure_snmpd
become: true
- name: enable snmpd service and ensure it is not masked
systemd:
name: snmpd
enabled: yes
masked: no
state: restarted
tags: enablestart_snmpd
become: true
- name: set timezone
become: true
timezone:
name: America/New_York
tags: set_timezone