2020-08-02 18:36:56 +00:00
- name : Select RPi firmware mode
include_role :
name : firmware
when : rpi_model != "none"
2022-05-20 16:25:01 +00:00
- name : detected_network
include_tasks : detected_network.yml
#- name: "Set 'no_net_restart: True' if discovered_wireless_iface == iiab_wan_iface"
- name : "Set 'no_net_restart: True' if has_wifi_gateway is defined"
set_fact :
no_net_restart : True # 2020-09-12 :
# 0-init/defaults/main.yml - default boolean value of False
# network/tasks/main.yml - changes flag based on conditional present
# Var is currently used in 9 subsequent files, to suppress restarting of
# hostapd, dnsmasq and/or other networking service in computed_services.yml,
# debian.yml, detected_network.yml, down-debian.yml, netplan.yml,
# NM-debian.yml, restart.yml, rpi_debian.yml, sysd-netd-debian.yml
when : has_wifi_gateway is defined
- name : computed_network
include_tasks : computed_network.yml
2022-07-22 19:35:05 +00:00
# 2022-07-22: @jvonau asks for this to be (1) BELOW computed_network.yml
# (what goes into iiab-hotspot-on|off depends on can_be_ap and wifi_up_down)
# AND (2) ABOVE install.yml for some reason? REQUIREMENT: Admin Console reads
# iiab_network_mode from /etc/iiab/iiab.ini + uses /usr/bin/iiab-hotspot-on|off
2022-07-22 18:43:39 +00:00
- name : Install /usr/bin/iiab-hotspot-on|off from template (root:root by default)
template :
src : "{{ item }}"
dest : /usr/bin/
mode : 0755
with_items :
- hostapd/iiab-hotspot-on
- hostapd/iiab-hotspot-off
2022-07-11 17:12:29 +00:00
2022-07-22 19:14:40 +00:00
- name : Install network packages (including many WiFi tools, and also iptables-persistent for firewall)
include_tasks : install.yml
when : network_install and network_installed is undefined
2022-07-22 15:25:47 +00:00
2022-05-06 03:52:48 +00:00
- name : Configuring Network if enabled
block :
2022-07-22 13:51:53 +00:00
# DEPRECATED
#- name: Configure wondershaper
# include_tasks: wondershaper.yml
# when: wondershaper_install or wondershaper_installed is defined
#
#- name: (Re)Install named
# include_tasks: named.yml
# when: named_install and FQDN_changed and iiab_stage|int == 9
#
#- name: (Re)Install dhcpd
# include_tasks: dhcpd.yml
# when: dhcpd_install and FQDN_changed and iiab_stage|int == 9
# 2022-07-22: Is './runrole --reinstall network' the new way to make this run?
#- name: (Re)Install Squid
# include_tasks: squid.yml
# when: squid_install and FQDN_changed and iiab_stage|int == 9
2022-05-06 03:52:48 +00:00
#### Start services
- name : computed_services
include_tasks : computed_services.yml
- name : enable_services
include_tasks : enable_services.yml
#### End services
#### Start network layout
2024-12-19 00:55:14 +00:00
2024-12-19 03:59:25 +00:00
# 2024-12-18: As `rfkill unblock wifi` formerly in rpi_debian.yml wasn't enough, especially with NM (NetworkManager)
2024-12-19 00:55:14 +00:00
- name : Run 'raspi-config nonint do_wifi_country {{ host_country_code }}' (using var host_country_code) to unblock WiFi, if RasPiOS
command : raspi-config nonint do_wifi_country {{ host_country_code }}
2024-12-18 14:47:43 +00:00
when : is_raspbian
2024-12-19 00:55:14 +00:00
#ignore_errors: True
2024-12-18 14:47:43 +00:00
2022-05-06 03:52:48 +00:00
#- name: Redhat networking
# include_tasks: ifcfg_mods.yml
# when: is_redhat
- name : NetworkManager in use
include_tasks : NM-debian.yml
2022-10-28 17:55:43 +00:00
when : network_manager_active
2022-05-06 03:52:48 +00:00
- name : systemd-networkd in use
include_tasks : sysd-netd-debian.yml
2022-10-28 17:55:43 +00:00
when : systemd_networkd_active
2023-10-14 19:32:50 +00:00
#when: systemd_networkd_active and not network_manager_active # 2023-10-11: NOT the right way to solve #3657 (systemd-resolved issue on RasPiOS 12+) as this would damage Ubuntu/Mint.
2022-05-06 03:52:48 +00:00
2023-10-14 19:32:50 +00:00
# 2023-10-11: Should rpi_debian.yml go away in future, now that RasPiOS Bookworm uses NetworkManager?
2022-09-07 14:10:05 +00:00
- name : Raspbian can use dhcpcd only with no N-M or SYS-NETD active
2022-05-06 03:52:48 +00:00
include_tasks : rpi_debian.yml
2022-09-07 14:10:05 +00:00
when : is_raspbian and not network_manager_active
2022-05-06 03:52:48 +00:00
- name : Not RPi, Not NetworkManager, Not systemd-networkd in use
include_tasks : debian.yml
2022-10-28 17:55:43 +00:00
when : not is_raspbian and not network_manager_active and not systemd_networkd_active
#when: (not is_raspbian and not network_manager_active and not systemd_networkd_active and is_debuntu) or is_ubuntu_16
2022-05-06 03:52:48 +00:00
#### end network layout
2023-04-23 21:11:03 +00:00
- name : hostapd
include_tasks : hostapd.yml
2022-05-06 03:52:48 +00:00
- name : Restart services
include_tasks : restart.yml
2022-07-22 13:51:53 +00:00
2022-05-06 03:52:48 +00:00
# end block
when : network_installed is defined and network_enabled
2022-07-16 17:47:30 +00:00
2022-07-22 15:25:47 +00:00
2022-07-16 17:47:30 +00:00
- name : Create {{ iiab_etc_path }}/install-flags/iiab-network-complete on second pass of network role.
file :
path : "{{ iiab_etc_path }}/install-flags/iiab-network-complete"
state : touch
when : iiab_stage|int == 9