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

0-init/defaults/main.yml: reconcile stale vars

This commit is contained in:
root 2021-07-30 15:37:04 -04:00
parent e33d2ad632
commit 82a636ced5
6 changed files with 51 additions and 33 deletions

View file

@ -5,29 +5,41 @@
# These entries should never be changed in this file. # These entries should never be changed in this file.
# These are defaults for boolean routines. # These are defaults for boolean routines.
# 2021-07-30: This variable (first_run) is still used in 2 places:
# (1) roles/1-prep/tasks/main.yml for raspberry_pi.yml
# (2) roles/network/tasks/named.yml
# ...after it is set in 0-init/tasks/main.yml
first_run: False first_run: False
rpi_model: none rpi_model: none # 2021-07-30: Broadly used!
xo_model: none #xo_model: none # 2021-07-30: No longer used
# 2021-07-30: Recorded to /etc/iiab/iiab.ini but not used programmatically:
gw_active: False gw_active: False
# 2021-07-30: Used broadly, but not in an organized way -- most all IIAB
# outfitting/provisioning happens online -- in situations where connectivity
# failures should be reported to the operator, rather than papered over:
internet_available: False internet_available: False
discovered_wan_iface: none discovered_wan_iface: none # 2021-07-30: Very broadly used!
# Old defs # 2021-07-30: Primarily for Admin Console: later change to 443 for #2811 HTTPS?
gui_port: 80 gui_port: 80
is_F18: False #is_F18: False # 2021-07-30: No longer used
# Set default 1-prep discovered hardware # 2021-07-30: Barely used -- for {named, dhcpd, squid} in
rtc_id: none # roles/network/tasks/main.yml -- after being set in 0-init/tasks/network.yml
NUC6_firmware_needed: False FQDN_changed: False
# Used in 2-common/tasks/xo.yml #rtc_id: none # 2021-07-30: Moved to 1-prep/defaults/main.yml
wifi_id: none #NUC6_firmware_needed: False # 2021-07-30: Apparently never used
#wifi_id: none # 2021-07-30: Had been used in 2-common/tasks/xo.yml
# 2021-07-30: roles/network/tasks/squid.yml#L16 to stop Squid # 2021-07-30: roles/network/tasks/squid.yml#L16 to stop Squid
# ("when: not installing") is the only non-Fedora use of this var. # ("when: not installing") is the only non-Fedora use of this var.
# Earlier, this var HAD also been used in 2-common and 3-base-server. # Earlier, this var HAD also been used in 2-common and 3-base-server.
installing: False installing: False
# Network # 2021-07-30: Broadly used across roles/network/tasks/*.yml -- but things might
# possibly change if roles/network becomes optional per #2876 ?
no_net_restart: False no_net_restart: False
no_NM_reload: False #no_NM_reload: False # 2021-07-30: Was used in roles/network/tasks/fedora/*

View file

@ -35,7 +35,7 @@
value: "{{ ansible_local.local_facts.iiab_commit }}" value: "{{ ansible_local.local_facts.iiab_commit }}"
- option: install_date - option: install_date
value: "{{ ansible_date_time.iso8601 }}" value: "{{ ansible_date_time.iso8601 }}"
- option: xo_model #- option: xo_model
value: "{{ xo_model }}" # value: "{{ xo_model }}"
- option: rpi_model - option: rpi_model
value: "{{ rpi_model }}" value: "{{ rpi_model }}"

View file

@ -7,10 +7,10 @@
# Higher-level purpose explained at the bottom of: # Higher-level purpose explained at the bottom of:
# https://github.com/iiab/iiab/blob/master/vars/default_vars.yml # https://github.com/iiab/iiab/blob/master/vars/default_vars.yml
- name: "Ansible just ran /etc/ansible/facts.d/local_facts.fact to set 11 vars -- here we extract 3 of those -- rpi_model: {{ ansible_local.local_facts.rpi_model }}, xo_model: {{ ansible_local.local_facts.xo_model }}, iiab_stage: {{ ansible_local.local_facts.stage }}" - name: "Ansible just ran /etc/ansible/facts.d/local_facts.fact to set 10 vars -- here we extract 2 of those -- rpi_model: {{ ansible_local.local_facts.rpi_model }}, iiab_stage: {{ ansible_local.local_facts.stage }}"
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 }}"
iiab_stage: "{{ ansible_local.local_facts.stage }}" iiab_stage: "{{ ansible_local.local_facts.stage }}"
# Initialize /etc/iiab/iiab.ini writing the 'location' and 'version' sections # Initialize /etc/iiab/iiab.ini writing the 'location' and 'version' sections
@ -99,10 +99,10 @@
value: "{{ local_tz }}" value: "{{ local_tz }}"
- option: etc_localtime.stdout # e.g. 'America/New_York' direct from symlink /etc/localtime -- or '' if /etc/localtime doesn't exist - option: etc_localtime.stdout # e.g. 'America/New_York' direct from symlink /etc/localtime -- or '' if /etc/localtime doesn't exist
value: "{{ etc_localtime.stdout }}" value: "{{ etc_localtime.stdout }}"
- option: no_NM_reload #- option: no_NM_reload
value: "{{ no_NM_reload }}" # value: "{{ no_NM_reload }}"
- option: is_F18 #- option: is_F18
value: "{{ is_F18 }}" # value: "{{ is_F18 }}"
- option: FQDN_changed - option: FQDN_changed
value: "{{ FQDN_changed }}" value: "{{ FQDN_changed }}"

