mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
network/main remove installing, move hostapd.yml, notes, cleanup
This commit is contained in:
parent
ccb1bf348a
commit
a311454436
10 changed files with 48 additions and 12 deletions
17
roles/network/tasks/fedora/create_ifcfg.yml.deprecated
Normal file
17
roles/network/tasks/fedora/create_ifcfg.yml.deprecated
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
- name: Stop 'Wired WAN connection'
|
||||||
|
shell: nmcli dev disconnect {{ discovered_wan_iface }}
|
||||||
|
ignore_errors: True
|
||||||
|
changed_when: False
|
||||||
|
when: discovered_wan_iface != "none" and not has_WAN and has_ifcfg_gw == "none"
|
||||||
|
|
||||||
|
# set user_wan_iface: <device> for static
|
||||||
|
# use wan_* for static info
|
||||||
|
- name: Supply ifcfg-WAN file
|
||||||
|
template: src=network/ifcfg-WAN.j2
|
||||||
|
dest=/etc/sysconfig/network-scripts/ifcfg-WAN
|
||||||
|
when: iiab_wan_iface != "none" and not has_WAN and has_ifcfg_gw == "none"
|
||||||
|
|
||||||
|
- name: Now setting ifcfg-WAN True after creating file
|
||||||
|
set_fact:
|
||||||
|
has_WAN: True
|
||||||
|
when: iiab_wan_iface != "none" and has_ifcfg_gw == "none"
|
28
roles/network/tasks/fedora/hosts.yml.deprecated
Normal file
28
roles/network/tasks/fedora/hosts.yml.deprecated
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
# this (hosts.yml) WAS invoked by roles/network/tasks/main.yml up until 2019-12-10
|
||||||
|
|
||||||
|
#TODO: Use vars instead of hardcoded values
|
||||||
|
- name: Remove FQDN with 172.18.96.1 in /etc/hosts without LAN (if iiab_lan_iface == "none" and not installing)
|
||||||
|
lineinfile:
|
||||||
|
path: /etc/hosts
|
||||||
|
regexp: '^172\.18\.96\.1'
|
||||||
|
state: absent
|
||||||
|
when: iiab_lan_iface == "none" and not installing
|
||||||
|
|
||||||
|
- name: Configure FQDN with 172.18.96.1 in /etc/hosts with LAN (if iiab_lan_iface != "none" and not installing)
|
||||||
|
lineinfile:
|
||||||
|
path: /etc/hosts
|
||||||
|
regexp: '^172\.18\.96\.1'
|
||||||
|
line: '172.18.96.1 {{ iiab_hostname }}.{{ iiab_domain }} {{ iiab_hostname }} box box.lan'
|
||||||
|
state: present
|
||||||
|
when: not (iiab_lan_iface == "none") and not installing
|
||||||
|
|
||||||
|
# roles/0-init/tasks/hostname.yml ALSO does this:
|
||||||
|
- name: 'Put FQDN & hostnames in /etc/hosts: "127.0.0.1 {{ iiab_hostname }}.{{ iiab_domain }} localhost.localdomain localhost {{ iiab_hostname }} box box.lan" (if iiab_lan_iface == "none" and not installing, appliance mode?)'
|
||||||
|
lineinfile:
|
||||||
|
path: /etc/hosts
|
||||||
|
regexp: '^127\.0\.0\.1'
|
||||||
|
line: '127.0.0.1 {{ iiab_hostname }}.{{ iiab_domain }} localhost.localdomain localhost {{ iiab_hostname }} box box.lan'
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0644
|
||||||
|
when: iiab_lan_iface == "none" and not installing
|
|
@ -1,12 +1,12 @@
|
||||||
- include_tasks: detected_network.yml
|
- include_tasks: detected_network.yml
|
||||||
when: not installing # REMOVE THIS LINE IF installing IS ALWAYS false AS SET IN roles/0-init/defaults/main.yml
|
|
||||||
|
|
||||||
- name: IF WIFI IS PRIMARY GATEWAY, PLEASE RUN 'iiab-hotspot-on' MANUALLY
|
- name: IF WIFI IS PRIMARY GATEWAY, PLEASE RUN 'iiab-hotspot-on' MANUALLY
|
||||||
set_fact:
|
set_fact:
|
||||||
hostapd_enabled: False # used in (1) hostapd.yml, (2) rpi_debian.yml +
|
hostapd_enabled: False # used in (1) hostapd.yml, (2) rpi_debian.yml +
|
||||||
# (3) its dhcpcd.conf.j2, (4) restart.yml
|
# (3) its dhcpcd.conf.j2, (4) restart.yml
|
||||||
no_net_restart: True # used below in (1) sysd-netd-debian.yml,
|
no_net_restart: True # used below in (1) sysd-netd-debian.yml,
|
||||||
# (2) debian.yml, (3) rpi_debian.yml
|
# (2) debian.yml, (3) rpi_debian.yml,
|
||||||
|
# (4) NM-debian.yml
|
||||||
when: discovered_wireless_iface == iiab_wan_iface and not reboot_to_AP
|
when: discovered_wireless_iface == iiab_wan_iface and not reboot_to_AP
|
||||||
# EITHER WAY: hostapd_enabled's state is RECORDED into {{ iiab_env_file }}
|
# EITHER WAY: hostapd_enabled's state is RECORDED into {{ iiab_env_file }}
|
||||||
# in hostapd.yml for later use by...
|
# in hostapd.yml for later use by...
|
||||||
|
@ -25,9 +25,6 @@
|
||||||
# when: is_raspbian and discovered_wireless_iface is defined and discovered_wireless_iface == iiab_wan_iface and reboot_to_AP
|
# when: is_raspbian and discovered_wireless_iface is defined and discovered_wireless_iface == iiab_wan_iface and reboot_to_AP
|
||||||
|
|
||||||
- include_tasks: computed_network.yml
|
- include_tasks: computed_network.yml
|
||||||
when: not installing #REMOVE THIS LINE IF installing IS ALWAYS false AS SET IN roles/0-init/defaults/main.yml
|
|
||||||
|
|
||||||
- include_tasks: hostapd.yml
|
|
||||||
|
|
||||||
#- name: RPi - don't reboot to AP post install - installed via wifi - don't blow away current network
|
#- name: RPi - don't reboot to AP post install - installed via wifi - don't blow away current network
|
||||||
# set_fact:
|
# set_fact:
|
||||||
|
@ -35,13 +32,6 @@
|
||||||
# hostapd_enabled: False
|
# hostapd_enabled: False
|
||||||
# when: is_raspbian and discovered_wireless_iface is defined and discovered_wired_iface != iiab_wan_iface
|
# when: is_raspbian and discovered_wireless_iface is defined and discovered_wired_iface != iiab_wan_iface
|
||||||
|
|
||||||
##### Start static ip address info for first run #####
|
|
||||||
#- include_tasks: static.yml
|
|
||||||
# when: 'iiab_wan_iface != "none" and wan_ip != "dhcp"'
|
|
||||||
##### End static ip address info
|
|
||||||
|
|
||||||
#- include_tasks: hosts.yml
|
|
||||||
|
|
||||||
- name: Configure wondershaper
|
- name: Configure wondershaper
|
||||||
include_tasks: wondershaper.yml
|
include_tasks: wondershaper.yml
|
||||||
when: wondershaper_install or wondershaper_installed is defined
|
when: wondershaper_install or wondershaper_installed is defined
|
||||||
|
@ -63,6 +53,7 @@
|
||||||
- include_tasks: avahi.yml
|
- include_tasks: avahi.yml
|
||||||
- include_tasks: computed_services.yml
|
- include_tasks: computed_services.yml
|
||||||
- include_tasks: enable_services.yml
|
- include_tasks: enable_services.yml
|
||||||
|
- include_tasks: hostapd.yml
|
||||||
|
|
||||||
#### End services
|
#### End services
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue