An Ansible Role that manages IP routes.
Available variables are listed below, along with default values (see defaults/main.yml
):
ip_route_configs: {}
IP routes are defined using ip_route_configs
variable.
ip_route_configs:
eth0:
- gateway: 172.0.1.1
network: 172.0.1.0/24
The configuration above manages the route for the network 172.0.1.0/24
using the
gateway 172.0.1.1
over the device eth0
.
The configuration is persisted within /etc/network/{if-up.d|if-down.d}
.
ip_route_configs:
eth0:
- network: 172.0.1.0/24
state: absent
Use state: absent
to remove a specific route. Routes are identified by the network
.
Tags can be used to limit the role execution to a particular task module. Following tags are available:
ip_route
: Covers the full role lifecycle.ip_route_config
,config
: Applies required configuration.
None.
- hosts: all
roles:
- nl2go.ip_route
Use docker-molecule following the instructions to run Molecule or install Molecule locally (not recommended, version conflicts might appear).
Use following to run tests:
molecule test --all
See the LICENSE.md file for details.
This role was created by in 2020 by Newsletter2Go GmbH.