1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

Merge pull request #439 from iiab/master

Sync from iiab/iiab:master
This commit is contained in:
A Holt 2020-10-21 15:51:59 -07:00 committed by GitHub
commit fc122de11b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 152 additions and 100 deletions

View file

@ -9,10 +9,10 @@
- /etc/iiab/iiab_state.yml
roles:
- { role: 0-init, tags: ['0-init'] }
- { role: 4-server-options, tags: ['4-server-options'] }
- { role: 5-xo-services, tags: ['5-xo-services'] }
- { role: 6-generic-apps, tags: ['6-generic-apps'] }
- { role: 7-edu-apps, tags: ['7-edu-apps'] }
- { role: 8-mgmt-tools, tags: ['8-mgmt-tools'] }
- { role: 9-local-addons, tags: ['9-local-addons'] }
- { role: 0-init }
- { role: 4-server-options }
- { role: 5-xo-services }
- { role: 6-generic-apps }
- { role: 7-edu-apps }
- { role: 8-mgmt-tools }
- { role: 9-local-addons }

View file

@ -9,11 +9,11 @@
- /etc/iiab/iiab_state.yml
roles:
- { role: 0-init, tags: ['0-init'] }
- { role: 4-server-options, tags: ['4-server-options'] }
- { role: 5-xo-services, tags: ['5-xo-services'] }
- { role: 6-generic-apps, tags: ['6-generic-apps'] }
- { role: 7-edu-apps, tags: ['7-edu-apps'] }
- { role: 8-mgmt-tools, tags: ['8-mgmt-tools'] }
- { role: 9-local-addons, tags: ['9-local-addons'] }
- { role: network, tags: ['network'] }
- { role: 0-init }
- { role: 4-server-options }
- { role: 5-xo-services }
- { role: 6-generic-apps }
- { role: 7-edu-apps }
- { role: 8-mgmt-tools }
- { role: 9-local-addons }
- { role: network }

View file

@ -9,5 +9,5 @@
- /etc/iiab/iiab_state.yml
roles:
- { role: 0-init, tags: ['network'] }
- { role: network, tags: ['network','base'] }
- { role: 0-init }
- { role: network }

View file

@ -14,63 +14,52 @@
- name: 0-init
include_role:
name: 0-init
tags: 0-init
- name: 1-prep
include_role:
name: 1-prep
when: ansible_local.local_facts.stage|int < 1
tags: 1-prep, platform, base
- name: 2-common
include_role:
name: 2-common
when: ansible_local.local_facts.stage|int < 2
tags: 2-common, base
- name: 3-base-server
include_role:
name: 3-base-server
when: ansible_local.local_facts.stage|int < 3
tags: 3-base-server, base
- name: 4-server-options
include_role:
name: 4-server-options
when: ansible_local.local_facts.stage|int < 4
tags: 4-server-options
- name: 5-xo-services
include_role:
name: 5-xo-services
when: ansible_local.local_facts.stage|int < 5
tags: 5-xo-services
- name: 6-generic-apps
include_role:
name: 6-generic-apps
when: ansible_local.local_facts.stage|int < 6
tags: 6-generic-apps
- name: 7-edu-apps
include_role:
name: 7-edu-apps
when: ansible_local.local_facts.stage|int < 7
tags: 7-edu-apps
- name: 8-mgmt-tools
include_role:
name: 8-mgmt-tools
when: ansible_local.local_facts.stage|int < 8
tags: 8-mgmt-tools
- name: 9-local-addons
include_role:
name: 9-local-addons
when: ansible_local.local_facts.stage|int < 9
tags: 9-local-addons
- name: Network
include_role:
name: network
tags: network

View file

@ -7,7 +7,7 @@
- /etc/iiab/local_vars.yml
roles:
- { role: 0-init, tags: ['0-init'] }
- { role: sshd, tags: ['sshd'] }
- { role: iiab-admin, tags: ['iiab-admin'] }
- { role: openvpn, tags: ['openvpn'] }
- { role: 0-init }
- { role: sshd }
- { role: iiab-admin }
- { role: openvpn }

