Skip to content

Commit cdd8c10

Browse files
author
Petr Velan
committed
Merge branch 'devel'
2 parents 1c037a2 + e71597e commit cdd8c10

File tree

166 files changed

+17327
-5441
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+17327
-5441
lines changed

Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ACLOCAL_AMFLAGS = -I m4
22

3-
EXTRA_DIST = README.md LICENSE
3+
EXTRA_DIST = README.md LICENSE docker
44

55
SUBDIRS = base \
66
tools/fbitconvert \

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@
1818
* [fbitmerge](#fbitmerge)
1919
* [profilesdaemon](#profilesdaemon)
2020
6. [Howto build](#build)
21-
7. [RPM](#rpm)
22-
8. [FastBit](#fastbit)
23-
9. [Contact us](#contact)
21+
7. [Docker](#docker)
22+
8. [RPM](#rpm)
23+
9. [FastBit](#fastbit)
24+
10. [Contact us](#contact)
2425
* [Reporting bugs](#bug)
2526
* [Forum](#mailing)
2627

@@ -79,7 +80,7 @@ More info in it's [README](tools/fbitdump/)
7980

8081
###<a name="fbitexpire"></a> fbitexpire
8182

82-
Daemon for removal old data.
83+
Daemon for removing old data.
8384

8485
More info in it's [README](tools/fbitexpire/)
8586

@@ -118,6 +119,14 @@ Or you can build each part (collector, tool(s), extarnal plugin(s)) separately.
118119
The projects that depend on ipfixcol headers check the reltive path to base/header directory to use headers.
119120
When project is separated from the structure, it needs to have the headers installed (ipfixcol-devel package).
120121

122+
##<a name="docker"></a> Docker
123+
124+
IPFIXcol can be used with Docker. See [Docker howto](docker).
125+
126+
##<a name="ansible"></a> Ansible
127+
128+
IPFIXcol can also be installed using Ansible orchestration. See [Ansible howto](ansible).
129+
121130
##<a name="rpm"></a> RPM
122131
Each part of framework supports building rpm packages by running
123132

ansible/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# <a name="top"></a>Installing IPFIXcol using Ansible
2+
3+
If you are familiar with Ansible, you can use it to easily install IPFIXcol on any target machine. Provided playbook allows you to separately install:
4+
* dependencies for IPFIXcol
5+
* IPFIXcol base
6+
* any IPFIXcol plugin (requires base first)
7+
* IPFIXcol tools (e.g. fbitdump)
8+
9+
The Ansible orchestration was tested on following systems:
10+
* Debian Jessie (8.5)
11+
* Ubuntu Xenial (16.04 LTS)
12+
* CentOS 7 (7.2.1511)
13+
* Fedora 24
14+
15+
If you want to orchestrate latest Fedora systems, make sure your Ansible version contains the `dnf` module (versions >= 1.9.4). Tested version is 2.1.0.
16+
17+
## <a name="howto"></a>Howto use IPFIXcol playbook
18+
19+
Installing IPFIXcol with Ansible is fairly simple. First, put target machines into the hosts file. The default target is localhost.
20+
```
21+
[ipfixcol-hosts]
22+
localhost
23+
```
24+
To install the entire collector including all (exceptions apply) plugins and tools, use
25+
```
26+
ansible-playbook -i hosts ipfixcol.yml
27+
```
28+
To see what this command would do, use `--check` switch with `ansible-playbook`
29+
30+
If you want only dependencies for basic IPFIXcol without plugins, use
31+
```
32+
ansible-playbook -i hosts ipfixcol.yml --tags dependencies
33+
```
34+
There is a tag for each plugin and its dependency. LibFastbit library can be installed separately as well.
35+
36+
## <a name="libfastbit"></a>LibFastbit compilation
37+
38+
The LibFastbit is a fairly large beast and takes some time to compile. Therefore, we usually install it using binaries, which are pre-compiled for all supported systems (see above). However, if you are installing on unsupported an distribution or you just want to build from sources, you can force this by using `--extra-vars "build_fastbit_compile=true"`

ansible/hosts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[ipfixcol-hosts]
2+
localhost

ansible/ipfixcol.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- hosts: ipfixcol-hosts
2+
roles:
3+
- ipfixcol

ansible/roles/ipfixcol/tasks/base.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# IPFIXcol build
2+
- name: Clone IPFIXcol git
3+
git: repo={{ build.git }} dest={{ build.dir }} version={{ build.branch }}
4+
5+
- name: Build IPFIXcol base
6+
command: >
7+
{{ item }}
8+
chdir={{ build.dir }}/base/
9+
creates=/tmp/ipfixcol-base.installed
10+
with_items:
11+
- "{{ build.cmds }}"
12+
- ldconfig
13+
- "touch /tmp/ipfixcol-base.installed"
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Dependencies for IPFIXcol base
2+
- name: Check for yum packaging system
3+
set_fact:
4+
pkg_type: yum
5+
when: ansible_pkg_mgr == 'yum' or ansible_pkg_mgr == 'dnf'
6+
tags: always
7+
- name: Check for apt packaging system
8+
set_fact:
9+
pkg_type: apt
10+
when: ansible_pkg_mgr == 'apt'
11+
tags: always
12+
13+
- name: Include dependency package variables
14+
include_vars: "packages.{{ pkg_type }}.yml"
15+
tags: always
16+
17+
- name: Install dnf support for Fedora
18+
command: dnf -y install python2-dnf
19+
when: ansible_pkg_mgr == 'dnf'
20+
tags: dependencies
21+
22+
- name: Install dependencies for IPFIXcol
23+
action: "{{ ansible_pkg_mgr }} name={{ item }} state=latest"
24+
with_items: "{{ packages.base }}"
25+
tags: dependencies
26+
27+
- name: Download FastBit compiled library
28+
include: libfastbit.yml
29+
tags:
30+
- fastbit_lib
31+
- fastbit
32+
- fbitmerge
33+
- fbitdump
34+
35+
- name: postgres dependencies
36+
action: "{{ ansible_pkg_mgr }} name={{ item }} state=latest"
37+
with_items: "{{ packages.postgres }}"
38+
tags: postgres
39+
40+
- name: GeoIP dependencies
41+
action: "{{ ansible_pkg_mgr }} name={{ item }} state=latest"
42+
with_items: "{{ packages.geoip }}"
43+
tags: geoip
44+
45+
- name: stats dependencies
46+
action: "{{ ansible_pkg_mgr }} name={{ item }} state=latest"
47+
with_items: "{{ packages.stats }}"
48+
tags:
49+
- profile_stats
50+
- stats
51+
52+
- name: uid dependencies
53+
action: "{{ ansible_pkg_mgr }} name={{ item }} state=latest"
54+
with_items: "{{ packages.uid }}"
55+
tags: uid
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Build input plugins
2+
3+
# nfdump
4+
- name: Build nfdump input plugin
5+
command: >
6+
{{ item }}
7+
chdir={{ build.dir }}/plugins/input/nfdump
8+
creates=/usr/local/share/ipfixcol/plugins/ipfixcol-nfdump-input.so
9+
with_items: "{{ build.cmds }}"
10+
tags: nfdump-input
11+
12+
# udp_cpg - requires libcpg not available fedora and centos repos
13+
#- name: Build UDP CPG input plugin
14+
# command: >
15+
# {{ item }}
16+
# chdir={{ build.dir }}/plugins/input/udp_cpg
17+
# creates=/usr/local/share/ipfixcol/plugins/ipfixcol-udp_cpg-input.so
18+
# with_items: "{{ build.cmds }}"
19+
# tags: udp_cpg
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Intermediate plugins
2+
3+
# geoip
4+
- name: Build GeoIP intermediate plugin
5+
command: >
6+
{{ item }}
7+
chdir={{ build.dir }}/plugins/intermediate/geoip
8+
creates=/usr/local/share/ipfixcol/plugins/ipfixcol-geoip-inter.so
9+
with_items: "{{ build.cmds }}"
10+
tags: geoip
11+
12+
# profiler
13+
- name: Build profiler intermediate plugin
14+
command: >
15+
{{ item }}
16+
chdir={{ build.dir }}/plugins/intermediate/profiler
17+
creates=/usr/local/share/ipfixcol/plugins/ipfixcol-profiler-inter.so
18+
with_items: "{{ build.cmds }}"
19+
tags: profiler
20+
21+
22+
# profile_stats
23+
- name: Build profile_stats intermediate plugin
24+
command: >
25+
{{ item }}
26+
chdir={{ build.dir }}/plugins/intermediate/profile_stats
27+
creates=/usr/local/share/ipfixcol/plugins/ipfixcol-profilestats-inter.so
28+
with_items: "{{ build.cmds }}"
29+
tags: profile_stats
30+
31+
# stats
32+
- name: Build stats intermediate plugin
33+
command: >
34+
{{ item }}
35+
chdir={{ build.dir }}/plugins/intermediate/stats
36+
creates=/usr/local/share/ipfixcol/plugins/ipfixcol-stats-inter.so
37+
with_items: "{{ build.cmds }}"
38+
tags: stats
39+
40+
# uid
41+
- name: Build uid intermediate plugin
42+
command: >
43+
{{ item }}
44+
chdir={{ build.dir }}/plugins/intermediate/uid
45+
creates=/usr/local/share/ipfixcol/plugins/ipfixcol-uid-inter.so
46+
with_items: "{{ build.cmds }}"
47+
tags: uid
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Install libfastbit by either downloading precompiled
2+
# binaries or combiling from git
3+
4+
# Install using binaries
5+
- name: Download FastBit compiled library
6+
get_url: >
7+
url={{ build.fastbit.url }}/libfastbit-{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.tar.gz
8+
dest=/tmp/{{ build.fastbit.archive }}
9+
when: not (build_fastbit_compile | bool)
10+
11+
- name: Install FastBit library
12+
command: "{{ item }} chdir=/tmp/ creates=/tmp/libfastbit.installed"
13+
with_items:
14+
- "tar -xzpf {{ build.fastbit.archive }} -C /"
15+
# move pkgconfig file to path common to all supported distributions
16+
- "mv /usr/local/lib/pkgconfig/fastbit.pc /usr/share/pkgconfig/fastbit.pc"
17+
- "ldconfig"
18+
- "touch /tmp/libfastbit.installed"
19+
when: not (build_fastbit_compile | bool)
20+
21+
# Install from sources (https://github.com/CESNET/libfastbit)
22+
- name: Clone libfastbit repository
23+
git: repo={{ build.fastbit.git }} dest={{ build.fastbit.dir }}
24+
when: build_fastbit_compile | bool
25+
ignore_errors: yes
26+
27+
- name: Build libfastbit
28+
command: >
29+
{{ item }}
30+
chdir={{ build.fastbit.dir }}
31+
creates=/tmp/libfastbit.installed
32+
with_items:
33+
- "autoreconf -i"
34+
- "./configure --disable-static"
35+
- "make"
36+
- "make install"
37+
- "mv /usr/local/lib/pkgconfig/fastbit.pc /usr/share/pkgconfig/fastbit.pc"
38+
- "ldconfig"
39+
- "touch /tmp/libfastbit.installed"
40+
when: build_fastbit_compile | bool

0 commit comments

Comments
 (0)