File tree 9 files changed +82
-35
lines changed
9 files changed +82
-35
lines changed Original file line number Diff line number Diff line change 3
3
---
4
4
stages :
5
5
- test
6
- - commitlint
6
+ - lint
7
7
- name : release
8
8
if : branch = master AND type != pull_request
9
9
@@ -65,16 +65,21 @@ script:
65
65
66
66
jobs :
67
67
include :
68
- # Define the commitlint stage
69
- - stage : commitlint
68
+ # Define the `lint` stage (runs `yamllint` and `commitlint`)
69
+ - stage : lint
70
70
language : node_js
71
71
node_js : lts/*
72
72
before_install : skip
73
73
script :
74
+ # Install and run `yamllint`
75
+ - pip install --user yamllint
76
+ # yamllint disable-line rule:line-length
77
+ - yamllint -s . .yamllint pillar.example test/salt/pillar/default.pillar.sls test/salt/pillar/tables.pillar.sls
78
+ # Install and run `commitlint`
74
79
- npm install @commitlint/config-conventional -D
75
80
- npm install @commitlint/travis-cli -D
76
81
- commitlint-travis
77
- # Define the release stage that runs semantic-release
82
+ # Define the release stage that runs ` semantic-release`
78
83
- stage : release
79
84
language : node_js
80
85
node_js : lts/*
Original file line number Diff line number Diff line change
1
+ # -*- coding: utf-8 -*-
2
+ # vim: ft=yaml
3
+ ---
4
+ # Extend the `default` configuration provided by `yamllint`
5
+ extends : default
6
+
7
+ # Files to ignore completely
8
+ # 1. All YAML files under directory `node_modules/`, introduced during the Travis run
9
+ ignore : |
10
+ node_modules/
11
+
12
+ rules :
13
+ key-duplicates :
14
+ ignore : |
15
+ pillar.example
16
+ line-length :
17
+ # Increase from default of `80`
18
+ # Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)
19
+ max : 88
Original file line number Diff line number Diff line change 1
1
# -*- coding: utf-8 -*-
2
2
# vim: ft=yaml
3
+ ---
3
4
firewall :
4
5
enabled : false
5
6
install : false
@@ -47,4 +48,3 @@ firewall:
47
48
POSTROUTING :
48
49
policy : ACCEPT
49
50
rules : {}
50
-
Original file line number Diff line number Diff line change 1
1
# -*- coding: utf-8 -*-
2
2
# vim: ft=yaml
3
+ ---
3
4
Debian :
4
5
pkgs :
5
6
- iptables
Original file line number Diff line number Diff line change
1
+ # -*- coding: utf-8 -*-
2
+ # vim: ft=yaml
3
+ ---
1
4
firewall :
2
- install: True
3
- enabled: True
4
- strict: True
5
- ipv6: True
5
+ install : true
6
+ enabled : true
7
+ strict : true
8
+ ipv6 : true
6
9
services :
7
10
ssh :
8
- block_nomatch: True
11
+ block_nomatch : true
9
12
ips_allow :
10
13
- 10.0.0.0/8
11
14
- 172.16.0.0/12
12
15
- 192.168.0.0/16
13
16
http :
14
- block_nomatch: False
17
+ block_nomatch : false
15
18
protos :
16
19
- udp
17
20
- tcp
18
21
snmp :
19
- block_nomatch: False
22
+ block_nomatch : false
20
23
protos :
21
24
- udp
22
25
- tcp
@@ -25,17 +28,17 @@ firewall:
25
28
26
29
services_ipv6 :
27
30
ssh :
28
- block_nomatch: False
31
+ block_nomatch : false
29
32
ips_allow :
30
33
- 2a02:2028:773:d01:10a5:f34f:e7ff:f55b/64
31
34
- 2a02:2028:773:d01:1814:28ef:e91b:70b8/64
32
35
http :
33
- block_nomatch: False
36
+ block_nomatch : false
34
37
protos :
35
38
- udp
36
39
- tcp
37
40
snmp :
38
- block_nomatch: False
41
+ block_nomatch : false
39
42
protos :
40
43
- udp
41
44
- tcp
@@ -52,9 +55,11 @@ firewall:
52
55
ips_allow :
53
56
- 2a02:2028:773:d01:1814:28ef:e91b:70b8/64
54
57
55
- #Support nat (ipv4 only)
58
+ # yamllint disable rule:line-length
59
+ # Support nat (ipv4 only)
56
60
# iptables -t nat -A POSTROUTING -o eth0 -s 192.168.18.0/24 -d 10.20.0.2 -j MASQUERADE
57
61
# iptables -t nat -A POSTROUTING -o eth0 -s 192.168.18.0/24 -d 172.31.0.2 -j MASQUERADE
62
+ # yamllint enable rule:line-length
58
63
nat :
59
64
eth0 :
60
65
rules :
@@ -64,14 +69,14 @@ firewall:
64
69
# ## Using the tables.sls state
65
70
66
71
# In this example we iterate over tables (filter, nat, mangle) and
67
- # adds the desired entries
72
+ # adds the desired entries
68
73
firewall :
69
- install: True
70
- enabled: True
71
- strict: True
74
+ install : true
75
+ enabled : true
76
+ strict : true
72
77
73
78
# To use tables, leave services undefined and set this to true
74
- use_tables: True
79
+ use_tables : true
75
80
76
81
filter :
77
82
INPUT :
Original file line number Diff line number Diff line change
1
+ # -*- coding: utf-8 -*-
2
+ # vim: ft=yaml
3
+ ---
1
4
name : default
2
5
title : iptables formula
3
6
maintainer : SaltStack Formulas
Original file line number Diff line number Diff line change
1
+ # -*- coding: utf-8 -*-
2
+ # vim: ft=yaml
3
+ ---
1
4
name : tables
2
5
title : iptables formula
3
6
maintainer : SaltStack Formulas
4
7
license : Apache-2.0
8
+ # yamllint disable-line rule:line-length
5
9
summary : Verify that iptables is installed and configured using tables defined in pillars
6
10
supports :
7
11
- platform-name : debian
Original file line number Diff line number Diff line change
1
+ # -*- coding: utf-8 -*-
2
+ # vim: ft=yaml
3
+ ---
1
4
firewall :
2
- install: True
3
- enabled: True
4
- strict: True
5
- ipv6: False
5
+ install : true
6
+ enabled : true
7
+ strict : true
8
+ ipv6 : false
6
9
# # To manage the firewall writing rules instead of services, check
7
10
# # the `pillar.tables.example` for examples
8
11
services :
9
12
ssh :
10
- block_nomatch: True
13
+ block_nomatch : true
11
14
ips_allow :
12
15
- 10.0.0.0/8
13
16
- 172.16.0.0/12
14
17
- 192.168.0.0/16
15
18
http :
16
- block_nomatch: False
19
+ block_nomatch : false
17
20
protos :
18
21
- udp
19
22
- tcp
20
23
snmp :
21
- block_nomatch: False
24
+ block_nomatch : false
22
25
protos :
23
26
- udp
24
27
- tcp
@@ -30,9 +33,11 @@ firewall:
30
33
ips_allow :
31
34
- 10.0.0.0/8
32
35
33
- # Support nat (ipv4 only)
36
+ # yamllint disable rule:line-length
37
+ # Support nat (ipv4 only)
34
38
# iptables -t nat -A POSTROUTING -o eth0 -s 192.168.18.0/24 -d 10.20.0.2 -j MASQUERADE
35
39
# iptables -t nat -A POSTROUTING -o eth0 -s 192.168.18.0/24 -d 172.31.0.2 -j MASQUERADE
40
+ # yamllint enable rule:line-length
36
41
nat :
37
42
eth0 :
38
43
rules :
Original file line number Diff line number Diff line change
1
+ # -*- coding: utf-8 -*-
2
+ # vim: ft=yaml
3
+ ---
1
4
# In this example we iterate over tables (filter, nat, mangle) and
2
- # adds the desired entries
5
+ # adds the desired entries
3
6
firewall :
4
- install: True
5
- enabled: True
6
- strict: True
7
+ install : true
8
+ enabled : true
9
+ strict : true
7
10
8
11
# To use tables, leave services undefined and set this to true
9
- use_tables: True
12
+ use_tables : true
10
13
11
14
whitelist :
12
15
networks :
@@ -34,9 +37,11 @@ firewall:
34
37
dport : 2222
35
38
jump : REJECT
36
39
37
- # Suppport nat
40
+ # yamllint disable rule:line-length
41
+ # Suppport nat
38
42
# iptables -t nat -A POSTROUTING -o eth0 -s 192.168.18.0/24 -d 10.20.0.2 -j MASQUERADE
39
43
# iptables -t nat -A POSTROUTING -o eth0 -s 192.168.18.0/24 -d 172.31.0.2 -j MASQUERADE
44
+ # yamllint enable rule:line-length
40
45
nat :
41
46
POSTROUTING :
42
47
rules :
You can’t perform that action at this time.
0 commit comments