2017-10-31 03:55:24 +00:00
|
|
|
- include_tasks: detected_network.yml
|
2020-01-13 17:13:11 +00:00
|
|
|
when: not installing # REMOVE THIS LINE IF installing IS ALWAYS false AS SET IN roles/0-init/defaults/main.yml
|
2018-01-01 16:45:19 +00:00
|
|
|
|
2018-01-01 15:58:46 +00:00
|
|
|
- name: IF WIFI IS PRIMARY GATEWAY, PLEASE RUN 'iiab-hotspot-on' MANUALLY
|
2017-12-28 23:57:22 +00:00
|
|
|
set_fact:
|
2018-01-01 15:58:46 +00:00
|
|
|
hostapd_enabled: False # used in (1) hostapd.yml, (2) rpi_debian.yml +
|
2017-12-29 06:03:02 +00:00
|
|
|
# (3) its dhcpcd.conf.j2, (4) restart.yml
|
|
|
|
no_net_restart: True # used below in (1) sysd-netd-debian.yml,
|
|
|
|
# (2) debian.yml, (3) rpi_debian.yml
|
2017-12-29 00:39:29 +00:00
|
|
|
when: discovered_wireless_iface == iiab_wan_iface and not reboot_to_AP
|
2018-10-15 10:41:58 +00:00
|
|
|
# EITHER WAY: hostapd_enabled's state is RECORDED into {{ iiab_env_file }}
|
2018-04-09 00:57:49 +00:00
|
|
|
# in hostapd.yml for later use by...
|
2018-01-11 14:02:24 +00:00
|
|
|
# /usr/libexec/iiab-startup.sh, iiab-hotspot-off & iiab-hotspot-on
|
|
|
|
#
|
|
|
|
# Separate Idea, Not Without Risks: should WiFi-as-gateway detection logic
|
|
|
|
# be encapsulated into roles/network/tasks/hostapd.yml in future? Whereas
|
|
|
|
# today "./runtags hostapd" doesn't exist & "./runtags AP" is UNSUPPORTED!
|
2017-12-28 23:57:22 +00:00
|
|
|
|
2017-12-29 00:39:29 +00:00
|
|
|
#- name: RPi - reboot to AP post install - installed via wifi so the services are ready
|
|
|
|
# set_fact:
|
|
|
|
# iiab_lan_iface: br0
|
|
|
|
# iiab_wan_iface: "{{ discovered_wired_iface }}"
|
|
|
|
# iiab_wireless_lan_iface: "{{ discovered_wireless_iface }}"
|
|
|
|
# iiab_wired_lan_iface: ""
|
2020-03-04 23:00:01 +00:00
|
|
|
# when: is_raspbian and discovered_wireless_iface is defined and discovered_wireless_iface == iiab_wan_iface and reboot_to_AP
|
2017-11-13 06:20:08 +00:00
|
|
|
|
2017-10-31 03:55:24 +00:00
|
|
|
- include_tasks: computed_network.yml
|
2017-12-28 23:57:22 +00:00
|
|
|
when: not installing #REMOVE THIS LINE IF installing IS ALWAYS false AS SET IN roles/0-init/defaults/main.yml
|
2017-05-27 18:09:50 +00:00
|
|
|
|
2017-11-18 22:20:30 +00:00
|
|
|
- include_tasks: hostapd.yml
|
|
|
|
|
2017-12-29 00:39:29 +00:00
|
|
|
#- name: RPi - don't reboot to AP post install - installed via wifi - don't blow away current network
|
|
|
|
# set_fact:
|
|
|
|
# no_net_restart: True
|
|
|
|
# hostapd_enabled: False
|
2020-03-04 23:00:01 +00:00
|
|
|
# when: is_raspbian and discovered_wireless_iface is defined and discovered_wired_iface != iiab_wan_iface
|
2017-11-18 22:20:30 +00:00
|
|
|
|
2017-05-27 18:09:50 +00:00
|
|
|
##### Start static ip address info for first run #####
|
2017-10-31 03:55:24 +00:00
|
|
|
#- include_tasks: static.yml
|
2017-06-09 23:25:56 +00:00
|
|
|
# when: 'iiab_wan_iface != "none" and wan_ip != "dhcp"'
|
2017-05-27 18:09:50 +00:00
|
|
|
##### End static ip address info
|
|
|
|
|
2019-12-02 06:41:12 +00:00
|
|
|
#- include_tasks: hosts.yml
|
2017-05-27 18:09:50 +00:00
|
|
|
|
2019-01-16 09:49:30 +00:00
|
|
|
- name: Configure wondershaper
|
2017-11-13 02:57:13 +00:00
|
|
|
include_tasks: wondershaper.yml
|
2020-01-14 00:57:50 +00:00
|
|
|
when: wondershaper_install or wondershaper_installed is defined
|
2017-11-13 02:57:13 +00:00
|
|
|
|
2019-01-16 09:49:30 +00:00
|
|
|
- name: (Re)Install named
|
2017-11-13 02:57:13 +00:00
|
|
|
include_tasks: named.yml
|
2019-01-16 09:32:04 +00:00
|
|
|
when: named_install and FQDN_changed and iiab_stage|int == 9
|
2017-11-13 02:57:13 +00:00
|
|
|
|
2019-01-16 09:49:30 +00:00
|
|
|
- name: (Re)Install dhcpd
|
2017-11-13 02:57:13 +00:00
|
|
|
include_tasks: dhcpd.yml
|
2019-01-16 09:32:04 +00:00
|
|
|
when: dhcpd_install and FQDN_changed and iiab_stage|int == 9
|
2017-11-13 02:57:13 +00:00
|
|
|
|
2019-01-16 09:49:30 +00:00
|
|
|
- name: (Re)Install Squid
|
2017-11-13 02:57:13 +00:00
|
|
|
include_tasks: squid.yml
|
2019-01-16 09:32:04 +00:00
|
|
|
when: squid_install and FQDN_changed and iiab_stage|int == 9
|
2017-11-13 02:57:13 +00:00
|
|
|
|
2020-01-30 10:06:22 +00:00
|
|
|
#### Start services
|
2017-10-31 03:55:24 +00:00
|
|
|
|
2020-01-30 10:06:22 +00:00
|
|
|
- include_tasks: avahi.yml
|
2017-10-31 21:57:39 +00:00
|
|
|
- include_tasks: computed_services.yml
|
2017-11-01 14:15:59 +00:00
|
|
|
- include_tasks: enable_services.yml
|
|
|
|
|
2020-01-30 10:06:22 +00:00
|
|
|
#### End services
|
|
|
|
|
2017-11-01 14:15:59 +00:00
|
|
|
#### Start network layout
|
2020-01-30 10:06:22 +00:00
|
|
|
|
2017-11-23 04:57:38 +00:00
|
|
|
- name: Redhat networking
|
|
|
|
include_tasks: ifcfg_mods.yml
|
2019-05-24 07:06:43 +00:00
|
|
|
when: is_redhat | bool
|
2019-05-04 03:51:06 +00:00
|
|
|
#and not installing
|
2017-05-27 18:09:50 +00:00
|
|
|
|
2019-05-04 03:51:06 +00:00
|
|
|
- name: Netplan in use on Ubuntu 18.04+
|
2018-12-13 09:09:15 +00:00
|
|
|
include_tasks: netplan.yml
|
2019-05-04 03:51:06 +00:00
|
|
|
when: is_ubuntu and not is_ubuntu_16
|
2019-05-24 22:33:10 +00:00
|
|
|
#when: is_ubuntu_18 | bool
|
2019-05-04 03:51:06 +00:00
|
|
|
#and not installing
|
2018-12-13 09:09:15 +00:00
|
|
|
|
2018-12-14 19:54:46 +00:00
|
|
|
- name: NetworkManager in use
|
2017-11-23 04:57:38 +00:00
|
|
|
include_tasks: NM-debian.yml
|
2018-12-14 19:54:46 +00:00
|
|
|
when: is_debuntu and network_manager_active
|
2019-05-04 03:51:06 +00:00
|
|
|
#and not installing
|
2017-11-23 02:26:23 +00:00
|
|
|
|
2018-12-14 19:54:46 +00:00
|
|
|
- name: systemd-networkd in use
|
2017-11-23 04:57:38 +00:00
|
|
|
include_tasks: sysd-netd-debian.yml
|
2018-12-14 19:54:46 +00:00
|
|
|
when: is_debuntu and systemd_networkd_active
|
2019-05-04 03:51:06 +00:00
|
|
|
#and not installing
|
2017-05-27 18:09:50 +00:00
|
|
|
|
2017-11-23 04:57:38 +00:00
|
|
|
- name: RPi's have dhcpcd in use
|
|
|
|
include_tasks: rpi_debian.yml
|
2020-03-04 23:00:01 +00:00
|
|
|
when: is_raspbian
|
2019-05-04 03:51:06 +00:00
|
|
|
#and not installing
|
2017-05-27 18:09:50 +00:00
|
|
|
|
2017-11-23 04:57:38 +00:00
|
|
|
- name: Not RPi, Not NetworkManager, Not systemd-networkd in use
|
|
|
|
include_tasks: debian.yml
|
2020-03-04 23:00:01 +00:00
|
|
|
when: (not is_raspbian and not network_manager_active and not systemd_networkd_active and is_debuntu) or is_ubuntu_16
|
2019-05-04 03:51:06 +00:00
|
|
|
#and not installing
|
2017-09-09 21:12:05 +00:00
|
|
|
|
2017-10-15 20:08:08 +00:00
|
|
|
#### end network layout
|
2020-01-30 10:06:22 +00:00
|
|
|
|
2017-10-31 03:55:24 +00:00
|
|
|
- include_tasks: restart.yml
|
2020-01-30 10:06:22 +00:00
|
|
|
when: not installing # REMOVE THIS LINE IF installing IS ALWAYS false AS SET IN roles/0-init/defaults/main.yml
|