- ntop setup for raspberry pi. will add ntop for ubuntu versions later

This commit is contained in:
Pi
2019-07-19 15:27:15 -04:00
parent 107eb82518
commit 052b3b7aa0
6 changed files with 47 additions and 0 deletions

3
hosts
View File

@@ -65,3 +65,6 @@ wes-host3
# there must only be one sipserver
wes-host2
[ntopng]
# hosts running ntop

View File

@@ -46,3 +46,6 @@
roles:
- sipp
- sipserver
- hosts: ntopng
roles:
- ntopng

4
ntopng.yml Normal file
View File

@@ -0,0 +1,4 @@
---
- hosts: ntopng
roles:
- ntopng

View File

@@ -0,0 +1,28 @@
---
- name: Check if ntopng is installed
become: yes
command: dpkg-query -W "{{ ntopng_deb }}"
register: ntopng_check_deb
failed_when: ntopng_check_deb.rc > 1
changed_when: ntopng_check_deb.rc == 1
- name: Download ntopng
get_url:
url="{{ ntopng_deb_url }}"
dest="/home/{{ ansible_env.USER }}/Downloads/{{ ntopng_deb }}.deb"
when: ntopng_check_deb.rc == 1
- name: Install ntopng source
become: yes
apt: deb="/home/{{ ansible_env.USER }}/Downloads/{{ ntopng_deb }}.deb"
when: ntopng_check_deb.rc == 1
- name: install ntopng
become: yes
apt:
name: ntopng
state: present
update_cache: yes
- name: start ntopng
become: yes
systemd:
name: ntopng.service
state: restarted
enabled: yes

View File

@@ -0,0 +1,2 @@
ntopng_deb: apt-ntop_1.0.190416-469_all
ntopng_deb_url: http://packages.ntop.org/RaspberryPI/apt-ntop_1.0.190416-469_all.deb

7
test.yaml Normal file
View File

@@ -0,0 +1,7 @@
---
- hosts: all
tasks:
- name: print debug message
debug:
msg: "{{ ansible_lsb.id }}_{{ ansible_lsb.major_release }}"