more role organization.
tbd - make use of variables in root/main.yaml
This commit is contained in:
14
main.yaml
14
main.yaml
@@ -1,5 +1,17 @@
|
||||
---
|
||||
- hosts: netflows
|
||||
become: true
|
||||
roles:
|
||||
- netflows
|
||||
- hosts: all
|
||||
roles:
|
||||
- common
|
||||
- hosts: public
|
||||
roles:
|
||||
- public
|
||||
- hosts: smbclient
|
||||
roles:
|
||||
- smbclient
|
||||
- hosts: pi
|
||||
roles:
|
||||
- snmpd
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
---
|
||||
- hosts: all
|
||||
tasks:
|
||||
- name: Upgrade all packages o the latest version
|
||||
- name: Upgrade all packages o the latest version
|
||||
become: true
|
||||
apt:
|
||||
upgrade: yes
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
---
|
||||
- hosts: public
|
||||
tasks:
|
||||
- name: Install ufw packages
|
||||
- name: Install ufw packages
|
||||
package:
|
||||
name: ufw
|
||||
state: present
|
||||
become: true
|
||||
- name: Allow all access from RFC1918 networks to this hosts
|
||||
- name: Allow all access from RFC1918 networks to this hosts
|
||||
ufw:
|
||||
rule: allow
|
||||
src: '{{ item }}'
|
||||
@@ -15,7 +13,7 @@
|
||||
- 172.16.0.0/12
|
||||
- 192.168.0.0/16
|
||||
become: true
|
||||
- name: Allow all access from any Comcast IP Space
|
||||
- name: Allow all access from any Comcast IP Space
|
||||
become: true
|
||||
ufw:
|
||||
rule: allow
|
||||
@@ -180,7 +178,7 @@
|
||||
- 98.241.0.0/16
|
||||
- 98.32.0.0/11
|
||||
|
||||
- name: Enable UFW
|
||||
- name: Enable UFW
|
||||
ufw:
|
||||
state: enabled
|
||||
policy: deny
|
||||
|
||||
9
roles/smbclient/tasks/main.yaml
Executable file
9
roles/smbclient/tasks/main.yaml
Executable file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
- name: enable cron job for smb traffic
|
||||
cron:
|
||||
name: "smbtraff"
|
||||
minute: "*/20"
|
||||
hour: "7-18"
|
||||
weekday: "1-5"
|
||||
job: "/usr/bin/perl -e 'sleep int rand 1199' && /home/pi/scripts/smb-session.sh"
|
||||
tags: smbtraff_cron
|
||||
@@ -1,11 +0,0 @@
|
||||
---
|
||||
- hosts: smbclient
|
||||
tasks:
|
||||
- name: enable cron job for smb traffic
|
||||
cron:
|
||||
name: "smbtraff"
|
||||
minute: "*/20"
|
||||
hour: "7-18"
|
||||
weekday: "1-5"
|
||||
job: "/usr/bin/perl -e 'sleep int rand 1199' && /home/pi/scripts/smb-session.sh"
|
||||
tags: smbtraff_cron
|
||||
@@ -1,14 +1,12 @@
|
||||
---
|
||||
- hosts: pi
|
||||
tasks:
|
||||
- name: Install snmpd Package
|
||||
- name: Install snmpd Package
|
||||
become: yes
|
||||
apt:
|
||||
name: ['snmpd']
|
||||
state: present
|
||||
update_cache: true
|
||||
tags: install_snmpd
|
||||
- lineinfile:
|
||||
- lineinfile:
|
||||
path: /etc/snmp/snmpd.conf
|
||||
state: present
|
||||
backrefs: yes
|
||||
@@ -19,7 +17,7 @@
|
||||
- { 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
|
||||
- name: enable snmpd service and ensure it is not masked
|
||||
systemd:
|
||||
name: snmpd
|
||||
enabled: yes
|
||||
@@ -27,7 +25,7 @@
|
||||
state: restarted
|
||||
tags: enablestart_snmpd
|
||||
become: true
|
||||
- name: set timezone
|
||||
- name: set timezone
|
||||
become: true
|
||||
timezone:
|
||||
name: America/New_York
|
||||
|
||||
Reference in New Issue
Block a user