mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
replace is_rpi with rpi_model
This commit is contained in:
parent
845d88cf41
commit
4e57383379
4 changed files with 11 additions and 12 deletions
|
@ -7,7 +7,6 @@
|
|||
# These are defaults for boolean routines.
|
||||
first_run: False
|
||||
rpi_model: none
|
||||
is_rpi: False
|
||||
xo_model: none
|
||||
gw_active: False
|
||||
internet_available: False
|
||||
|
|
|
@ -57,18 +57,11 @@
|
|||
|
||||
- name: Set top-level variables from local_facts for convenience
|
||||
set_fact:
|
||||
rpi_model: "{{ ansible_local.local_facts.rpi_model }}"
|
||||
xo_model: "{{ ansible_local.local_facts.xo_model }}"
|
||||
phplib_dir: "{{ ansible_local.local_facts.phplib_dir }}"
|
||||
iiab_stage: "{{ ansible_local.local_facts.stage }}"
|
||||
|
||||
- name: Discover if this is running Raspbian -- if so assume it is an RPi
|
||||
set_fact:
|
||||
rpi_model: "rpi"
|
||||
is_rpi: True
|
||||
#no_net_restart: True
|
||||
#nobridge: True
|
||||
when: ansible_local.local_facts.os == "raspbian"
|
||||
|
||||
- name: Set exFAT_enabled if xo_model != "none"
|
||||
set_fact:
|
||||
exFAT_enabled: True
|
||||
|
@ -216,8 +209,8 @@
|
|||
value: "{{ gw_active }}"
|
||||
- option: internet_available
|
||||
value: "{{ internet_available }}"
|
||||
- option: is_rpi
|
||||
value: "{{ is_rpi }}"
|
||||
- option: rpi_model
|
||||
value: "{{ rpi_model }}"
|
||||
- option: first_run
|
||||
value: "{{ first_run }}"
|
||||
- option: local_tz
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
path: /etc/dphys-swapfile
|
||||
regexp: "^CONF_SWAPSIZE"
|
||||
line: "CONF_SWAPSIZE={{ pi_swap_file_size }}"
|
||||
when: is_debuntu | bool # Redundant, given raspberry_pi.yml is only run when rpi_model: "rpi" (similar to is_rpi: True). Until someone tries a non-debuntu OS on RPi?
|
||||
when: is_debuntu | bool # Redundant, given raspberry_pi.yml is only run when rpi_model: != "none" Until someone tries a non-debuntu OS on RPi?
|
||||
|
||||
- name: Restart swap service "dphys-swapfile" (debuntu)
|
||||
#command: /etc/init.d/dphys-swapfile restart
|
||||
|
|
|
@ -56,6 +56,12 @@ else
|
|||
XO_VERSION="none"
|
||||
fi
|
||||
|
||||
if [ -f /proc/device-tree/model ]; then
|
||||
RPI_VERSION=`cat /proc/device-tree/model`
|
||||
else
|
||||
RPI_VERSION="none"
|
||||
fi
|
||||
|
||||
ANSIBLE_VERSION=$(ansible --version|head -n 1|cut -f 2 -d " ")
|
||||
|
||||
if [ ! x$DHCPCD_PATH = x ]; then
|
||||
|
@ -77,6 +83,7 @@ cat <<EOF
|
|||
"iiab_branch" : "$BRANCH",
|
||||
"iiab_commit" : "$COMMIT",
|
||||
"xo_model" : "$XO_VERSION",
|
||||
"rpi_model" : "$RPI_VERSION",
|
||||
"ansible_version" : "$ANSIBLE_VERSION",
|
||||
"os" : "$OS",
|
||||
"os_ver" : "$OS_VER"}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue