From 21ff35c29499cfb24beea2b5e84fa7767d5cf300 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Thu, 5 Mar 2020 05:22:36 -0600 Subject: [PATCH] keep is_rpi in ini, add first_run recording --- roles/0-init/tasks/iiab_ini.yml | 2 ++ roles/0-init/tasks/main.yml | 16 ++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/roles/0-init/tasks/iiab_ini.yml b/roles/0-init/tasks/iiab_ini.yml index 2ef441aa5..9230c603c 100644 --- a/roles/0-init/tasks/iiab_ini.yml +++ b/roles/0-init/tasks/iiab_ini.yml @@ -37,3 +37,5 @@ value: "{{ ansible_date_time.iso8601 }}" - option: install_xo value: "{{ xo_model }}" + - option: is_rpi + value: "{{ rpi_model }}" diff --git a/roles/0-init/tasks/main.yml b/roles/0-init/tasks/main.yml index 4b933f5fd..427377084 100644 --- a/roles/0-init/tasks/main.yml +++ b/roles/0-init/tasks/main.yml @@ -9,6 +9,13 @@ first_run: True when: not NewInstall.stat.exists +- 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 }}" + # We need to inialize the ini file and only write the location and version # sections once and only once to preserve the install date and git hash. - name: Create IIAB tools and {{ iiab_ini_file }}, if first_run @@ -55,13 +62,6 @@ # fail_msg: "PLEASE CONFIRM 'apache_install: True' AND 'apache_enable: True' IF 'nginx_enabled: False' e.g. IN: /etc/iiab/local_vars.yml" # quiet: yes -- 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: Set exFAT_enabled if xo_model != "none" set_fact: exFAT_enabled: True @@ -209,7 +209,7 @@ value: "{{ gw_active }}" - option: internet_available value: "{{ internet_available }}" - - option: rpi_model + - option: is_rpi value: "{{ rpi_model }}" - option: first_run value: "{{ first_run }}"