Zack Williams | e695dea | 2020-11-19 17:17:40 -0700 | [diff] [blame] | 1 | --- |
| 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 |
| 13 | update_cache: true |
| 14 | cache_valid_time: 3600 |
| 15 | |
Zack Williams | e695dea | 2020-11-19 17:17:40 -0700 | [diff] [blame] | 16 | - name: Enable sysctl for IPv4 forwarding |
| 17 | sysctl: |
| 18 | name: net.ipv4.ip_forward |
| 19 | value: '1' |
| 20 | sysctl_set: true |
| 21 | reload: true |
| 22 | |
| 23 | - name: Create a netplan for non-primary interfaces |
| 24 | template: |
| 25 | src: netplan.yaml.j2 |
| 26 | dest: /etc/netplan/02-pronto.yaml |
| 27 | backup: true |
| 28 | owner: root |
| 29 | group: root |
| 30 | mode: 0644 |
| 31 | notify: |
| 32 | - netplan-apply |
| 33 | |
| 34 | # Docs: http://nftables.org/ |
| 35 | - name: Create nftables config file |
| 36 | template: |
| 37 | src: nftables.conf.j2 |
| 38 | dest: /etc/nftables.conf |
| 39 | backup: true |
| 40 | owner: root |
| 41 | group: root |
| 42 | mode: 0755 |
| 43 | validate: nft -c -f %s |
| 44 | notify: |
| 45 | - nftables-reload |