From f832189278d74b2ef91376a8faf9e39d790ca25b Mon Sep 17 00:00:00 2001 From: Gregor Michels Date: Tue, 10 Jan 2023 00:43:35 +0100 Subject: [PATCH] gateways: move some configs into base * system * lldpd * prometheus-node-exporter-lua * frr: daemons --- .../{gw-core01 => base}/etc/config/lldpd | 2 + .../etc/config/prometheus-node-exporter-lua | 0 .../etc/config/system | 0 .../etc/frr/daemons | 0 .../ffl-ans-gw-core01/etc/config/lldpd | 16 ------ .../etc/config/prometheus-node-exporter-lua | 4 -- .../gateways/gw-core01/etc/config/system | 16 ------ templates/gateways/gw-core01/etc/frr/daemons | 54 ------------------- 8 files changed, 2 insertions(+), 90 deletions(-) rename templates/gateways/{gw-core01 => base}/etc/config/lldpd (87%) rename templates/gateways/{ffl-ans-gw-core01 => base}/etc/config/prometheus-node-exporter-lua (100%) rename templates/gateways/{ffl-ans-gw-core01 => base}/etc/config/system (100%) rename templates/gateways/{ffl-ans-gw-core01 => base}/etc/frr/daemons (100%) delete mode 100644 templates/gateways/ffl-ans-gw-core01/etc/config/lldpd delete mode 100644 templates/gateways/gw-core01/etc/config/prometheus-node-exporter-lua delete mode 100644 templates/gateways/gw-core01/etc/config/system delete mode 100644 templates/gateways/gw-core01/etc/frr/daemons diff --git a/templates/gateways/gw-core01/etc/config/lldpd b/templates/gateways/base/etc/config/lldpd similarity index 87% rename from templates/gateways/gw-core01/etc/config/lldpd rename to templates/gateways/base/etc/config/lldpd index 8f89bf6..45ef00f 100644 --- a/templates/gateways/gw-core01/etc/config/lldpd +++ b/templates/gateways/base/etc/config/lldpd @@ -14,7 +14,9 @@ config lldpd config list interface "eth1" list interface "eth2" list interface "eth3" +{% if inventory_hostname in [ "gw-core01" ] %} list interface "eth4" list interface "eth5" list interface "eth6" list interface "eth7" +{% endif %} diff --git a/templates/gateways/ffl-ans-gw-core01/etc/config/prometheus-node-exporter-lua b/templates/gateways/base/etc/config/prometheus-node-exporter-lua similarity index 100% rename from templates/gateways/ffl-ans-gw-core01/etc/config/prometheus-node-exporter-lua rename to templates/gateways/base/etc/config/prometheus-node-exporter-lua diff --git a/templates/gateways/ffl-ans-gw-core01/etc/config/system b/templates/gateways/base/etc/config/system similarity index 100% rename from templates/gateways/ffl-ans-gw-core01/etc/config/system rename to templates/gateways/base/etc/config/system diff --git a/templates/gateways/ffl-ans-gw-core01/etc/frr/daemons b/templates/gateways/base/etc/frr/daemons similarity index 100% rename from templates/gateways/ffl-ans-gw-core01/etc/frr/daemons rename to templates/gateways/base/etc/frr/daemons diff --git a/templates/gateways/ffl-ans-gw-core01/etc/config/lldpd b/templates/gateways/ffl-ans-gw-core01/etc/config/lldpd deleted file mode 100644 index 0582ebd..0000000 --- a/templates/gateways/ffl-ans-gw-core01/etc/config/lldpd +++ /dev/null @@ -1,16 +0,0 @@ -config lldpd config - option enable_cdp 0 - option enable_fdp 0 - option enable_sonmp 0 - option enable_edp 0 - - - option lldp_class 4 - option lldp_mgmt_ip "{{ ip }}" - option lldp_location "" - - list interface "loopback" - list interface "eth0" - list interface "eth1" - list interface "eth2" - list interface "eth3" diff --git a/templates/gateways/gw-core01/etc/config/prometheus-node-exporter-lua b/templates/gateways/gw-core01/etc/config/prometheus-node-exporter-lua deleted file mode 100644 index 51d9c4b..0000000 --- a/templates/gateways/gw-core01/etc/config/prometheus-node-exporter-lua +++ /dev/null @@ -1,4 +0,0 @@ -config prometheus-node-exporter-lua 'main' - option listen_interface 'mgmt' - option listen_ipv6 '0' - option listen_port '9100' diff --git a/templates/gateways/gw-core01/etc/config/system b/templates/gateways/gw-core01/etc/config/system deleted file mode 100644 index 1b1eac4..0000000 --- a/templates/gateways/gw-core01/etc/config/system +++ /dev/null @@ -1,16 +0,0 @@ - -config system - option hostname 'gw-core01' - option timezone 'CET-1CEST,M3.5.0,M10.5.0/3' # Europe/Berlin - option ttylogin '0' - option log_size '64' - option urandom_seed '0' - option compat_version '1.1' - -config timeserver 'ntp' - option enabled '1' - option enable_server '0' - list server '0.openwrt.pool.ntp.org' - list server '1.openwrt.pool.ntp.org' - list server '2.openwrt.pool.ntp.org' - list server '3.openwrt.pool.ntp.org' diff --git a/templates/gateways/gw-core01/etc/frr/daemons b/templates/gateways/gw-core01/etc/frr/daemons deleted file mode 100644 index 2ed3ec4..0000000 --- a/templates/gateways/gw-core01/etc/frr/daemons +++ /dev/null @@ -1,54 +0,0 @@ -# The staticd,watchfrr and zebra daemons are always started. -# -bgpd=no -ospfd=yes -#ospfd_instances=1,20 -ospf6d=no -ripd=no -ripngd=no -isisd=no -pimd=no -ldpd=no -nhrpd=no -eigrpd=no -babeld=no -sharpd=no -pbrd=no -bfdd=no -fabricd=no -vrrpd=no - -# -# If this option is set the /etc/init.d/frr script automatically loads -# the config via "vtysh -b" when the servers are started. -# Check /etc/pam.d/frr if you intend to use "vtysh"! -# -vtysh_enable=yes -zebra_options=" -A 127.0.0.1 -s 90000000" -bgpd_options=" -A 127.0.0.1" -ospfd_options=" -A 127.0.0.1" -ospf6d_options=" -A ::1" -ripd_options=" -A 127.0.0.1" -ripngd_options=" -A ::1" -isisd_options=" -A 127.0.0.1" -pimd_options=" -A 127.0.0.1" -ldpd_options=" -A 127.0.0.1" -nhrpd_options=" -A 127.0.0.1" -eigrpd_options=" -A 127.0.0.1" -babeld_options=" -A 127.0.0.1" -sharpd_options=" -A 127.0.0.1" -pbrd_options=" -A 127.0.0.1" -staticd_options="-A 127.0.0.1" -bfdd_options=" -A 127.0.0.1" -fabricd_options="-A 127.0.0.1" -vrrpd_options=" -A 127.0.0.1" - -# The list of daemons to watch is automatically generated by the init script. -#watchfrr_options="" - -# for debugging purposes, you can specify a "wrap" command to start instead -# of starting the daemon directly, e.g. to use valgrind on ospfd: -# ospfd_wrap="/usr/bin/valgrind" -# or you can use "all_wrap" for all daemons, e.g. to use perf record: -# all_wrap="/usr/bin/perf record --call-graph -" -# the normal daemon command is added to this at the end.