-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.sls
41 lines (35 loc) · 1.12 KB
/
init.sls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
install_prerequisites:
cmd.run:
- name: yum -y install gcc libpcap-devel pcre-devel libyaml-devel file-devel zlib-devel jansson-devel nss-devel libcap-ng-devel libnet-devel tar make libnetfilter_queue-devel lua-devel
/usr/src/suricata-3.1.tar.gz:
file.managed:
- source: salt://files/suricata_sources/suricata-3.1.tar.gz
- unless:
- ls /usr/src/suricata-3.1.tar.gz
extract_suricata:
cmd.run:
- name: tar xfvz /usr/src/suricata-3.1.tar.gz --directory=/usr/src
- unless:
- ls /usr/src/suricata-3.1
install_suricata:
cmd.run:
- name: |
cd /usr/src/suricata-3.1
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-nfqueue --enable-lua
make install-full && ldconfig
- cwd: /usr/src/suricata-3.1
- timeout: 1000
- shell: /bin/bash
- unless:
- ls /bin/suricata
/etc/init.d/suricata:
file.managed:
- source: salt://files/suricata
- unless:
- ls /etc/init.d/suricata
modify-suri-init:
cmd.run:
- name: chmod +x /etc/init.d/suricata
/etc/suricata/suricata.yaml
file.managed:
- source: salt://files/suricata.yaml