mirror of
https://github.com/linux-system-roles/network.git
synced 2026-01-23 02:15:17 +00:00
The only thing we need to skip currently is using FQCN for ansible builtin modules, plugins Add `kinds` - otherwise, Ansible thinks anything not in a traditional role path is a plain YAML file, and we don't get the additional checking. Ensure all plays are named. Fix some other minor problems. Signed-off-by: Rich Megginson <rmeggins@redhat.com>
36 lines
1,013 B
YAML
36 lines
1,013 B
YAML
# SPDX-License-Identifier: BSD-3-Clause
|
|
---
|
|
- name: Manage routing tables
|
|
hosts: all
|
|
tasks:
|
|
- name: Add a new routing table
|
|
lineinfile:
|
|
path: /etc/iproute2/rt_tables.d/table.conf
|
|
line: 200 custom
|
|
mode: "0644"
|
|
create: true
|
|
|
|
- name: Configure connection profile and specify the table in static routes
|
|
import_role:
|
|
name: linux-system-roles.network
|
|
vars:
|
|
network_connections:
|
|
- name: eth0
|
|
type: ethernet
|
|
state: up
|
|
autoconnect: true
|
|
ip:
|
|
dhcp4: false
|
|
address:
|
|
- 198.51.100.3/26
|
|
route:
|
|
- network: 198.51.100.128
|
|
prefix: 26
|
|
gateway: 198.51.100.1
|
|
metric: 2
|
|
table: 30400
|
|
- network: 198.51.100.64
|
|
prefix: 26
|
|
gateway: 198.51.100.6
|
|
metric: 4
|
|
table: custom
|