jedimt.network_setup
Ansible Role: Netplan Setup
This role helps you create and apply a Netplan configuration for a computer (host). It assumes that the computer has two network adapters. It sets a static IP for the main network adapter and turns off the secondary adapter. This is important for Kubernetes setups because having an active secondary adapter can create issues with traffic routing for MetalLB.
Requirements
None
Role Variables
The role includes three main variables:
Primary DNS server: This is where your device will look for domain names first.
dns_server: 10.100.24.11
Secondary DNS server: This is used if the primary server is not available.
dns_server_2: 10.100.24.21
DNS search domain: This helps locate other devices on the network.
domain: tme.nebulon.com
There are also specific variables for each host, found in host_vars files. This allows customization for each device. You could also set the mgt_net
and gateway4
variables using host-specific information if DHCP is set up correctly.
Management network address: This is the address for the network in CIDR format.
mgt_net: 10.100.25.46/22
Gateway address: This is the address to access other networks.
gateway4: 10.100.24.1
Dependencies
None
Example Playbook
Here’s an example of how to set up the network:
# ===========================================================================
# Network configuration
# ===========================================================================
- name: Configure netplan and DNS settings
hosts: servers
tags: play_network_setup
roles:
- jedimt.network_setup
License
MIT
Author Information
Aaron Patten
aaronpatten@gmail.com