1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-12 19:22:24 +00:00

iiab_env_file -> {{ iiab_env_file }} or "{{ iiab_env_file }}"

This commit is contained in:
root 2018-10-15 06:41:58 -04:00
parent d9c73cc804
commit b973906dc3
18 changed files with 23 additions and 23 deletions

View file

@ -1,4 +1,4 @@
# Use these to tag a release at a point in time, for /etc/iiab/iiab.env
# Use these to tag a release at a point in time, for {{ iiab_env_file }}
iiab_base_ver: 6.7
iiab_revision: 0

View file

@ -4,7 +4,7 @@
def get_iiab_env(name):
""" read iiab.env file for a value, return "" if does not exist"""
try:
fd = open("/etc/iiab/iiab.env","r")
fd = open("{{ iiab_env_file }}","r")
for line in fd:
line = line.lstrip()
line = line.rstrip('\n')

View file

@ -15,7 +15,7 @@ fi
if [[ $(grep -i raspbian /etc/*release) &&
#($(grep "hostapd_enabled = False" /etc/iiab/config_vars.yml) ||
#((! $(grep "hostapd_enabled = True" /etc/iiab/config_vars.yml)) &&
! $(grep "^HOSTAPD_ENABLED=True" /etc/iiab/iiab.env) ]];
! $(grep "^HOSTAPD_ENABLED=True" {{ iiab_env_file }}) ]];
# NEGATED LOGIC HELPS FORCE PROMISCUOUS MODE EARLY IN INSTALL
# (when network/tasks/main.yml hasn't yet populated iiab.env)

View file

@ -3,7 +3,7 @@
# Pull down repo's entire wiki (and similar) to create offline docs
set -e
source /etc/iiab/iiab.env
source {{ iiab_env_file }}
INPUT=/tmp/iiab-wiki
OUTPUT=/tmp/iiab-wiki.out
DESTPATH=/library/www/html/info

View file

@ -29,7 +29,7 @@ if not IIAB_PATH in sys.path:
from iiab_env import get_iiab_env
# Config Files
# iiab_ini_file should be in /etc/iiab/iiab.env
# iiab_ini_file should be in {{ iiab_env_file }}
iiab_ini_file = "{{ iiab_ini_file }}" # nominally /etc/iiab/iiab.ini
# iiab_ini_file = "/etc/iiab/iiab.ini" # comment out after testing

View file

@ -172,9 +172,9 @@
iiab_wan_iface: "none"
when: adapter_count.stdout|int >= "5" and device_gw == "none" and gui_wan_iface == "unset" and gui_static_wan is defined
- name: Record IIAB_WAN_DEVICE to /etc/iiab/iiab.env
- name: Record IIAB_WAN_DEVICE to {{ iiab_env_file }}
lineinfile:
dest: /etc/iiab/iiab.env
dest: "{{ iiab_env_file }}"
regexp: '^IIAB_WAN_DEVICE=*'
line: 'IIAB_WAN_DEVICE="{{ iiab_wan_iface }}"'
state: present
@ -182,9 +182,9 @@
tags:
- network
- name: Record IIAB_LAN_DEVICE to /etc/iiab/iiab.env
- name: Record IIAB_LAN_DEVICE to {{ iiab_env_file }}
lineinfile:
dest: /etc/iiab/iiab.env
dest: "{{ iiab_env_file }}"
regexp: '^IIAB_LAN_DEVICE=*'
line: 'IIAB_LAN_DEVICE="{{ iiab_lan_iface }}"'
state: present

View file

@ -1,5 +1,5 @@
- name: iiab_wan_device
shell: grep IIAB_WAN_DEVICE /etc/iiab/iiab.env | awk -F "=" '{print $2}'
shell: grep IIAB_WAN_DEVICE {{ iiab_env_file }} | awk -F "=" '{print $2}'
when: iiab_stage|int > 4
register: prior_gw

View file

@ -79,7 +79,7 @@
- name: Create xs_httpcache flag
lineinfile:
dest: /etc/iiab/iiab.env
dest: "{{ iiab_env_file }}"
regexp: '^HTTPCACHE_ON=*'
line: 'HTTPCACHE_ON=True'
state: present
@ -121,7 +121,7 @@
- name: Remove xs_httpcache flag
lineinfile:
dest: /etc/iiab/iiab.env
dest: "{{ iiab_env_file }}"
regexp: '^HTTPCACHE_ON=*'
line: 'HTTPCACHE_ON=False'
state: present

View file

@ -55,9 +55,9 @@
enabled: yes
when: hostapd_enabled and iiab_wireless_lan_iface is defined and iiab_network_mode != "Appliance"
- name: Record HOSTAPD_ENABLED to /etc/iiab/iiab.env
- name: Record HOSTAPD_ENABLED to {{ iiab_env_file }}
lineinfile:
dest: /etc/iiab/iiab.env
dest: "{{ iiab_env_file }}"
regexp: '^HOSTAPD_ENABLED=*'
line: 'HOSTAPD_ENABLED={{ hostapd_enabled }}'
state: present

View file

@ -11,7 +11,7 @@
no_net_restart: True # used below in (1) sysd-netd-debian.yml,
# (2) debian.yml, (3) rpi_debian.yml
when: discovered_wireless_iface == iiab_wan_iface and not reboot_to_AP
# EITHER WAY: hostapd_enabled's state is RECORDED into /etc/iiab/iiab.env
# EITHER WAY: hostapd_enabled's state is RECORDED into {{ iiab_env_file }}
# in hostapd.yml for later use by...
# /usr/libexec/iiab-startup.sh, iiab-hotspot-off & iiab-hotspot-on
#

View file

@ -1,5 +1,5 @@
#!/bin/bash -x
source /etc/iiab/iiab.env
source {{ iiab_env_file }}
{% if is_debuntu %}
IPTABLES=/sbin/iptables
IPTABLES_DATA=/etc/iptables.up.rules

View file

@ -16,4 +16,4 @@ if grep -qi raspbian /etc/*release; then
ip link set dev wlan0 promisc on
fi
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=False/" /etc/iiab/iiab.env
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=False/" {{ iiab_env_file }}

View file

@ -17,6 +17,6 @@ if grep -qi raspbian /etc/*release; then
ip link set dev wlan0 promisc off
fi
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=True/" /etc/iiab/iiab.env
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=True/" {{ iiab_env_file }}
echo -e "\nPlease consider rebooting now.\n"

View file

@ -19,7 +19,7 @@ if [ -f /etc/iiab/openvpn_handle ]; then
#else
# # Option #3: Dangerous to invoke hypothetical variables :(
# source /etc/iiab/iiab.env
# source {{ iiab_env_file }}
# # Option #4: CAUSED FAILURES IN AUGUST 2018, invoking stale variable from /etc/iiab/iiab.ini, but safer now that relegated to #4 ?
# if [ -z "$HANDLE" ]; then
# HANDLE=`cat /etc/iiab/iiab.ini | gawk \

View file

@ -55,7 +55,7 @@
- name: Put variable in iiab.env that enables display of content at root of USB
lineinfile:
dest: /etc/iiab/iiab.env
dest: "{{ iiab_env_file }}"
regexp: "^IIAB_USB_LIB_SHOW_ALL.*"
line: "IIAB_USB_LIB_SHOW_ALL={{ iiab_usb_lib_show_all }}"

View file

@ -1,5 +1,5 @@
#!/bin/bash
# turn on the flag which registers new USB sticks at root directory
sed -i -e's/^IIAB_USB_LIB_SHOW_ALL.*/IIAB_USB_LIB_SHOW_ALL=False/' /etc/iiab/iiab.env
sed -i -e's/^IIAB_USB_LIB_SHOW_ALL.*/IIAB_USB_LIB_SHOW_ALL=False/' {{ iiab_env_file }}

View file

@ -1,5 +1,5 @@
#!/bin/bash
# turn on the flag which registers new USB sticks at root directory
sed -i -e's/^IIAB_USB_LIB_SHOW_ALL.*/IIAB_USB_LIB_SHOW_ALL=True/' /etc/iiab/iiab.env
sed -i -e's/^IIAB_USB_LIB_SHOW_ALL.*/IIAB_USB_LIB_SHOW_ALL=True/' {{ iiab_env_file }}

View file

@ -9,7 +9,7 @@
#
# by Tim Moody tim@timmoody.com
source /etc/iiab/iiab.env
source {{ iiab_env_file }}
case $IIAB_USB_LIB_SHOW_ALL in
'True'|'true'|'TRUE')
logger -p user.notice -t "70-usb-library" -- "Displaying root directory on $UM_MOUNTPOINT."