- manage rke2 repos - add rke2 module (init, params, install, config, service) - split roles::infra::k8s::node -> control/compute roles - moved common k8s config into k8s.yaml - add bootstrap_node, manage server and token fields in rke2 config - manage install of helm - manage node attributes (from puppet facts) - manage frr exclusions for service/cluster network Reviewed-on: #394
78 lines
2.2 KiB
Plaintext
78 lines
2.2 KiB
Plaintext
# THIS FILE IS MANAGED BY PUPPET
|
|
frr defaults traditional
|
|
hostname <%= @hostname %>
|
|
no ipv6 forwarding
|
|
|
|
<% @ospfd_interfaces.each do |iface, params| -%>
|
|
interface <%= iface %>
|
|
<% if params['area'] -%>
|
|
ip ospf area <%= params['area'] %>
|
|
<% end -%>
|
|
<% if params['passive'] == true -%>
|
|
ip ospf passive
|
|
<% end -%>
|
|
exit
|
|
<% end -%>
|
|
|
|
<%# ---- K8s exclude (prefix-list + route-map) ---- -%>
|
|
<% if @ospf_exclude_k8s_enable && (@k8s_cluster_cidr || @k8s_service_cidr) -%>
|
|
! Do not redistribute Kubernetes Pod/Service CIDRs
|
|
ip prefix-list K8S-BLOCK seq 5 permit <%= @k8s_cluster_cidr %> le 32<% if !@k8s_cluster_cidr %> ! (unset)<% end %>
|
|
<% if @k8s_service_cidr -%>
|
|
ip prefix-list K8S-BLOCK seq 10 permit <%= @k8s_service_cidr %> le 32
|
|
<% end -%>
|
|
route-map CONNECTED-NON-K8S deny 5
|
|
match ip address prefix-list K8S-BLOCK
|
|
exit
|
|
route-map CONNECTED-NON-K8S permit 100
|
|
exit
|
|
<% end -%>
|
|
|
|
router ospf
|
|
ospf router-id <%= @ospfd_router_id %>
|
|
log-adjacency-changes detail
|
|
<% @ospfd_redistribute.each do |type| -%>
|
|
<% if @ospf_exclude_k8s_enable && type == 'connected' && (@k8s_cluster_cidr || @k8s_service_cidr) -%>
|
|
redistribute connected route-map CONNECTED-NON-K8S
|
|
<% else -%>
|
|
redistribute <%= type %>
|
|
<% end -%>
|
|
<% end -%>
|
|
<% @ospfd_networks.each do |network| -%>
|
|
network <%= network %>
|
|
<% end -%>
|
|
<% if @ospfd_default_originate_always -%>
|
|
default-information originate always
|
|
<% end -%>
|
|
<% if @mpls_te_enabled -%>
|
|
capability opaque
|
|
mpls-te on
|
|
mpls-te router-address <%= @ospfd_router_id %>
|
|
mpls-te inter-as area 0.0.0.0
|
|
<% end -%>
|
|
exit
|
|
|
|
<%# ---- MPLS/LDP config ---- -%>
|
|
<% if @mpls_ldp_router_id and @mpls_ldp_transport_addr and @mpls_ldp_interfaces.any? -%>
|
|
mpls ldp
|
|
router-id <%= @mpls_ldp_router_id %>
|
|
address-family ipv4
|
|
discovery transport-address <%= @mpls_ldp_transport_addr %>
|
|
<% @mpls_ldp_interfaces.each do |iface| -%>
|
|
interface <%= iface %>
|
|
exit
|
|
<% end -%>
|
|
exit-address-family
|
|
exit
|
|
<% end -%>
|
|
|
|
<%# ---- Preferred OSPF source ---- -%>
|
|
<% if @ospf_preferred_source_enable && @ospf_preferred_source -%>
|
|
ip prefix-list ANY seq 5 permit 0.0.0.0/0 le 32
|
|
route-map OSPF-SRC permit 10
|
|
match ip address prefix-list ANY
|
|
set src <%= @ospf_preferred_source %>
|
|
exit
|
|
ip protocol ospf route-map OSPF-SRC
|
|
<% end -%>
|