Skip to content

Commit

Permalink
use firewall 8
Browse files Browse the repository at this point in the history
- remove `firewall6-` prefix from Firewall collectors
- add datacenter prefix for haproxy Firewall collector
- delete all `firewall6-` `@@firewall` exports
  • Loading branch information
rrotter committed Nov 6, 2024
1 parent e36efdf commit d5eaf52
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 85 deletions.
9 changes: 0 additions & 9 deletions manifests/profile/haproxy.pp
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,6 @@
tag => "${::datacenter}_haproxy"
}

@@firewall { "200 HTTP firewall6: HAProxy ${::hostname}":
proto => 'tcp',
dport => [80, 443],
source => $::ipaddress,
state => 'NEW',
action => 'accept',
tag => 'firewall6-haproxy'
}

# HAProxy should listen for kubernetes connections.
nebula::exposed_port { '200 kubectl':
port => 6443,
Expand Down
2 changes: 1 addition & 1 deletion manifests/profile/networking/firewall/http.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# @example
# include nebula::profile::networking::firewall::http
class nebula::profile::networking::firewall::http () {
Firewall <<| tag == 'firewall6-haproxy' |>>
Firewall <<| tag == "${::datacenter}_haproxy" |>>
}


51 changes: 1 addition & 50 deletions manifests/profile/prometheus.pp
Original file line number Diff line number Diff line change
Expand Up @@ -243,18 +243,6 @@
tag => "${::datacenter}_prometheus_public_ipmi_exporter",
dport => 9290,
;

"010 prometheus public node exporter firewall6 ${::hostname} ${address}":
tag => "firewall6-${::datacenter}_prometheus_public_node_exporter",
dport => 9100,
action => 'accept',
;

"010 prometheus public ipmi exporter firewall6 ${::hostname} ${address}":
tag => "firewall6-${::datacenter}_prometheus_public_ipmi_exporter",
dport => 9290,
action => 'accept',
;
}
}

Expand All @@ -277,25 +265,6 @@
dport => 9290,
;
}

@@firewall {
default:
proto => 'tcp',
source => $address,
state => 'NEW',
action => 'accept',
;

"010 prometheus firewall6 private node exporter ${::hostname} ${address}":
tag => "firewall6-${::datacenter}_prometheus_private_node_exporter",
dport => 9100,
;

"010 prometheus firewall6 private ipmi exporter ${::hostname} ${address}":
tag => "firewall6-${::datacenter}_prometheus_private_ipmi_exporter",
dport => 9290,
;
}
}

@@firewall { "010 prometheus haproxy exporter ${::hostname}":
Expand All @@ -307,15 +276,6 @@
jump => 'accept',
}

@@firewall { "010 prometheus firewall6 haproxy exporter ${::hostname}":
tag => "firewall6-${::datacenter}_prometheus_haproxy_exporter",
proto => 'tcp',
dport => 9101,
source => $::ipaddress,
state => 'NEW',
action => 'accept',
}

@@firewall { "010 prometheus mysql exporter ${::hostname}":
tag => "${::datacenter}_prometheus_mysql_exporter",
proto => 'tcp',
Expand All @@ -325,14 +285,5 @@
jump => 'accept',
}

@@firewall { "010 prometheus firewall6 mysql exporter ${::hostname}":
tag => "firewall6-${::datacenter}_prometheus_mysql_exporter",
proto => 'tcp',
dport => 9104,
source => $::ipaddress,
state => 'NEW',
action => 'accept',
}

Firewall <<| tag == "firewall6-${::datacenter}_pushgateway_node" |>>
Firewall <<| tag == "${::datacenter}_pushgateway_node" |>>
}
2 changes: 1 addition & 1 deletion manifests/profile/prometheus/exporter/haproxy.pp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
content => template('nebula/profile/prometheus/exporter/haproxy/target.yaml.erb')
}

Firewall <<| tag == "firewall6-${::datacenter}_prometheus_haproxy_exporter" |>>
Firewall <<| tag == "${::datacenter}_prometheus_haproxy_exporter" |>>

}
4 changes: 2 additions & 2 deletions manifests/profile/prometheus/exporter/ipmi.pp
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
fail('Host cannot be scraped without a public or private IP address')
} elsif $all_private_addresses != [] {
$ipaddress = $all_private_addresses[0]
Firewall <<| tag == "firewall6-${::datacenter}_prometheus_private_ipmi_exporter" |>>
Firewall <<| tag == "${::datacenter}_prometheus_private_ipmi_exporter" |>>
} else {
$ipaddress = $all_public_addresses[0]
Firewall <<| tag == "firewall6-${::datacenter}_prometheus_public_ipmi_exporter" |>>
Firewall <<| tag == "${::datacenter}_prometheus_public_ipmi_exporter" |>>
}

@@concat_fragment { "prometheus ipmi scrape config ${::hostname}":
Expand Down
2 changes: 1 addition & 1 deletion manifests/profile/prometheus/exporter/mysql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
content => template('nebula/profile/prometheus/exporter/mysql/target.yaml.erb')
}

Firewall <<| tag == "firewall6-${::datacenter}_prometheus_mysql_exporter" |>>
Firewall <<| tag == "${::datacenter}_prometheus_mysql_exporter" |>>

$role = lookup_role()

Expand Down
13 changes: 2 additions & 11 deletions manifests/profile/prometheus/exporter/node.pp
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@
fail("${datacenter} host cannot be scraped by ${monitoring_datacenter} prometheus server without a public IP address")
} elsif $all_private_addresses != [] and $monitoring_datacenter == $datacenter {
$ipaddresses = $all_private_addresses
Firewall <<| tag == "firewall6-${monitoring_datacenter}_prometheus_private_node_exporter" |>>
Firewall <<| tag == "${monitoring_datacenter}_prometheus_private_node_exporter" |>>
Concat_fragment <<| title == "02 pushgateway advanced private url ${monitoring_datacenter}" |>>
} else {
$ipaddresses = $all_public_addresses
Firewall <<| tag == "firewall6-${monitoring_datacenter}_prometheus_public_node_exporter" |>>
Firewall <<| tag == "${monitoring_datacenter}_prometheus_public_node_exporter" |>>
Concat_fragment <<| title == "02 pushgateway advanced public url ${monitoring_datacenter}" |>>
}

Expand All @@ -157,15 +157,6 @@
state => 'NEW',
jump => 'accept',
}

@@firewall { "300 pushgateway firewall6 ${::hostname} ${address}":
tag => "firewall6-${monitoring_datacenter}_pushgateway_node",
proto => 'tcp',
dport => 9091,
source => $address,
state => 'NEW',
action => 'accept',
}
}

ensure_packages(['curl', 'jq'])
Expand Down
9 changes: 0 additions & 9 deletions manifests/unison/client.pp
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,4 @@
jump => 'accept',
tag => "unison-client-${title}"
}

@@firewall { "200 Unison firewall6: ${title} ${::hostname}":
proto => 'tcp',
dport => [$port],
source => $::ipaddress,
state => 'NEW',
action => 'accept',
tag => "firewall6-unison-client-${title}"
}
}
2 changes: 1 addition & 1 deletion manifests/unison/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
filesystems => $filesystems
}

Firewall <<| tag == "firewall6-unison-client-${title}" |>>
Firewall <<| tag == "unison-client-${title}" |>>

}

0 comments on commit d5eaf52

Please sign in to comment.