Initial run at youtue and facebook traffic generation.
Directory creation.
This commit is contained in:
3
hosts
3
hosts
@@ -40,3 +40,6 @@
|
|||||||
|
|
||||||
[netflows]
|
[netflows]
|
||||||
192.168.50.2
|
192.168.50.2
|
||||||
|
|
||||||
|
[youtube]
|
||||||
|
192.168.50.2
|
||||||
|
|||||||
@@ -14,6 +14,11 @@
|
|||||||
- hosts: pi
|
- hosts: pi
|
||||||
roles:
|
roles:
|
||||||
- snmpd
|
- snmpd
|
||||||
|
- wifi
|
||||||
vars_prompt:
|
vars_prompt:
|
||||||
- name: rocommunity
|
- name: rocommunity
|
||||||
prompt: "Enter SNMP RO community name"
|
prompt: "Enter SNMP RO community name"
|
||||||
|
default: "public"
|
||||||
|
- hosts: youtube
|
||||||
|
roles:
|
||||||
|
- youtube
|
||||||
|
|||||||
@@ -5,3 +5,14 @@
|
|||||||
upgrade: yes
|
upgrade: yes
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
tags: apt_upgrade
|
tags: apt_upgrade
|
||||||
|
- name: Create directories
|
||||||
|
file:
|
||||||
|
path: "{{ item }}"
|
||||||
|
state: directory
|
||||||
|
owner: pi
|
||||||
|
group: pi
|
||||||
|
with_items:
|
||||||
|
- /home/pi/Documents/ftp
|
||||||
|
- /home/pi/Documents/smb
|
||||||
|
- /home/pi/scripts
|
||||||
|
tags: create_dirs
|
||||||
|
|||||||
32
roles/wifi/tasks/main.yaml
Executable file
32
roles/wifi/tasks/main.yaml
Executable file
@@ -0,0 +1,32 @@
|
|||||||
|
---
|
||||||
|
- name: Remove wpasupplicant package
|
||||||
|
become: yes
|
||||||
|
apt:
|
||||||
|
name: ['wpasupplicant']
|
||||||
|
state: absent
|
||||||
|
purge: true
|
||||||
|
tags: remove_wpasupplicant
|
||||||
|
- 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 {{ rocommunity }}' }
|
||||||
|
- { 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
|
||||||
9
roles/youtube/tasks/main.yaml
Executable file
9
roles/youtube/tasks/main.yaml
Executable file
@@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
- name: enable cron job for youtube traffic
|
||||||
|
cron:
|
||||||
|
name: "youtubetraff"
|
||||||
|
minute: "*/30"
|
||||||
|
hour: "7-18"
|
||||||
|
weekday: "1-5"
|
||||||
|
job: "/usr/bin/perl -e 'sleep int rand 900' && /home/pi/scripts/youtube.sh"
|
||||||
|
tags: youtubetraff_cron
|
||||||
Reference in New Issue
Block a user