Ansible scripts for FRI servers
Go to file
Timotej Lazar cf6b682cf8 Add ocserv role
Create a self-signed CA, set up group configs, add script to allow new
connections through the firewall.

In the base debian role, drop the default nftables forward chain with
drop policy because it clashes with this. If you enable forwarding on
a debian host, make sure to configure the firewall.
2025-04-12 18:38:48 +02:00
files Add RuntimeDirectory to ssh service 2024-09-10 14:11:35 +02:00
filter_plugins Support custom allowed_ips field for services 2024-08-03 11:44:03 +02:00
roles Add ocserv role 2025-04-12 18:38:48 +02:00
templates Consolidate hosts template 2025-04-10 18:22:41 +02:00
.gitignore Add .gitignore 2024-05-19 14:21:25 +02:00
ansible.cfg ansible: shut up warnings about discovered Python interpreter 2025-01-23 13:36:24 +01:00
inventory.yml Add role=IoT to targets 2024-09-30 15:17:41 +02:00
LICENSE Unlicense 2024-05-19 14:31:43 +02:00
README.md Update instructions in README 2024-09-06 10:41:49 +02:00
setup.yml Add ocserv role 2025-04-12 18:38:48 +02:00
UNLICENSE Unlicense 2024-05-19 14:31:43 +02:00

These Ansible roles set up servers running various Linux distributions to participate in BGP routing. Device and IP address data are pulled from NetBox. A separate VRF mgmt is configured for a L2 management interface.

Setup

Each server should have the following information recorded in NetBox:

  • network interfaces mgmt*: used for management (Ansible) access; must define MAC and IP address
  • network interfaces lan*: used for BGP routing; must define MAC address
  • network interface lo: must define the IP address to announce over BGP, also serves as router ID

MAC addresses are used to rename interfaces in the host OS. Prefix for the management IP address should define the gateway custom field.

Run

Create a read-only token in NetBox. Define required variables:

export NETBOX_API=<url>
export NETBOX_TOKEN=<token>

Run one-off tasks with (add --key-file or other options as necessary):

ansible -m ping 'server-*'

Run a playbook with:

ansible-playbook setup.yml -l 'server-*'