View file

@ -0,0 +1,2 @@
.ol-box{box-sizing:border-box;border-radius:2px;border:2px solid #00f}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:rgba(0,60,136,.3);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid #eee;border-top:none;color:#eee;font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-step-marker{width:1px;height:15px;background-color:#000;float:right;z-Index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:12px;z-Index:11;color:#000;text-shadow:-2px 0 #fff,0 2px #fff,2px 0 #fff,0 -2px #fff}.ol-scale-text{position:absolute;font-size:14px;text-align:center;bottom:25px;color:#000;text-shadow:-2px 0 #fff,0 2px #fff,2px 0 #fff,0 -2px #fff}.ol-scale-singlebar{position:relative;height:10px;z-Index:9;box-sizing:border-box;border:1px solid #000}.ol-unsupported{display:none}.ol-unselectable,.ol-viewport{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:rgba(255,255,255,.4);border-radius:4px;padding:2px}.ol-control:hover{background-color:rgba(255,255,255,.6)}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:#fff;font-size:1.14em;font-weight:700;text-decoration:none;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:rgba(0,60,136,.5);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;font-size:1.2em;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:focus,.ol-control button:hover{text-decoration:none;background-color:rgba(0,60,136,.7)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em)}.ol-attribution ul{margin:0;padding:0 .5em;color:#000;text-shadow:0 0 2px #fff}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button,.ol-attribution ul{display:inline-block}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:rgba(255,255,255,.8)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:inline-block}.ol-overviewmap .ol-overviewmap-map{border:1px solid #7b98bc;height:150px;margin:2px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:1px;left:2px;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:rgba(255,255,255,.8)}.ol-overviewmap-box{border:2px dotted rgba(0,60,136,.7)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}
/*# sourceMappingURL=ol.css.map */

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -9,5 +9,5 @@
- /etc/iiab/iiab_state.yml
roles:
- { role: 0-init, tags: ['0-init'] }
- { role: "{{ role_to_run }}", tags: ['run'] }
- { role: 0-init }
- { role: "{{ role_to_run }}" }

View file

@ -1,25 +1,47 @@
#!/bin/bash
# upgrades return found, clean installs return 0
# interruptions return last stage number recorded (1-9)
if [ -f /etc/iiab/iiab.env ]; then
source /etc/iiab/iiab.env
STAGE=$STAGE
else
STAGE=0
fi
# 2020-10-19: Most of the 12 variables require a command[*] to be run to
# establish the var's value. WE DISPLAY ALL ERRORS / DIAGNOSTICS AND CONTINUE.
#
# [*] DOESN'T MATTER WHAT COMMAND: so long as it fails with Return Code != 0
# If statements then use that RC to force the var to these default values...
OS=`grep ^ID= /etc/*elease|cut -d= -f2`
OS=${OS//\"/}
STAGE=0
OS="none"
VERSION_ID="none" # This var's combined with the above, before being output
IIAB_BRANCH="none"
IIAB_COMMIT="none"
PHPLIB_DIR="none"
XO_MODEL="none"
RPI_MODEL="none"
ANSIBLE_VERSION="none"
DHCPCD="none" # The last 3 conditioned on string output not RC. SEE BELOW.
NETWORK_MANAGER="none"
SYSTEMD_NETWORKD="none"
# STAGE variable is for ./iiab-install which runs Ansible with iiab-stages.yml
# - fresh installs start at STAGE 0
# - interrupted installs record the last completed STAGE (1-9)
#
# We initialize it to '0' (zero) to cover the following 2 possibs: (1) iiab.env
# doesn't exist, or (2) iiab.env exists but fails to set STAGE=<something>
source /etc/iiab/iiab.env || true # STAGE var auto-set, so no "if" required.
if tmp=$(grep ^ID= /etc/*elease); then
OS=$(echo $tmp | cut -d= -f2)
OS=${OS//\"/} # Remove all '"'
fi
if [ -f /etc/rpi-issue ]; then
OS="raspbian"
fi
VERSION_ID=`grep VERSION_ID /etc/*elease | cut -d= -f2`
VERSION_ID=${VERSION_ID//\"/}
VERSION_ID=${VERSION_ID%%.*}
if tmp=$(grep ^VERSION_ID= /etc/*elease); then
VERSION_ID=$(echo $tmp | cut -d= -f2)
VERSION_ID=${VERSION_ID//\"/} # Remove all '"'
VERSION_ID=${VERSION_ID%%.*} # Remove all '.' & stuff to the right of em
fi
OS_VER=$OS-$VERSION_ID
DHCPCD_PATH=`which dhcpcd`
NM_PATH=`which NetworkManager`
# Previously supported Linux distributions / versions:
#"fedora-18" | \
@ -34,8 +56,12 @@ NM_PATH=`which NetworkManager`
#"raspbian-8" | \
#"raspbian-9" | \
# 2020-10-21: Debian 11 (Bullseye) not yet supported but adding this line to
# its /etc/os-release can help testing this unreleased OS: VERSION_ID="11"
case $OS_VER in
"debian-10" | \
"debian-11" | \
"ubuntu-20" | \
"linuxmint-20" | \
"raspbian-10")
@ -44,56 +70,61 @@ case $OS_VER in
;;
esac
# get current version
BRANCH=`git rev-parse --abbrev-ref HEAD`
COMMIT=`git rev-parse --verify HEAD`
# These next 2 help indicate what version of IIAB
tmp=$(git rev-parse --abbrev-ref HEAD) &&
IIAB_BRANCH=$tmp
tmp=$(git rev-parse --verify HEAD) &&
IIAB_COMMIT=$tmp
if [ -d /usr/lib64/php ]; then
PHPLIB_DIR=/usr/lib64/php
else
if [ -d /usr/lib/php5 ]; then
PHPLIB_DIR=/usr/lib/php5
else
PHPLIB_DIR=/usr/lib/php
fi
elif [ -d /usr/lib/php5 ]; then
PHPLIB_DIR=/usr/lib/php5
elif [ -d /usr/lib/php ]; then
PHPLIB_DIR=/usr/lib/php
fi
if [ -f /proc/device-tree/mfg-data/MN ]; then
XO_VERSION=`cat /proc/device-tree/mfg-data/MN`
else
XO_VERSION="none"
fi
tmp=$(cat /proc/device-tree/mfg-data/MN) &&
XO_MODEL=$tmp
if [ -f /proc/device-tree/model ]; then
RPI_VERSION=`cat /proc/device-tree/model`
else
RPI_VERSION="none"
fi
tmp=$(cat /proc/device-tree/model) &&
RPI_MODEL=$tmp
ANSIBLE_VERSION=$(ansible --version|head -n 1|cut -f 2 -d " ")
tmp=$(ansible --version) &&
ANSIBLE_VERSION=$(echo $tmp | head -n 1 | cut -f 2 -d " ")
# THESE LAST 3 ARE DIFFEENT as "systemctl is-enabled" unhelpfully returns the
# same rerror code (i.e. 1) REGARDLESS whether service is (A) disabled or
# (B) doesn't exist. SO WE TEST THE STRING OUTPUT INSTEAD OF THE RETURN CODE.
tmp=$(systemctl is-enabled dhcpcd)
[[ $tmp != "" ]] &&
DHCPCD=$tmp
#[[ $tmp ]] && DHCPCD=$tmp # Short Ain't Sweet (less understandable)
# Debian family only, as is_redhat would use NetworkManager as the service name
tmp=$(systemctl is-enabled network-manager)
[[ $tmp != "" ]] &&
NETWORK_MANAGER=$tmp
tmp=$(systemctl is-enabled systemd-networkd)
[[ $tmp != "" ]] &&
SYSTEMD_NETWORKD=$tmp
if [ ! x$DHCPCD_PATH = x ]; then
DHCPCD=`systemctl is-enabled dhcpcd`
fi
# the check is debian family only is_redhat would use NetworkManager as the
# service name.
if [ ! x$NM_PATH = x ]; then
NM=`systemctl is-enabled network-manager`
fi
SYSD_NETD=`systemctl is-enabled systemd-networkd`
cat <<EOF
{"phplib_dir" : "$PHPLIB_DIR",
"stage" : "$STAGE",
"dhcpcd" : "$DHCPCD",
"network_manager" : "$NM",
"systemd_networkd" : "$SYSD_NETD",
"iiab_branch" : "$BRANCH",
"iiab_commit" : "$COMMIT",
"xo_model" : "$XO_VERSION",
"rpi_model" : "$RPI_VERSION",
"network_manager" : "$NETWORK_MANAGER",
"systemd_networkd" : "$SYSTEMD_NETWORKD",
"iiab_branch" : "$IIAB_BRANCH",
"iiab_commit" : "$IIAB_COMMIT",
"xo_model" : "$XO_MODEL",
"rpi_model" : "$RPI_MODEL",
"ansible_version" : "$ANSIBLE_VERSION",
"os" : "$OS",
"os_ver" : "$OS_VER"}
EOF

View file

@ -12,7 +12,6 @@ proxy_user: squid
apache_service: httpd
apache_user: apache
apache_conf_dir: httpd/conf.d
apache_config_dir: "{{ apache_conf_dir }}" # for iiab-admin-console/roles/console/tasks/main.yml Line 150
apache_log_dir: /var/log/httpd
smb_service: smb
nmb_service: nmb

View file

@ -12,7 +12,6 @@ proxy: squid
proxy_user: proxy
apache_service: apache2
apache_conf_dir: apache2/sites-available
apache_config_dir: "{{ apache_conf_dir }}" # for iiab-admin-console/roles/console/tasks/main.yml Line 150
apache_user: www-data
apache_log_dir: /var/log/apache2
smb_service: smbd

26
vars/debian-11.yml Normal file
View file

@ -0,0 +1,26 @@
is_debuntu: True
is_debian: True
is_debian_11: True
# 2019-01-31: These apply if-only-if named_install and/or dhcpd_install are True
# (This is quite rare now that vars/default_vars.yml sets dnsmasq_install: True)
dns_service: bind9
dhcp_service: isc-dhcp-server
dns_user: bind
proxy: squid
proxy_user: proxy
apache_service: apache2
apache_conf_dir: apache2/sites-available
apache_user: www-data
apache_log_dir: /var/log/apache2
smb_service: smbd
nmb_service: nmbd
systemctl_program: /bin/systemctl
mysql_service: mariadb
apache_log: /var/log/apache2/access.log
sshd_package: openssh-server
sshd_service: ssh
php_version: 7.4
postgresql_version: 13
systemd_location: /lib/systemd/system

View file

@ -11,7 +11,6 @@ proxy: squid3
proxy_user: proxy
apache_service: apache2
apache_conf_dir: apache2/sites-available
apache_config_dir: "{{ apache_conf_dir }}" # for iiab-admin-console/roles/console/tasks/main.yml Line 150
apache_user: www-data
apache_log_dir: /var/log/apache2
smb_service: smbd

View file

@ -12,7 +12,6 @@ proxy: squid
proxy_user: proxy
apache_service: apache2
apache_conf_dir: apache2/sites-available
apache_config_dir: "{{ apache_conf_dir }}" # for iiab-admin-console/roles/console/tasks/main.yml Line 150
apache_user: www-data
apache_log_dir: /var/log/apache2
smb_service: smbd

View file

@ -698,6 +698,7 @@ is_linuxmint: False # Subset of is_ubuntu
is_linuxmint_20: False
is_debian: False # Covers both: Debian, Raspberry Pi OS (Raspbian)
is_debian_11: False
is_debian_10: False
is_debian_9: False
is_debian_8: False

View file

@ -12,7 +12,6 @@ proxy_user: squid
apache_service: httpd
apache_user: apache
apache_conf_dir: httpd/conf.d
apache_config_dir: "{{ apache_conf_dir }}" # for iiab-admin-console/roles/console/tasks/main.yml Line 150
apache_log_dir: /var/log/httpd
smb_service: smb
nmb_service: nmb

View file

@ -12,7 +12,6 @@ proxy_user: squid
apache_service: httpd
apache_user: apache
apache_conf_dir: httpd/conf.d
apache_config_dir: "{{ apache_conf_dir }}" # for iiab-admin-console/roles/console/tasks/main.yml Line 150
apache_log_dir: /var/log/httpd
smb_service: smb
nmb_service: nmb

View file

@ -15,7 +15,6 @@ proxy_user: proxy
apache_service: apache2
apache_user: www-data
apache_conf_dir: apache2/sites-available
apache_config_dir: "{{ apache_conf_dir }}" # for iiab-admin-console/roles/console/tasks/main.yml Line 150
apache_log_dir: /var/log/apache2
smb_service: smbd
nmb_service: nmbd

View file

@ -14,7 +14,6 @@ proxy: squid
proxy_user: proxy
apache_service: apache2
apache_conf_dir: apache2/sites-available
apache_config_dir: "{{ apache_conf_dir }}" # for iiab-admin-console/roles/console/tasks/main.yml Line 150
apache_user: www-data
apache_log_dir: /var/log/apache2
smb_service: smbd

View file

@ -13,7 +13,6 @@ proxy: squid3
proxy_user: proxy
apache_service: apache2
apache_conf_dir: apache2/sites-available
apache_config_dir: "{{ apache_conf_dir }}" # for iiab-admin-console/roles/console/tasks/main.yml Line 150
apache_user: www-data
apache_log_dir: /var/log/apache2
smb_service: smbd

View file

@ -14,7 +14,6 @@ proxy: squid
proxy_user: proxy
apache_service: apache2
apache_conf_dir: apache2/sites-available
apache_config_dir: "{{ apache_conf_dir }}" # for iiab-admin-console/roles/console/tasks/main.yml Line 150
apache_user: www-data
apache_log_dir: /var/log/apache2
smb_service: smbd

View file

@ -13,7 +13,6 @@ proxy_user: proxy
apache_service: apache2
apache_user: www-data
apache_conf_dir: apache2/sites-available
apache_config_dir: "{{ apache_conf_dir }}" # for iiab-admin-console/roles/console/tasks/main.yml Line 150
apache_log_dir: /var/log/apache2
smb_service: smbd
nmb_service: nmbd

View file

@ -13,7 +13,6 @@ proxy_user: proxy
apache_service: apache2
apache_user: www-data
apache_conf_dir: apache2/sites-available
apache_config_dir: "{{ apache_conf_dir }}" # for iiab-admin-console/roles/console/tasks/main.yml Line 150
apache_log_dir: /var/log/apache2
smb_service: smbd
nmb_service: nmbd

View file

@ -13,7 +13,6 @@ proxy_user: proxy
apache_service: apache2
apache_user: www-data
apache_conf_dir: apache2/sites-available
apache_config_dir: "{{ apache_conf_dir }}" # for iiab-admin-console/roles/console/tasks/main.yml Line 150
apache_log_dir: /var/log/apache2
smb_service: smbd
nmb_service: nmbd

View file

@ -13,7 +13,6 @@ proxy_user: proxy
apache_service: apache2
apache_user: www-data
apache_conf_dir: apache2/sites-available
apache_config_dir: "{{ apache_conf_dir }}" # for iiab-admin-console/roles/console/tasks/main.yml Line 150
apache_log_dir: /var/log/apache2
smb_service: smbd
nmb_service: nmbd

View file

@ -13,7 +13,6 @@ proxy_user: proxy
apache_service: apache2
apache_user: www-data
apache_conf_dir: apache2/sites-available
apache_config_dir: "{{ apache_conf_dir }}" # for iiab-admin-console/roles/console/tasks/main.yml Line 150
apache_log_dir: /var/log/apache2
smb_service: smbd
nmb_service: nmbd