1
0
Fork 0
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:
Jerry Vonau 2020-03-04 17:02:01 -06:00
parent 845d88cf41
commit 4e57383379
4 changed files with 11 additions and 12 deletions

View file

@ -7,7 +7,6 @@
# These are defaults for boolean routines. # These are defaults for boolean routines.
first_run: False first_run: False
rpi_model: none rpi_model: none
is_rpi: False
xo_model: none xo_model: none
gw_active: False gw_active: False
internet_available: False internet_available: False

View file

@ -57,18 +57,11 @@
- name: Set top-level variables from local_facts for convenience - name: Set top-level variables from local_facts for convenience
set_fact: set_fact:
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 }}" phplib_dir: "{{ ansible_local.local_facts.phplib_dir }}"
iiab_stage: "{{ ansible_local.local_facts.stage }}" 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" - name: Set exFAT_enabled if xo_model != "none"
set_fact: set_fact:
exFAT_enabled: True exFAT_enabled: True
@ -216,8 +209,8 @@
value: "{{ gw_active }}" value: "{{ gw_active }}"
- option: internet_available - option: internet_available
value: "{{ internet_available }}" value: "{{ internet_available }}"
- option: is_rpi - option: rpi_model
value: "{{ is_rpi }}" value: "{{ rpi_model }}"
- option: first_run - option: first_run
value: "{{ first_run }}" value: "{{ first_run }}"
- option: local_tz - option: local_tz

View file

@ -37,7 +37,7 @@
path: /etc/dphys-swapfile path: /etc/dphys-swapfile
regexp: "^CONF_SWAPSIZE" regexp: "^CONF_SWAPSIZE"
line: "CONF_SWAPSIZE={{ pi_swap_file_size }}" 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) - name: Restart swap service "dphys-swapfile" (debuntu)
#command: /etc/init.d/dphys-swapfile restart #command: /etc/init.d/dphys-swapfile restart

View file

@ -56,6 +56,12 @@ else
XO_VERSION="none" XO_VERSION="none"
fi 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 " ") ANSIBLE_VERSION=$(ansible --version|head -n 1|cut -f 2 -d " ")
if [ ! x$DHCPCD_PATH = x ]; then if [ ! x$DHCPCD_PATH = x ]; then
@ -77,6 +83,7 @@ cat <<EOF
"iiab_branch" : "$BRANCH", "iiab_branch" : "$BRANCH",
"iiab_commit" : "$COMMIT", "iiab_commit" : "$COMMIT",
"xo_model" : "$XO_VERSION", "xo_model" : "$XO_VERSION",
"rpi_model" : "$RPI_VERSION",
"ansible_version" : "$ANSIBLE_VERSION", "ansible_version" : "$ANSIBLE_VERSION",
"os" : "$OS", "os" : "$OS",
"os_ver" : "$OS_VER"} "os_ver" : "$OS_VER"}