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 |
Zack Williams | 021d7a9 | 2020-12-14 21:53:20 -0700 | [diff] [blame] | 13 | - lldpd |
Zack Williams | e695dea | 2020-11-19 17:17:40 -0700 | [diff] [blame] | 14 | update_cache: true |
| 15 | cache_valid_time: 3600 |
| 16 | |
Zack Williams | e695dea | 2020-11-19 17:17:40 -0700 | [diff] [blame] | 17 | - name: Enable sysctl for IPv4 forwarding |
Zack Williams | 021d7a9 | 2020-12-14 21:53:20 -0700 | [diff] [blame] | 18 | when: netprep_router |
Zack Williams | e695dea | 2020-11-19 17:17:40 -0700 | [diff] [blame] | 19 | sysctl: |
| 20 | name: net.ipv4.ip_forward |
| 21 | value: '1' |
| 22 | sysctl_set: true |
| 23 | reload: true |
| 24 | |
Zack Williams | 021d7a9 | 2020-12-14 21:53:20 -0700 | [diff] [blame] | 25 | - name: Create a netplan for interfaces |
Zack Williams | e695dea | 2020-11-19 17:17:40 -0700 | [diff] [blame] | 26 | template: |
| 27 | src: netplan.yaml.j2 |
Zack Williams | 021d7a9 | 2020-12-14 21:53:20 -0700 | [diff] [blame] | 28 | dest: "/etc/netplan/{{ netprep_netplan_file }}.yaml" |
Zack Williams | e695dea | 2020-11-19 17:17:40 -0700 | [diff] [blame] | 29 | 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 Williams | 021d7a9 | 2020-12-14 21:53:20 -0700 | [diff] [blame] | 38 | when: netprep_router |
Zack Williams | e695dea | 2020-11-19 17:17:40 -0700 | [diff] [blame] | 39 | 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 |