mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
commit
1093b117c5
3 changed files with 15 additions and 22 deletions
|
@ -13,7 +13,6 @@
|
||||||
set_fact:
|
set_fact:
|
||||||
rpi_model: "{{ ansible_local.local_facts.rpi_model }}"
|
rpi_model: "{{ ansible_local.local_facts.rpi_model }}"
|
||||||
xo_model: "{{ ansible_local.local_facts.xo_model }}"
|
xo_model: "{{ ansible_local.local_facts.xo_model }}"
|
||||||
phplib_dir: "{{ ansible_local.local_facts.phplib_dir }}"
|
|
||||||
iiab_stage: "{{ ansible_local.local_facts.stage }}"
|
iiab_stage: "{{ ansible_local.local_facts.stage }}"
|
||||||
|
|
||||||
# We need to inialize the ini file and only write the location and version
|
# We need to inialize the ini file and only write the location and version
|
||||||
|
@ -123,8 +122,6 @@
|
||||||
value: "{{ iiab_base_ver }}"
|
value: "{{ iiab_base_ver }}"
|
||||||
- option: iiab_revision
|
- option: iiab_revision
|
||||||
value: "{{ iiab_revision }}"
|
value: "{{ iiab_revision }}"
|
||||||
- option: runtime_php
|
|
||||||
value: "{{ phplib_dir }}"
|
|
||||||
- option: runtime_branch
|
- option: runtime_branch
|
||||||
value: "{{ ansible_local.local_facts.iiab_branch }}"
|
value: "{{ ansible_local.local_facts.iiab_branch }}"
|
||||||
- option: runtime_commit
|
- option: runtime_commit
|
||||||
|
|
|
@ -1,15 +1,17 @@
|
||||||
- name: Disable built-in serial uart in /boot/firmware/usercfg.txt on ubuntu
|
- name: Disable built-in serial uart in /boot/firmware/usercfg.txt on Ubuntu < 20.10 on RPi
|
||||||
lineinfile:
|
lineinfile:
|
||||||
path: /boot/firmware/usercfg.txt
|
path: /boot/firmware/usercfg.txt
|
||||||
line: "enable_uart=0"
|
line: "enable_uart=0"
|
||||||
state: present
|
state: present
|
||||||
when: is_ubuntu and rpi_model != "none"
|
when: rpi_model != "none" and is_ubuntu and (ansible_distribution_version is version('20.10', '<'))
|
||||||
|
#when: rpi_model != "none" and is_ubuntu and (ansible_distribution_release == "focal")
|
||||||
|
# 2020-10-27 #2585: Ubuntu Desktop 20.10 has no /boot/firmware/usercfg.txt
|
||||||
|
|
||||||
- name: Install pi-bluetooth package on Ubuntu
|
- name: Install pi-bluetooth package on Ubuntu on RPi
|
||||||
package:
|
package:
|
||||||
name: pi-bluetooth
|
name: pi-bluetooth
|
||||||
state: present
|
state: present
|
||||||
when: is_ubuntu and rpi_model != "none"
|
when: rpi_model != "none" and is_ubuntu
|
||||||
|
|
||||||
- name: Install bluetooth packages
|
- name: Install bluetooth packages
|
||||||
package:
|
package:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# 2020-10-19: Most of the 12 variables require a command[*] to be run to
|
# 2020-10-27: Most of the 11 variables require a command[*] to be run to
|
||||||
# establish the var's value. WE DISPLAY ALL ERRORS / DIAGNOSTICS AND CONTINUE.
|
# 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
|
# [*] DOESN'T MATTER WHAT COMMAND: so long as it fails with Return Code != 0
|
||||||
|
@ -11,7 +11,6 @@ OS="none"
|
||||||
VERSION_ID="none" # This var's combined with the above, before being output
|
VERSION_ID="none" # This var's combined with the above, before being output
|
||||||
IIAB_BRANCH="none"
|
IIAB_BRANCH="none"
|
||||||
IIAB_COMMIT="none"
|
IIAB_COMMIT="none"
|
||||||
PHPLIB_DIR="none"
|
|
||||||
XO_MODEL="none"
|
XO_MODEL="none"
|
||||||
RPI_MODEL="none"
|
RPI_MODEL="none"
|
||||||
ANSIBLE_VERSION="none"
|
ANSIBLE_VERSION="none"
|
||||||
|
@ -36,7 +35,9 @@ if [ -f /etc/rpi-issue ]; then
|
||||||
OS="raspbian"
|
OS="raspbian"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if tmp=$(grep ^VERSION_ID= /etc/*elease); then
|
# /etc/lsb-release could also be grep'd. But /etc/upstream-release/lsb-release
|
||||||
|
# on Linux Mint 20 caused grep of /etc/*elease to fail (on directory not file)
|
||||||
|
if tmp=$(grep ^VERSION_ID= /etc/os-release); then
|
||||||
VERSION_ID=$(echo $tmp | cut -d= -f2)
|
VERSION_ID=$(echo $tmp | cut -d= -f2)
|
||||||
VERSION_ID=${VERSION_ID//\"/} # Remove all '"'
|
VERSION_ID=${VERSION_ID//\"/} # Remove all '"'
|
||||||
VERSION_ID=${VERSION_ID%%.*} # Remove all '.' & stuff to the right of em
|
VERSION_ID=${VERSION_ID%%.*} # Remove all '.' & stuff to the right of em
|
||||||
|
@ -77,14 +78,6 @@ tmp=$(git rev-parse --abbrev-ref HEAD) &&
|
||||||
tmp=$(git rev-parse --verify HEAD) &&
|
tmp=$(git rev-parse --verify HEAD) &&
|
||||||
IIAB_COMMIT=$tmp
|
IIAB_COMMIT=$tmp
|
||||||
|
|
||||||
if [ -d /usr/lib64/php ]; then
|
|
||||||
PHPLIB_DIR=/usr/lib64/php
|
|
||||||
elif [ -d /usr/lib/php5 ]; then
|
|
||||||
PHPLIB_DIR=/usr/lib/php5
|
|
||||||
elif [ -d /usr/lib/php ]; then
|
|
||||||
PHPLIB_DIR=/usr/lib/php
|
|
||||||
fi
|
|
||||||
|
|
||||||
tmp=$(cat /proc/device-tree/mfg-data/MN) &&
|
tmp=$(cat /proc/device-tree/mfg-data/MN) &&
|
||||||
XO_MODEL=$tmp
|
XO_MODEL=$tmp
|
||||||
|
|
||||||
|
@ -104,8 +97,10 @@ tmp=$(systemctl is-enabled dhcpcd)
|
||||||
DHCPCD=$tmp
|
DHCPCD=$tmp
|
||||||
#[[ $tmp ]] && DHCPCD=$tmp # Short Ain't Sweet (less understandable)
|
#[[ $tmp ]] && DHCPCD=$tmp # Short Ain't Sweet (less understandable)
|
||||||
|
|
||||||
# Debian family only, as is_redhat would use NetworkManager as the service name
|
# is_redhat uses "NetworkManager". Debian 7 & Ubuntu 14.10 required
|
||||||
tmp=$(systemctl is-enabled network-manager)
|
# "network-manager" (prior to 2015/systemd). Ubuntu 20.10 dropped the
|
||||||
|
# legacy symlink from "network-manager.service" to "NetworkManager.service"
|
||||||
|
tmp=$(systemctl is-enabled NetworkManager)
|
||||||
[[ $tmp != "" ]] &&
|
[[ $tmp != "" ]] &&
|
||||||
NETWORK_MANAGER=$tmp
|
NETWORK_MANAGER=$tmp
|
||||||
|
|
||||||
|
@ -115,8 +110,7 @@ tmp=$(systemctl is-enabled systemd-networkd)
|
||||||
|
|
||||||
|
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
{"phplib_dir" : "$PHPLIB_DIR",
|
{"stage" : "$STAGE",
|
||||||
"stage" : "$STAGE",
|
|
||||||
"dhcpcd" : "$DHCPCD",
|
"dhcpcd" : "$DHCPCD",
|
||||||
"network_manager" : "$NETWORK_MANAGER",
|
"network_manager" : "$NETWORK_MANAGER",
|
||||||
"systemd_networkd" : "$SYSTEMD_NETWORKD",
|
"systemd_networkd" : "$SYSTEMD_NETWORKD",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue