From 41c697233cb01d835fb808ed336ffe538e573395 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Fri, 15 Sep 2017 11:56:57 -0500 Subject: [PATCH] lose rpi_debian - rebased -- dropped file --- iiab-network | 17 +++++++++++------ roles/network/tasks/debian.yml | 7 +++++++ roles/network/tasks/ifcfg_mods.yml | 4 ++++ roles/network/tasks/restart.yml | 6 +++--- roles/network/tasks/squid.yml | 10 +++++----- 5 files changed, 30 insertions(+), 14 deletions(-) diff --git a/iiab-network b/iiab-network index 863d04da7..87be5ccdc 100755 --- a/iiab-network +++ b/iiab-network @@ -27,18 +27,23 @@ fi Start=`date` export ANSIBLE_LOG_PATH="$XSCE_DIR/iiab-network.log" ansible-playbook -i ansible_hosts iiab-network.yml --connection=local +End=`date` echo "" >> iiab-network.log -ls -la /etc/sys*/net*/ifcfg* >> iiab-network.log if [ ! "OS" == "debian" ]; then + ls -la /etc/sys*/net*/ifcfg* >> iiab-network.log nmcli d >> iiab-network.log nmcli c >> iiab-network.log fi echo "" >> iiab-network.log -brctl show >> iiab-network.log +ip r >> iiab-network.log echo "" >> iiab-network.log -echo "run start:" >> iiab-network.log -echo "$Start" >> iiab-network.log -echo "run end:" >> iiab-network.log -date >> iiab-network.log +brctl show br0>> iiab-network.log +echo "run start: $Start" >> iiab-network.log +echo "run end: $End" >> iiab-network.log echo "" >> iiab-network.log echo "" >> iiab-network.log +ip r +brctl show br0 +echo "run start:$Start" +echo "run end: $End" + diff --git a/roles/network/tasks/debian.yml b/roles/network/tasks/debian.yml index 1f1c79e0e..7845c7524 100644 --- a/roles/network/tasks/debian.yml +++ b/roles/network/tasks/debian.yml @@ -68,3 +68,10 @@ - name: restart the networking service service: name=networking state=restarted when: interface.changed + +- name: restart hostapd when wifi is present + service: name=hostapd state=started + when: iiab_wireless_lan_iface != "none" and hostapd_enabled and iiab_network_mode != "Appliance" + +- name: dhcp_server may be affected - starting - user choice + service: name={{ dhcp_service2 }} state=started diff --git a/roles/network/tasks/ifcfg_mods.yml b/roles/network/tasks/ifcfg_mods.yml index 9c4023e42..39c4d0156 100644 --- a/roles/network/tasks/ifcfg_mods.yml +++ b/roles/network/tasks/ifcfg_mods.yml @@ -110,5 +110,9 @@ with_items: - "{{ lan_list_result.stdout_lines }}" +- name: restart hostapd when wifi is present + service: name=hostapd state=started + when: iiab_wireless_lan_iface != "none" and hostapd_enabled and iiab_network_mode != "Appliance" + - name: dhcp_server may be affected - starting - user choice service: name={{ dhcp_service2 }} state=started diff --git a/roles/network/tasks/restart.yml b/roles/network/tasks/restart.yml index 62661b19e..2180daf51 100644 --- a/roles/network/tasks/restart.yml +++ b/roles/network/tasks/restart.yml @@ -41,14 +41,14 @@ - name: Run iptables command: /usr/bin/iiab-gen-iptables -- name: Checking if slave is active waiting 10 seconds - shell: "sleep {{ hostapd_wait }} | brctl show | grep {{ iiab_wireless_lan_iface }}" +- name: Checking if wifi slave is active waiting {{ hostapd_wait }} seconds + shell: "sleep {{ hostapd_wait }} | brctl show br0 | grep {{ iiab_wireless_lan_iface }}" ignore_errors: True changed_when: False register: wifi_slave when: iiab_lan_iface == "br0" and iiab_wireless_lan_iface != "none" -- name: Restart hostapd if slave is inactive +- name: Restart hostapd if wifi slave is inactive service: name=hostapd.service state=restarted when: iiab_lan_iface == "br0" and item|trim == "" diff --git a/roles/network/tasks/squid.yml b/roles/network/tasks/squid.yml index 595a24e06..1abadaf4b 100644 --- a/roles/network/tasks/squid.yml +++ b/roles/network/tasks/squid.yml @@ -67,11 +67,11 @@ - include: dansguardian.yml when: dansguardian_install -- name: Stop Squid - service: name={{ proxy }} - state=stopped - ignore_errors: yes - when: not installing +#- name: Stop Squid +# service: name={{ proxy }} +# state=stopped +# ignore_errors: yes +# when: not installing - name: Add Squid to service list ini_file: dest='{{ service_filelist }}'