Ansible scripts for FRI servers
Find a file
Timotej Lazar d162f175a4 facts: get platform info from NetBox
Instead of pinging each host to see if it’s Windows. Make sure to set
the platform at least for such hosts.
2025-05-13 13:31:07 +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 facts: get platform info from NetBox 2025-05-13 13:31:07 +02:00
templates debian: add MOTD 2025-05-05 17:28:32 +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 Limit inventory lookup to installed servers 2025-05-06 13:26:56 +02:00
LICENSE Unlicense 2024-05-19 14:31:43 +02:00
README.md facts: get platform info from NetBox 2025-05-13 13:31:07 +02:00
setup.yml facts: get platform info from NetBox 2025-05-13 13:31:07 +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 physical 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

For virtual machines, network interfaces should be named as in the hypervisor. In Proxmox, this is typically net*.

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

For Windows hosts the platform must be defined in NetBox to configure connection parameters.

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-*'