mirror of
https://github.com/iiab/iiab.git
synced 2025-02-12 19:22:24 +00:00
commit
68bf55d4d2
8 changed files with 81 additions and 47 deletions
|
@ -28,10 +28,10 @@
|
|||
when: squid_install | bool
|
||||
tags: base, squid, network, domain
|
||||
|
||||
- name: Install Bluetooth - only on Raspberry Pi
|
||||
- name: Install Bluetooth - only on Raspberry Pi
|
||||
include_role:
|
||||
name: bluetooth
|
||||
when: is_rpi | bool and bluetooth_install | bool
|
||||
when: is_rpi and bluetooth_install
|
||||
tags: bluetooth
|
||||
|
||||
# NETWORK moved to the very end, after Stage 9 (9-LOCAL-ADDONS)
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
bluetooth_install: False
|
||||
bluetooth_enabled: False
|
||||
bluetooth_term_enabled: False
|
||||
# bluetooth_install: True
|
||||
# bluetooth_enabled: False
|
||||
|
||||
# bluetooth_term_enabled: False
|
||||
|
||||
# All above are set in: github.com/iiab/iiab/blob/master/vars/default_vars.yml
|
||||
# If nec, change them by editing /etc/iiab/local_vars.yml prior to installing!
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
# If nec, change them by editing /etc/iiab/local_vars.yml prior to installing!
|
||||
|
||||
# Info needed to install Lokole
|
||||
lokole_version: 0.4.2
|
||||
lokole_version: 0.4.3
|
||||
lokole_admin_user: admin # lowercase seems nec here (even though uppercase Admin/changeme is IIAB's OOB recommendation!)
|
||||
lokole_admin_password: changeme
|
||||
lokole_install_path: "{{ content_base }}/lokole" # /library/lokole
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
version: "{{ lokole_version }}"
|
||||
virtualenv: "{{ lokole_venv }}"
|
||||
virtualenv_command: python3 -m venv "{{ lokole_venv }}"
|
||||
extra_args: --no-cache-dir # To avoid caching issues e.g. soon after new releases hit https://pypi.org/project/opwen-email-client/
|
||||
tags:
|
||||
- install
|
||||
when: internet_available | bool
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
service:
|
||||
name: dhcpd
|
||||
enabled: no
|
||||
when: not dhcpd_enabled and dhcpd_install
|
||||
when: dhcpd_install and not dhcpd_enabled
|
||||
|
||||
# service is restarted with NM dispatcher.d script
|
||||
- name: Enable dhcpd service
|
||||
service:
|
||||
name: dhcpd
|
||||
enabled: yes
|
||||
when: dhcpd_enabled and dhcpd_install
|
||||
when: dhcpd_install and dhcpd_enabled
|
||||
|
||||
- name: Install /etc/sysconfig/dhcpd, /etc/dhcpd-iiab.conf from templates
|
||||
template:
|
||||
|
@ -21,7 +21,7 @@
|
|||
with_items:
|
||||
- { src: 'dhcp/dhcpd-env.j2', dest: '/etc/sysconfig/dhcpd', mode: '0644' }
|
||||
- { src: 'dhcp/dhcpd-iiab.conf.j2', dest: '/etc/dhcpd-iiab.conf', mode: '0644' }
|
||||
when: dhcpd_enabled and dhcpd_install
|
||||
when: dhcpd_install and dhcpd_enabled
|
||||
|
||||
- name: Install /etc/named-iiab.conf and two *.zone.db files into /var/named-iiab
|
||||
template:
|
||||
|
@ -34,34 +34,65 @@
|
|||
- { src: 'named/named-iiab.conf.j2', dest: '/etc/named-iiab.conf', mode: '0644' }
|
||||
- { src: 'named/school.local.zone.db', dest: '/var/named-iiab/', mode: '0644' }
|
||||
- { src: 'named/school.internal.zone.db', dest: '/var/named-iiab/', mode: '0644' }
|
||||
when: named_enabled and named_install
|
||||
when: named_install and named_enabled
|
||||
|
||||
- name: Enable named service ({{ dns_service }}) if named_enabled
|
||||
systemd:
|
||||
name: "{{ dns_service }}"
|
||||
enabled: yes
|
||||
when: named_enabled and named_install
|
||||
when: named_install and named_enabled
|
||||
|
||||
- name: Disable named service ({{ dns_service }}) if not named_enabled
|
||||
systemd:
|
||||
name: "{{ dns_service }}"
|
||||
enabled: no
|
||||
when: not named_enabled and named_install
|
||||
when: named_install and not named_enabled
|
||||
|
||||
- name: Install /etc/dnsmasq.d/iiab.conf from template, when dnsmasq_enabled and isn't Appliance
|
||||
template:
|
||||
src: network/dnsmasq.conf.j2
|
||||
dest: /etc/dnsmasq.d/iiab.conf
|
||||
when: dnsmasq_enabled and dnsmasq_install and (iiab_network_mode != "Appliance")
|
||||
when: dnsmasq_install and dnsmasq_enabled and (iiab_network_mode != "Appliance")
|
||||
|
||||
- name: Copy script to restart dnsmasq whenever br0 comes up
|
||||
template:
|
||||
src: "roles/network/templates/network/dnsmasq.sh.j2"
|
||||
dest: "/etc/networkd-dispatcher/routable.d/dnsmasq.sh"
|
||||
mode: "0755"
|
||||
## Another way to skin the cat
|
||||
##- name: Check if systemd service networkd-dispatcher is enabled
|
||||
## systemd:
|
||||
## name: networkd-dispatcher
|
||||
## state: reloaded
|
||||
## register: systemd_out
|
||||
##
|
||||
## Yet Another
|
||||
## command: systemctl show networkd-dispatcher | grep ^UnitFileState=
|
||||
## would yield "UnitFileState=enabled"
|
||||
##
|
||||
#- name: Check if systemd service networkd-dispatcher is enabled
|
||||
# command: systemctl is-enabled networkd-dispatcher
|
||||
# register: nd_enabled
|
||||
# ignore_errors: True
|
||||
#
|
||||
#- debug:
|
||||
# var: nd_enabled
|
||||
|
||||
- name: Check if /etc/networkd-dispatcher/routable.d exists
|
||||
stat:
|
||||
path: /etc/networkd-dispatcher/routable.d
|
||||
register: nd_dir
|
||||
|
||||
#- debug:
|
||||
# var: nd_dir
|
||||
|
||||
#- name: To restart dnsmasq whenever br0 comes up, install /etc/networkd-dispatcher/routable.d/dnsmasq.sh from template (if isn't Appliance, and networkd-dispatcher is enabled, and directory /etc/networkd-dispatcher/routable.d exists, i.e. OS's like Ubuntu 18.04)
|
||||
- name: To restart dnsmasq whenever br0 comes up, install /etc/networkd-dispatcher/routable.d/dnsmasq.sh from template (if isn't Appliance, and directory /etc/networkd-dispatcher/routable.d exists, i.e. OS's like Ubuntu 18.04)
|
||||
template:
|
||||
src: roles/network/templates/network/dnsmasq.sh.j2
|
||||
dest: /etc/networkd-dispatcher/routable.d/dnsmasq.sh
|
||||
mode: 0755
|
||||
owner: root
|
||||
group: root
|
||||
when: dnsmasq_enabled and dnsmasq_install and (iiab_network_mode != "Appliance") and (not is_rpi)
|
||||
when: dnsmasq_install and dnsmasq_enabled and nd_dir.stat.exists and nd_dir.stat.isdir and (iiab_network_mode != "Appliance")
|
||||
#when: dnsmasq_install and dnsmasq_enabled and nd_enabled is defined and nd_enabled.stdout == "enabled" and nd_dir.stat.exists and nd_dir.stat.isdir and (iiab_network_mode != "Appliance")
|
||||
#when: dnsmasq_install and dnsmasq_enabled and systemd_out.status.UnitFileState == "enabled" and networkd_dir.stat.exists and networkd_dir.stat.isdir and (iiab_network_mode != "Appliance")
|
||||
#when: dnsmasq_enabled and dnsmasq_install and (iiab_network_mode != "Appliance") and (not is_rpi) and (not is_ubuntu_16)
|
||||
|
||||
- name: Remove /etc/dnsmasq.d/iiab.conf, when not dnsmasq_enabled or is Appliance
|
||||
file:
|
||||
|
@ -73,25 +104,25 @@
|
|||
systemd:
|
||||
name: iiab-dnsmasq
|
||||
enabled: yes
|
||||
when: dnsmasq_enabled and dnsmasq_install
|
||||
when: dnsmasq_install and dnsmasq_enabled
|
||||
|
||||
- name: Disable iiab-dnsmasq, if not dnsmasq_enabled
|
||||
systemd:
|
||||
name: iiab-dnsmasq
|
||||
enabled: no
|
||||
when: not dnsmasq_enabled and dnsmasq_install
|
||||
when: dnsmasq_install and not dnsmasq_enabled
|
||||
|
||||
- name: Enable DansGuardian systemd service, if dansguardian_enabled
|
||||
systemd:
|
||||
name: dansguardian
|
||||
enabled: yes
|
||||
when: dansguardian_enabled and dansguardian_install
|
||||
when: dansguardian_install and dansguardian_enabled
|
||||
|
||||
- name: Disable DansGuardian, if not dansguardian_enabled
|
||||
systemd:
|
||||
name: dansguardian
|
||||
enabled: no
|
||||
when: not dansguardian_enabled and dansguardian_install
|
||||
when: dansguardian_install and not dansguardian_enabled
|
||||
|
||||
- name: Mandate 'HTTPCACHE_ON=True' in {{ iiab_env_file }}, if squid_enabled
|
||||
lineinfile:
|
||||
|
@ -99,13 +130,13 @@
|
|||
regexp: '^HTTPCACHE_ON=*'
|
||||
line: 'HTTPCACHE_ON=True'
|
||||
state: present
|
||||
when: squid_enabled and squid_install
|
||||
when: squid_install and squid_enabled
|
||||
|
||||
- name: Enable Squid systemd service ({{ proxy }}) if squid_enabled
|
||||
systemd:
|
||||
name: "{{ proxy }}"
|
||||
enabled: yes
|
||||
when: squid_enabled and squid_install
|
||||
when: squid_install and squid_enabled
|
||||
|
||||
- name: Install /etc/{{ proxy }}/squid-iiab.conf from template, owned by {{ proxy_user }}:{{ proxy_user }}
|
||||
template:
|
||||
|
@ -120,20 +151,20 @@
|
|||
owner: "{{ proxy_user }}"
|
||||
group: "{{ proxy_user }}"
|
||||
mode: 0644
|
||||
when: squid_enabled and squid_install
|
||||
when: squid_install and squid_enabled
|
||||
|
||||
- name: Point to Squid config file from startup file, if squid_enabled (debuntu)
|
||||
lineinfile:
|
||||
regexp: '^CONFIG'
|
||||
line: "CONFIG=/etc/{{ proxy }}/squid-iiab.conf"
|
||||
path: "/etc/init.d/{{ proxy }}"
|
||||
when: squid_enabled and squid_install and is_debuntu
|
||||
when: squid_install and squid_enabled and is_debuntu
|
||||
|
||||
- name: Disable Squid service, if not squid_enabled
|
||||
systemd:
|
||||
name: "{{ proxy }}"
|
||||
enabled: no
|
||||
when: not squid_enabled and squid_install
|
||||
when: squid_install and not squid_enabled
|
||||
|
||||
- name: Revert to 'HTTPCACHE_ON=False' if not squid_enabled
|
||||
lineinfile:
|
||||
|
@ -141,19 +172,19 @@
|
|||
regexp: '^HTTPCACHE_ON=*'
|
||||
line: 'HTTPCACHE_ON=False'
|
||||
state: present
|
||||
when: not squid_enabled
|
||||
when: squid_install and not squid_enabled
|
||||
|
||||
- name: Enable Wondershaper service, if wondershaper_enabled
|
||||
systemd:
|
||||
name: wondershaper
|
||||
enabled: yes
|
||||
when: wondershaper_enabled and wondershaper_install
|
||||
when: wondershaper_install and wondershaper_enabled
|
||||
|
||||
- name: Disable Wondershaper service, if not wondershaper_enabled
|
||||
systemd:
|
||||
name: wondershaper
|
||||
enabled: no
|
||||
when: not wondershaper_enabled and wondershaper_install
|
||||
when: wondershaper_install and not wondershaper_enabled
|
||||
|
||||
# check-LAN should be iptables.yml remove later
|
||||
- name: Install clean copy of /usr/bin/iiab-gen-iptables from template
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ "$IFACE" == "{{ iiab_lan_iface }}" ];
|
||||
then
|
||||
/bin/systemctl restart dnsmasq.service
|
||||
if [ "$IFACE" == "{{ iiab_lan_iface }}" ]; then
|
||||
/bin/systemctl restart dnsmasq.service
|
||||
fi
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
- name: Make sure the osm-vector-maps directory exists
|
||||
- name: Ensure directory {{ vector_map_path }}/maplist/assets exists
|
||||
file:
|
||||
path: '{{ vector_map_path }}/maplist/assets'
|
||||
state: directory
|
||||
|
@ -6,30 +6,30 @@
|
|||
group: '{{ apache_user }}'
|
||||
mode: '0755'
|
||||
|
||||
- name: Fetch the catalog for osm maps
|
||||
- name: Download map catalog {{ iiab_map_url }}/assets/regions.json to {{ vector_map_path }}/maplist/assets/
|
||||
get_url:
|
||||
url: "{{ iiab_map_url }}/assets/regions.json"
|
||||
dest: '{{ vector_map_path }}/maplist/assets/'
|
||||
|
||||
- name: Create a link to osm catalog in /common/assets
|
||||
- name: Symlink catalog {{ doc_root }}/common/assets/regions.json -> {{ vector_map_path }}/maplist/assets/regions.json
|
||||
file:
|
||||
src: "{{ vector_map_path }}/maplist/assets/regions.json"
|
||||
dest: "{{ doc_root }}/common/assets/regions.json"
|
||||
state: link
|
||||
|
||||
- name: Fetch the javascript bundle with openlayers for test page
|
||||
- name: Download the JavaScript bundle with OpenLayers (main.js) for test page http://box/maps/maplist
|
||||
get_url:
|
||||
url: "{{ iiab_map_url }}/../main.js"
|
||||
dest: '{{ vector_map_path }}/maplist/'
|
||||
|
||||
- name: Fetch the index.html for test page
|
||||
- name: Install {{ vector_map_path }}/maplist/index.html from template, for test page http://box/maps/maplist
|
||||
template:
|
||||
src: "index.html"
|
||||
dest: '{{ vector_map_path }}/maplist/index.html'
|
||||
|
||||
# Bboxes (bounding boxes) are currently square. But geofabrik has non-rectangular bboxes.
|
||||
# So bring the bounding box definition from cloud (bboxes.geojson is big)
|
||||
- name: Fetch the bounding box description for osm maps
|
||||
- name: Download bounding box definitions (bboxes.geojson) to {{ vector_map_path }}/maplist/assets/
|
||||
get_url:
|
||||
url: "{{ iiab_map_url }}/assets/bboxes.geojson"
|
||||
dest: '{{ vector_map_path }}/maplist/assets/'
|
||||
|
@ -39,7 +39,7 @@
|
|||
name: python-geojson
|
||||
state: present
|
||||
|
||||
- name: Install the script to update osm catalog
|
||||
- name: Install /usr/bin/iiab-update-map for updating of Map Pack catalog
|
||||
template:
|
||||
src: iiab-update-map
|
||||
dest: /usr/bin/iiab-update-map
|
||||
|
@ -49,13 +49,13 @@
|
|||
#- name: Run the script that does osm-vector-maps housekeeping
|
||||
# shell: /usr/bin/iiab-update-map
|
||||
|
||||
- name: Copy the Countries geojson to assets
|
||||
- name: Copy countries.json (geojson) to {{ vector_map_path }}/maplist/assets
|
||||
copy:
|
||||
src: countries.json
|
||||
dest: '{{ vector_map_path }}/maplist/assets'
|
||||
|
||||
# It is too complicated to use a single file for both iiab and admin-console
|
||||
- name: Copy the duplicated javascript to assets
|
||||
- name: Copy the duplicated JavaScript (map_functions.js) to {{ vector_map_path }}/maplist/assets
|
||||
copy:
|
||||
src: map_functions.js
|
||||
dest: '{{ vector_map_path }}/maplist/assets'
|
||||
|
@ -78,8 +78,7 @@
|
|||
state: absent
|
||||
when: not osm_vector_maps_enabled and is_debuntu
|
||||
|
||||
- name: Copy the redirect to the test page -- delete this if more than one map
|
||||
- name: Copy the redirect to the test page -- delete this later if more than one map
|
||||
copy:
|
||||
src: test-index.redirect
|
||||
dest: "{{ vector_map_path }}/index.html"
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ sugarizer_dir_version: sugarizer-1.1.0 # WAS: sugarizer-1.0, sugarizer-master
|
|||
sugarizer_git_version: v1.1.0 # WAS: v1.0.1, master
|
||||
# PLEASE HELP MONITOR https://github.com/llaske/sugarizer/releases
|
||||
|
||||
sugarizer_server_dir_version: sugarizer-server-1.1.0 # WAS: sugarizer-server-1.0, sugarizer-server-master, sugarizer-server-dev
|
||||
sugarizer_server_git_version: v1.1.0 # WAS: v1.0.1, master, dev, f27bf6acd56aba6d99116ef471ca713b0f0dfed3
|
||||
sugarizer_server_dir_version: sugarizer-server-1.1.1 # WAS: sugarizer-server-1.0, sugarizer-server-master, sugarizer-server-dev, sugarizer-server-1.1.0
|
||||
sugarizer_server_git_version: v1.1.1 # WAS: v1.0.1, master, dev, f27bf6acd56aba6d99116ef471ca713b0f0dfed3, v1.1.0
|
||||
# PLEASE HELP MONITOR https://github.com/llaske/sugarizer-server/commits/dev
|
||||
# AND https://github.com/llaske/sugarizer-server/releases
|
||||
|
|
Loading…
Reference in a new issue