40 lines
1014 B
YAML
40 lines
1014 B
YAML
---
|
|
- firewalld:
|
|
port: "{{netflow_port}}/udp"
|
|
permanent: true
|
|
state: enabled
|
|
|
|
- name: check if fastnetmon dir exists
|
|
stat:
|
|
path: "{{fastnetmon_clone_dir}}"
|
|
register: dir_present
|
|
|
|
- name: get fastnetmon sources
|
|
shell:
|
|
cmd: git clone https://git.dotya.ml/wanderer/fastnetmon-ng {{fastnetmon_clone_dir}}
|
|
when: not dir_present.stat.exists
|
|
|
|
- name: build and install fastnetmon
|
|
shell:
|
|
cmd:
|
|
cd {{fastnetmon_clone_dir}}/src;
|
|
git checkout fresh-ndpi;
|
|
git apply patches/dev-ndpi.patch;
|
|
cmake -D"USE_NEW_ATOMIC_BUILTINS=ON" -D"ENABLE_AFPACKET_SUPPORT=ON" -D"ENABLE_GOBGP_SUPPORT=ON" -D"BUILD_PLUGIN_RUNNER=ON" -D"BUILD_TESTS=OFF" -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS -Wall -Wextra" . &&
|
|
make clean fastnetmon all install
|
|
chdir: "{{fastnetmon_clone_dir}}/src"
|
|
|
|
- name: run ldconfig
|
|
shell:
|
|
cmd: ldconfig
|
|
|
|
- name: copy config
|
|
template:
|
|
src: fastnetmon.conf.j2
|
|
dest: /etc/fastnetmon.conf
|
|
mode: '0755'
|
|
backup: yes
|
|
ignore_errors: true
|
|
|
|
|