2022-03-16 18:35:58 +00:00
# 2022-03-16: 'apt show <pkg> | grep Size' revealed download sizes, on 64-bit RasPiOS with desktop.
2021-07-27 18:56:20 +00:00
2022-03-29 01:19:33 +00:00
- name : Install dnsmasq -- configure LATER in 'network', after Stage 9
include_tasks : roles/network/tasks/dnsmasq.yml
2022-06-30 15:10:13 +00:00
- name : Install package networkd-dispatcher (OS's other than RasPiOS)
2020-12-08 10:20:42 +00:00
package :
2022-03-16 18:35:58 +00:00
name: networkd-dispatcher # 15kB download : Dispatcher service for systemd-networkd connection status changes
2020-12-08 10:20:42 +00:00
state : present
when : not is_raspbian
2022-03-16 18:35:58 +00:00
# 2021-07-27 from @jvonau: 3 apt packages BELOW (iw, rfkill, wireless-tools)
# are provided by RasPiOS. Ubuntu|Debian on the other hand are hit or miss:
# desktops might have some/all 3 preinstalled, while servers tend not to have
# these present at all, but need to be installed if you want to take full
# advantage of WiFi on Ubuntu and friends.
#
# 2022-03-16 update: Let's make these 3 mandatory as they're only 300kB (grand
# total download size) and they can help IIAB field operators with BOTH
# (1) internal WiFi AND (2) USB WiFi devices inserted anytime/later.
2022-07-11 15:40:52 +00:00
- name: 'Install 11 network packages : avahi-daemon, hostapd, iproute2, iptables-persistent, iw, libnss-mdns, netmask, net-tools, rfkill, wireless-tools, wpasupplicant -- later used by https://github.com/iiab/iiab/tree/master/roles/network'
2018-02-13 02:42:21 +00:00
package :
2021-04-27 23:48:03 +00:00
name :
2022-06-30 15:10:13 +00:00
- avahi-daemon # 97kB download : RasPiOS (and package libnss-mnds, below) install this regardless -- holdover from the XO days and used to advertise ssh/admin-console being available via avahi-daemon -- used with https://github.com/iiab/iiab/blob/master/roles/network/tasks/avahi.yml
2022-03-16 18:35:58 +00:00
#- avahi-discover # 46kB download: 2021-07-27: Commented out long ago
- hostapd # 764kB download : IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator -- has its service masked out of the box, and only used when IIAB's network roles detects the presence of WiFi and an AP is desired
#- inetutils-syslogd # 240kB download: 2021-07-27: Error logging facility -- holdover from the XO days, journalctl has replaced this in newer distros
2022-06-30 15:10:13 +00:00
- iproute2 # 902kB download : RasPiOS installs this regardless -- the new networking and traffic control tools, meant to replace net-tools
2022-03-16 18:35:58 +00:00
- iptables-persistent # 12kB download : Boot-time loader for netfilter rules, iptables (firewall) plugin -- however Netfilter / nftables is ever moving forward so keep an eye on it!
- iw # 97kB download : RasPiOS installs this regardless -- configure Linux wireless devices -- hard dependence for ap0 creation, SEE https://github.com/iiab/iiab/blob/master/roles/network/templates/hostapd/iiab-clone-wifi.service.j2
2022-06-30 15:10:13 +00:00
- libnss-mdns # 27kB download : RasPiOS (and package avahi-daemon, above) install this regardless -- client-side library -- provides name resolution via mDNS (Multicast DNS) using Zeroconf/Bonjour e.g. Avahi
2022-03-16 18:35:58 +00:00
- netmask # 25kB download : Handy utility -- helps determine network masks
2022-06-30 15:10:13 +00:00
- net-tools # 248kB download : RasPiOS installs this regardless -- @jvonau suggests possibly deleting this...unless oldtimers really want these older commands in iiab-diagnostics output?
2022-03-16 18:35:58 +00:00
- rfkill # 87kB download : RasPiOS installs this regardless -- enable & disable wireless devices
- wireless-tools # 112kB download : RasPiOS installs this regardless -- manipulate Linux Wireless Extensions
- wpasupplicant # 1188kB download : RasPiOS installs this regardless -- client library for connections to a WiFi AP
2018-02-13 02:42:21 +00:00
state : present
2017-05-27 18:09:50 +00:00
2021-08-18 05:47:03 +00:00
# 2021-08-17: Debian ignores this, according to 2013 post:
# https://serverfault.com/questions/511099/debian-ignores-etc-network-if-pre-up-d-iptables
# - name: Install /etc/network/if-pre-up.d/iptables from template (0755)
# template:
# src: iptables
# dest: /etc/network/if-pre-up.d/iptables
# mode: '0755'
2021-07-28 05:48:14 +00:00
2022-03-16 18:35:58 +00:00
2021-07-28 05:48:14 +00:00
# Ongoing rework (e.g. PR #2652) arising from ansible.posix collection changes:
2022-06-30 17:21:33 +00:00
- name : "4 network settings in /etc/sysctl.conf -- e.g. disabling IPv6 (this might be overkill, as IPv6 should really only be disabled on the LAN side, i.e. br0)"
2021-07-28 05:48:14 +00:00
sysctl : # Places these settings in /etc/sysctl.conf, to survive reboot
name : "{{ item.name }}"
value : "{{ item.value }}"
with_items :
- { name: 'net.ipv4.ip_forward', value : '1' } # Masquerading LAN->Internet
- { name: 'net.ipv4.conf.default.rp_filter', value : '1' }
- { name: 'net.ipv4.conf.default.accept_source_route', value : '0' }
#- { name: 'net.ipv4.tcp_syncookies', value: '1' } # Very standard in 2020
- { name: 'net.ipv6.conf.all.disable_ipv6', value : '1' } # IPv6 disabled
#- { name: 'net.ipv6.conf.default.disable_ipv6', value: '1' } # AUTO-SET
#- { name: 'net.ipv6.conf.lo.disable_ipv6', value: '1' } # BY ABOVE
2022-03-24 13:13:46 +00:00
# UNMAINTAINED
2022-07-08 06:16:36 +00:00
#- name: Install named / BIND
# include_tasks: roles/network/tasks/named.yml
# when: named_install is defined and named_install
2022-03-24 13:13:46 +00:00
# UNMAINTAINED
2022-07-08 06:16:36 +00:00
#- name: Install dhcpd
# include_tasks: roles/network/tasks/dhcpd.yml
# when: dhcpd_install is defined and dhcpd_install
2022-03-24 13:13:46 +00:00
# LESS MAINTAINED
- name : Install Squid
include_tasks : roles/network/tasks/squid.yml
when : squid_install and squid_installed is undefined
2022-07-11 15:40:52 +00:00
- name : "Set 'network_installed: True'"
set_fact :
network_installed : True
- name : "Add 'network_installed: True' to {{ iiab_state_file }}"
lineinfile :
path : "{{ iiab_state_file }}" # /etc/iiab/iiab_state.yml
regexp : '^network_installed'
line: 'network_installed : True '