Skip to content

Commit ff5b153

Browse files
committed
(common/firewall) add antu and set port for node_exporter
1 parent 76a3b38 commit ff5b153

File tree

6 files changed

+29
-18
lines changed

6 files changed

+29
-18
lines changed

hieradata/common.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,11 +373,11 @@ ipset::sets:
373373
- "140.252.146.0/23"
374374
- "198.19.0.0/16"
375375
- "10.0.0.0/8"
376-
ayekan: # ayekan cluster
376+
antu: # antu monitoring cluster ls
377377
ensure: "present"
378378
type: "hash:net"
379379
set:
380-
- "139.229.144.0/26"
380+
- "139.229.154.64/26"
381381
dev: # dev site hosts
382382
ensure: "present"
383383
type: "hash:net"

hieradata/site/cp.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,21 @@ accounts::user_list:
5050
- "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDN16b56V3j7wot509IlRvOFXaLxI9AH9/eOr1WuLEdpGoQ3lDuz26P6zFLbopjgsZxdzxE492QAmGpdUkn+Ducny1JK83L0N/d6INrM48fQeiUiSsN/YKua9qO8QQbvTsiiKanj38u9x1vOfqKn2/kK7BKAZblr+qT7U6nofMFlG3zJpNOCAIHyd4DJRrWB+xPR1YRwljV6BOtpI5+/FwdoX+/61cdsP0895iejDlnYRNFBYWRdGHDdDN6yfSNy00D/ADwaZP9sO+gyvHPqz/saPFYx8Petbhl/PlUjqWx7sktQxPgpMPBU/KQU5SEd5RkcT+CVjLHuHfOa3jXEdVx [email protected]"
5151

5252
profile::core::common::disable_ipv6: true
53+
54+
profile::core::firewall::firewall:
55+
"100 accept node_exporter":
56+
proto: "tcp"
57+
state: "NEW"
58+
ipset: "antu src"
59+
dport: "9100"
60+
jump: "accept"
61+
"101 accept node_exporter":
62+
proto: "tcp"
63+
state: "NEW"
64+
ipset: "dev src" # allow ruka to access node_exporter
65+
dport: "9100"
66+
jump: "accept"
67+
5368
profile::core::docker::version: "24.0.9"
5469

5570
ccs_sal::dds: false

hieradata/site/dev.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ profile::core::firewall::firewall:
6868
"100 accept node_exporter":
6969
proto: "tcp"
7070
state: "NEW"
71-
ipset: "ayekan src"
71+
ipset: "antu src"
7272
dport: "9100"
7373
jump: "accept"
7474
"101 accept node_exporter":

hieradata/site/ls.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,13 @@ profile::core::firewall::firewall:
5252
"100 accept node_exporter":
5353
proto: "tcp"
5454
state: "NEW"
55-
ipset: "ayekan src"
55+
ipset: "antu src"
56+
dport: "9100"
57+
jump: "accept"
58+
"101 accept node_exporter":
59+
proto: "tcp"
60+
state: "NEW"
61+
ipset: "dev src" # allow ruka to access node_exporter
5662
dport: "9100"
5763
jump: "accept"
5864

spec/support/spec/firewall.rb

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@
5656

5757
shared_examples 'firewall node_exporter scraping' do |site:|
5858
case site
59-
when 'dev'
59+
when 'dev', 'ls', 'cp' # just not TU
6060
it do
6161
is_expected.to contain_firewall('100 accept node_exporter').with(
6262
proto: 'tcp',
6363
state: 'NEW',
64-
ipset: 'ayekan src',
64+
ipset: 'antu src',
6565
dport: '9100',
6666
jump: 'accept'
6767
)
@@ -76,15 +76,5 @@
7676
jump: 'accept'
7777
)
7878
end
79-
when 'ls'
80-
it do
81-
is_expected.to contain_firewall('100 accept node_exporter').with(
82-
proto: 'tcp',
83-
state: 'NEW',
84-
ipset: 'ayekan src',
85-
dport: '9100',
86-
jump: 'accept'
87-
)
88-
end
8979
end
9080
end

spec/support/spec/ipset.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
end
3131

3232
it do
33-
is_expected.to contain_ipset__set('ayekan').with_set(
33+
is_expected.to contain_ipset__set('antu').with_set(
3434
%w[
35-
139.229.144.0/26
35+
139.229.154.64/26
3636
]
3737
).that_comes_before('Class[firewall]')
3838
end

0 commit comments

Comments
 (0)