blob: 8f6650109049e0c7bd6e7aeafec4464a9a541e54 [file] [log] [blame]
Zack Williamse695dea2020-11-19 17:17:40 -07001---
2# netprep tasks/Debian.yml
3#
4# SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org>
5# SPDX-License-Identifier: Apache-2.0
6
7- name: Install network prep packages
8 apt:
9 name:
10 - bridge-utils
11 - vlan
12 - nftables
Zack Williams021d7a92020-12-14 21:53:20 -070013 - lldpd
Zack Williamse695dea2020-11-19 17:17:40 -070014 update_cache: true
15 cache_valid_time: 3600
16
Zack Williamse695dea2020-11-19 17:17:40 -070017- name: Enable sysctl for IPv4 forwarding
Zack Williams021d7a92020-12-14 21:53:20 -070018 when: netprep_router
Zack Williamse695dea2020-11-19 17:17:40 -070019 sysctl:
20 name: net.ipv4.ip_forward
21 value: '1'
22 sysctl_set: true
23 reload: true
24
Zack Williams021d7a92020-12-14 21:53:20 -070025- name: Create a netplan for interfaces
Zack Williamse695dea2020-11-19 17:17:40 -070026 template:
27 src: netplan.yaml.j2
Zack Williams021d7a92020-12-14 21:53:20 -070028 dest: "/etc/netplan/{{ netprep_netplan_file }}.yaml"
Zack Williamse695dea2020-11-19 17:17:40 -070029 backup: true
30 owner: root
31 group: root
32 mode: 0644
33 notify:
34 - netplan-apply
35
36# Docs: http://nftables.org/
37- name: Create nftables config file
Zack Williams021d7a92020-12-14 21:53:20 -070038 when: netprep_router
Zack Williamse695dea2020-11-19 17:17:40 -070039 template:
40 src: nftables.conf.j2
41 dest: /etc/nftables.conf
42 backup: true
43 owner: root
44 group: root
45 mode: 0755
46 validate: nft -c -f %s
47 notify:
48 - nftables-reload