From 2390e90a18b61e59e16c283da8febdf8b02715d4 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 27 Sep 2021 14:15:06 -0400 Subject: [PATCH 1/2] vars/ubuntu-2110.yml vars/ubuntu-2204.yml etc --- scripts/local_facts.fact | 25 +++++++++-------- vars/default_vars.yml | 7 +++-- vars/{ubuntu-16.yml => ubuntu-16.yml.unused} | 0 vars/{ubuntu-17.yml => ubuntu-17.yml.unused} | 0 vars/{ubuntu-18.yml => ubuntu-18.yml.unused} | 0 vars/{ubuntu-19.yml => ubuntu-19.yml.unused} | 0 vars/{ubuntu-20.yml => ubuntu-2004.yml} | 2 +- vars/{ubuntu-21.yml => ubuntu-2104.yml} | 6 ++-- vars/ubuntu-2110.yml | 29 ++++++++++++++++++++ vars/{ubuntu-22.yml => ubuntu-2204.yml} | 2 +- 10 files changed, 51 insertions(+), 20 deletions(-) rename vars/{ubuntu-16.yml => ubuntu-16.yml.unused} (100%) rename vars/{ubuntu-17.yml => ubuntu-17.yml.unused} (100%) rename vars/{ubuntu-18.yml => ubuntu-18.yml.unused} (100%) rename vars/{ubuntu-19.yml => ubuntu-19.yml.unused} (100%) rename vars/{ubuntu-20.yml => ubuntu-2004.yml} (97%) rename vars/{ubuntu-21.yml => ubuntu-2104.yml} (84%) create mode 100644 vars/ubuntu-2110.yml rename vars/{ubuntu-22.yml => ubuntu-2204.yml} (97%) diff --git a/scripts/local_facts.fact b/scripts/local_facts.fact index 2bca88ea0..031f202a9 100755 --- a/scripts/local_facts.fact +++ b/scripts/local_facts.fact @@ -42,10 +42,14 @@ fi # of 2020: https://github.com/raspberrypi/Raspberry-Pi-OS-64bit/issues/6 if tmp=$(grep ^VERSION_ID= /etc/os-release); 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 + # https://gnu.org/software/bash/manual/bash.html#Shell-Parameter-Expansion + VERSION_ID=${VERSION_ID//\"/} # Remove all '"' + [[ $OS == "ubuntu" ]] && # e.g. '22.04' -> '2204' + VERSION_ID=${VERSION_ID//\./} # Remove all '.' + [[ $OS == "linuxmint" ]] && # e.g. '20.2' -> '20' + VERSION_ID=${VERSION_ID%%.*} # Remove all '.' & stuff to the right fi -OS_VER=$OS-$VERSION_ID +OS_VER="$OS-$VERSION_ID" # Previously supported Linux distributions / versions: #"fedora-18" | \ @@ -61,19 +65,16 @@ OS_VER=$OS-$VERSION_ID #"raspbian-8" | \ #"raspbian-9" | \ -# 2021-06-19: Ubuntu 21.10 (Impish Indri) not yet supported but this -# unreleased OS can help testing. For now this means MANUALLY changing -# php_version: 7.4 to 8.0 in /opt/iiab/iiab/vars/ubuntu-21.yml - -# 2020-07-31: Debian 12 (Bookworm) not yet supported but adding this line -# to its /etc/os-release can help testing this upcoming OS: VERSION_ID="12" +# 2020-09-27: With Debian 12 (Bookworm) pre-releases, please manually add +# this line to its /etc/os-release before installing IIAB: VERSION_ID="12" case $OS_VER in "debian-11" | \ "debian-12" | \ - "ubuntu-20" | \ - "ubuntu-21" | \ - "ubuntu-22" | \ + "ubuntu-2004" | \ + "ubuntu-2104" | \ + "ubuntu-2110" | \ + "ubuntu-2204" | \ "linuxmint-20" | \ "linuxmint-21" | \ "raspbian-10" | \ diff --git a/vars/default_vars.yml b/vars/default_vars.yml index b2097ed59..49bd2da3c 100644 --- a/vars/default_vars.yml +++ b/vars/default_vars.yml @@ -713,9 +713,10 @@ pbx_http_port: 83 is_debuntu: False # Covers all 4: Ubuntu, Linux Mint, Debian, Raspberry Pi OS (Raspbian) is_ubuntu: False # Covers: Ubuntu, Linux Mint -is_ubuntu_22: False -is_ubuntu_21: False -is_ubuntu_20: False +is_ubuntu_2204: False +is_ubuntu_2110: False +is_ubuntu_2104: False +is_ubuntu_2004: False is_ubuntu_19: False is_ubuntu_18: False is_ubuntu_17: False diff --git a/vars/ubuntu-16.yml b/vars/ubuntu-16.yml.unused similarity index 100% rename from vars/ubuntu-16.yml rename to vars/ubuntu-16.yml.unused diff --git a/vars/ubuntu-17.yml b/vars/ubuntu-17.yml.unused similarity index 100% rename from vars/ubuntu-17.yml rename to vars/ubuntu-17.yml.unused diff --git a/vars/ubuntu-18.yml b/vars/ubuntu-18.yml.unused similarity index 100% rename from vars/ubuntu-18.yml rename to vars/ubuntu-18.yml.unused diff --git a/vars/ubuntu-19.yml b/vars/ubuntu-19.yml.unused similarity index 100% rename from vars/ubuntu-19.yml rename to vars/ubuntu-19.yml.unused diff --git a/vars/ubuntu-20.yml b/vars/ubuntu-2004.yml similarity index 97% rename from vars/ubuntu-20.yml rename to vars/ubuntu-2004.yml index 1dd5aa3ce..7e7e1a2ad 100644 --- a/vars/ubuntu-20.yml +++ b/vars/ubuntu-2004.yml @@ -2,7 +2,7 @@ # /opt/iiab/iiab/vars/default_vars.yml -- these 'True' lines override that: is_debuntu: True is_ubuntu: True # Opposite of is_debian for now -is_ubuntu_20: True +is_ubuntu_2004: True # 2019-03-23: 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) diff --git a/vars/ubuntu-21.yml b/vars/ubuntu-2104.yml similarity index 84% rename from vars/ubuntu-21.yml rename to vars/ubuntu-2104.yml index 5f8b4c8d4..2e602c79b 100644 --- a/vars/ubuntu-21.yml +++ b/vars/ubuntu-2104.yml @@ -2,7 +2,7 @@ # /opt/iiab/iiab/vars/default_vars.yml -- these 'True' lines override that: is_debuntu: True is_ubuntu: True # Opposite of is_debian for now -is_ubuntu_21: True +is_ubuntu_2104: True # 2019-03-23: 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) @@ -23,7 +23,7 @@ mysql_service: mariadb apache_log: /var/log/apache2/access.log sshd_package: openssh-server sshd_service: ssh -php_version: 7.4 # 2021-04-22: Will Ubuntu 21.10 require 8.0? -postgresql_version: 13 # 2021-04-22: Will Ubuntu 21.10 require 14? +php_version: 7.4 +postgresql_version: 13 systemd_location: /lib/systemd/system python_ver: 3.9 diff --git a/vars/ubuntu-2110.yml b/vars/ubuntu-2110.yml new file mode 100644 index 000000000..b410e0559 --- /dev/null +++ b/vars/ubuntu-2110.yml @@ -0,0 +1,29 @@ +# Every is_ var is initially set to 'False' at the bottom of +# /opt/iiab/iiab/vars/default_vars.yml -- these 'True' lines override that: +is_debuntu: True +is_ubuntu: True # Opposite of is_debian for now +is_ubuntu_2110: True + +# 2019-03-23: 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 +dns_user: bind +dhcp_service: isc-dhcp-server + +proxy: squid +proxy_user: proxy +apache_service: apache2 +apache_user: www-data +apache_conf_dir: apache2/sites-available +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: 8.0 +postgresql_version: 13 +systemd_location: /lib/systemd/system +python_ver: 3.9 diff --git a/vars/ubuntu-22.yml b/vars/ubuntu-2204.yml similarity index 97% rename from vars/ubuntu-22.yml rename to vars/ubuntu-2204.yml index 5d1653097..45228126e 100644 --- a/vars/ubuntu-22.yml +++ b/vars/ubuntu-2204.yml @@ -2,7 +2,7 @@ # /opt/iiab/iiab/vars/default_vars.yml -- these 'True' lines override that: is_debuntu: True is_ubuntu: True # Opposite of is_debian for now -is_ubuntu_22: True +is_ubuntu_2204: True # 2019-03-23: 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) From c76c6e88d47e428d8d192661e3a7ec0209d5cc7c Mon Sep 17 00:00:00 2001 From: root Date: Mon, 27 Sep 2021 15:14:09 -0400 Subject: [PATCH 2/2] Lint/indent scripts/local_facts.fact --- scripts/local_facts.fact | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/local_facts.fact b/scripts/local_facts.fact index 031f202a9..c4e92f1f3 100755 --- a/scripts/local_facts.fact +++ b/scripts/local_facts.fact @@ -79,9 +79,9 @@ case $OS_VER in "linuxmint-21" | \ "raspbian-10" | \ "raspbian-11") - ;; + ;; *) OS_VER="OS Not Supported -- Plz Read: https://github.com/iiab/iiab/wiki/IIAB-Platforms" - ;; + ;; esac # These next 2 help indicate what version of IIAB