View file

@ -0,0 +1,2 @@
rtc_id: none # 2021-07-30: Used in 1-prep/tasks/raspberry_pi.yml
#NUC6_firmware_needed: False # 2021-07-30: Apparently never used

View file

@ -1,15 +1,18 @@
# just lie about active gateway present on XOs to suppress ifcfg-WAN # just lie about active gateway present on XOs to suppress ifcfg-WAN
# auto-creation/moving with XOs using NM/system-connections/ via keyfile. # auto-creation/moving with XOs using NM/system-connections/ via keyfile.
# ifcfg-rh acts on /etc/sys*/net*/ifcfg-* where we search for devices. # ifcfg-rh acts on /etc/sys*/net*/ifcfg-* where we search for devices.
- name: Setting XO has WiFi gateway
set_fact:
user_wan_iface: "{{ discovered_wan_iface }}"
when: not (discovered_wan_iface == "none") and not (xo_model == "none") and has_ifcfg_gw == "none"
- name: XO laptop wants USB WiFi interface as AP mode # 2021-07-30: Var 'xo_model' is being deprecated
set_fact: #- name: Setting XO has WiFi gateway
iiab_wireless_lan_iface: "{{ discovered_lan_iface }}" # set_fact:
when: num_wifi_interfaces >= "2" and not (xo_model == "none") and not (discovered_wan_iface == "none") and discovered_wireless_iface == "eth0" # user_wan_iface: "{{ discovered_wan_iface }}"
# when: not (discovered_wan_iface == "none") and not (xo_model == "none") and has_ifcfg_gw == "none"
# 2021-07-30: Var 'xo_model' is being deprecated
#- name: XO laptop wants USB WiFi interface as AP mode
# set_fact:
# iiab_wireless_lan_iface: "{{ discovered_lan_iface }}"
# when: num_wifi_interfaces >= "2" and not (xo_model == "none") and not (discovered_wan_iface == "none") and discovered_wireless_iface == "eth0"
# static backout suppy new template file # static backout suppy new template file
- name: gui-static-wan - name: gui-static-wan

View file

@ -3,7 +3,7 @@
# Higher-level purpose explained at the bottom of: # Higher-level purpose explained at the bottom of:
# https://github.com/iiab/iiab/blob/master/vars/default_vars.yml # https://github.com/iiab/iiab/blob/master/vars/default_vars.yml
# 2020-10-27: Most of the 11 variables require a command[*] to be run to # 2020-10-27: Most of the 10 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
@ -14,7 +14,7 @@ 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"
XO_MODEL="none" #XO_MODEL="none"
RPI_MODEL="none" RPI_MODEL="none"
ANSIBLE_VERSION="none" ANSIBLE_VERSION="none"
DHCPCD="none" # The last 3 conditioned on string output not RC. SEE BELOW. DHCPCD="none" # The last 3 conditioned on string output not RC. SEE BELOW.
@ -87,8 +87,8 @@ 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
tmp=$(cat /proc/device-tree/mfg-data/MN) && #tmp=$(cat /proc/device-tree/mfg-data/MN) &&
XO_MODEL=$tmp # XO_MODEL=$tmp
tmp=$(cat /proc/device-tree/model) && tmp=$(cat /proc/device-tree/model) &&
RPI_MODEL=$tmp RPI_MODEL=$tmp
@ -128,9 +128,10 @@ cat <<EOF
"systemd_networkd" : "$SYSTEMD_NETWORKD", "systemd_networkd" : "$SYSTEMD_NETWORKD",
"iiab_branch" : "$IIAB_BRANCH", "iiab_branch" : "$IIAB_BRANCH",
"iiab_commit" : "$IIAB_COMMIT", "iiab_commit" : "$IIAB_COMMIT",
"xo_model" : "$XO_MODEL",
"rpi_model" : "$RPI_MODEL", "rpi_model" : "$RPI_MODEL",
"ansible_version" : "$ANSIBLE_VERSION", "ansible_version" : "$ANSIBLE_VERSION",
"os" : "$OS", "os" : "$OS",
"os_ver" : "$OS_VER"} "os_ver" : "$OS_VER"}
EOF EOF
#"xo_model" : "$XO_MODEL",