1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 11:42:08 +00:00
iiab/roles/network/tasks/ifcfg_mods.yml
georgejhunt 29b0b50885 Debian9 (#91)
* do a special download and install of usbmount

* misspelled iiab_download_url

* misspell downloads_dir

* diable php-sqlite

* php version issues

* fixes transferred from recognize branch

* local_fact moved

* remove preload

* remove preload

* spell ansible

* debian9 sqlite3

* package needs name

* remove prepped

* use apt ratheer than ansible package for npm

* monit disable chkconfig

* moodle needs php-zip and php-mbstring

* debian9 -> debian-9

* returen to os_ver nomenclature for OS.yml
2017-07-04 13:27:44 -07:00

98 lines
3.6 KiB
YAML

- name: Stop the Access Point Hostapd program
service: name=hostapd.service
state=stopped
when: iiab_wireless_lan_iface != "none"
# might need an exclude for F18 here
- name: Now disconnect bridge slaves
shell: nmcli c delete id "System {{ item|trim }}"
ignore_errors: True
when: item|trim != iiab_wireless_lan_iface
with_items:
- "{{ ifcfg_slaves.stdout_lines }}"
# clear all bridge ifcfg files
- name: Now delete slave bridge ifcfg files
shell: rm -f /etc/sysconfig/network-scripts/ifcfg-"{{ item }}"
when: num_lan_interfaces != "0" or iiab_wireless_lan_iface != "none"
with_items:
- "{{ ifcfg_slaves.stdout_lines }}"
- name: Now delete original ifcfg files
shell: rm -f /etc/sysconfig/network-scripts/ifcfg-"{{ item }}"
when: num_lan_interfaces == "1" and iiab_lan_iface != "br0"
with_items:
- "{{ discovered_lan_iface }}"
- name: Stop the LAN/Bridge deleting iiab-LAN
shell: nmcli con delete id iiab-LAN
ignore_errors: True
changed_when: False
when: (num_lan_interfaces != "0" or iiab_wireless_lan_iface != "none")
## vars/ users should set user_wan_iface to avoid messy redetect
- include: redetect.yml
when: discovered_wan_iface == "none" and user_wan_iface == "auto"
# move gateway if not WAN
# might have wifi info if wireless is used as uplink.
- include: edit_ifcfg.yml
when: has_wifi_gw == "none" and has_ifcfg_gw != "none" and has_ifcfg_gw != "/etc/sysconfig/network-scripts/ifcfg-WAN"
# create ifcfg-WAN if missing
# if we get here we have gateway but no ifcfg file
- include: create_ifcfg.yml
when: iiab_wan_iface != "none" and not has_WAN and has_ifcfg_gw == "none" and xo_model == "none" and not iiab_demo_mode
- name: Configuring LAN interface as iiab_lan_iface
template: src=network/ifcfg.j2
dest=/etc/sysconfig/network-scripts/ifcfg-LAN
when: iiab_lan_iface != "none"
# can be more than one wired interface
- name: Wired enslaving ## lan_list_result ## to Bridge
template: src=network/ifcfg-slave.j2
dest=/etc/sysconfig/network-scripts/ifcfg-{{ item|trim }}
when: iiab_lan_iface == "br0" and item|trim != iiab_wireless_lan_iface and item|trim != iiab_wan_iface
with_items:
- "{{ lan_list_result.stdout_lines }}"
- name: WiFi enslaving {{ iiab_wireless_lan_iface }} to Bridge
template: src=network/wifi-slave.j2
dest=/etc/sysconfig/network-scripts/ifcfg-{{ iiab_wireless_lan_iface }}
when: iiab_lan_iface == "br0" and iiab_wireless_lan_iface != "none"
tags:
- network
- include: enable_wan.yml
when: not installing and not iiab_demo_mode
# monitor-connection-files defaults to no with F21, F18-F20 defaults to yes
- name: Re-read network config files
shell: nmcli con reload
when: not installing and not no_NM_reload
# test point, we should always have one with any kind of starting point
# no ifcfg = supply
# had but not WAN = rename and edit if wired, skip wifi gateway.
# test point, confirm onboot=no is OK everywhere
- name: Enabling pre-existing ifcfg-WAN file
shell: nmcli conn up id iiab-WAN
when: has_WAN and iiab_wan_iface != "none" and not installing and not iiab_demo_mode
- name: Enabling ifcfg-LAN file
shell: nmcli conn up id iiab-LAN
ignore_errors: True
when: iiab_lan_iface != "none" and not installing and not iiab_demo_mode
# we could do the DEVICE name stuff for a cleaner looking nmcli
- name: Enabling ifcfg slaves
shell: nmcli conn up id "System {{ item|trim }}"
ignore_errors: True
when: iiab_lan_iface == "br0" and item|trim != iiab_wireless_lan_iface and item|trim != iiab_wan_iface and not iiab_demo_mode
with_items:
- "{{ lan_list_result.stdout_lines }}"
# testpoint confirm with 'nmcli c show' 'brctl show'