mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Update main.yml
This commit is contained in:
parent
854d7a028d
commit
c6b313a499
1 changed files with 34 additions and 26 deletions
|
@ -1,7 +1,8 @@
|
|||
# Initialize
|
||||
|
||||
- name: ...IS BEGINNING ============================================
|
||||
stat: path=/etc/iiab/iiab.env
|
||||
stat:
|
||||
path: /etc/iiab/iiab.env
|
||||
register: NewInstall
|
||||
|
||||
- name: Setting first run flag
|
||||
|
@ -18,13 +19,14 @@
|
|||
#- name: Loading computed_vars
|
||||
# include_tasks: roles/0-init/tasks/computed_vars.yml
|
||||
- name: Re-read local_facts.facts from /etc/ansible/facts.d
|
||||
setup: filter=ansible_local
|
||||
setup:
|
||||
filter: ansible_local
|
||||
|
||||
- name: Set top level variables from local facts for convenience
|
||||
set_fact:
|
||||
xo_model: '{{ ansible_local.local_facts.xo_model }}'
|
||||
phplib_dir: '{{ ansible_local.local_facts.phplib_dir }}'
|
||||
iiab_stage: '{{ ansible_local.local_facts.stage }}'
|
||||
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 a RPi
|
||||
set_fact:
|
||||
|
@ -57,7 +59,10 @@
|
|||
when: discovered_wan_iface != "none" and gw_active_test.stdout == "1"
|
||||
|
||||
- name: Test for internet access
|
||||
get_url: url="{{ iiab_download_url }}/heart-beat.txt" dest=/tmp/heart-beat.txt
|
||||
get_url:
|
||||
url: "{{ iiab_download_url }}/heart-beat.txt"
|
||||
dest: /tmp/heart-beat.txt
|
||||
timeout: "{{ download_timeout }}"
|
||||
ignore_errors: True
|
||||
# async: 10
|
||||
# poll: 2
|
||||
|
@ -69,8 +74,9 @@
|
|||
when: not internet_access_test|failed and not disregard_network
|
||||
|
||||
- name: Cleanup internet test file
|
||||
file: path=/tmp/heart-beat.txt
|
||||
state=absent
|
||||
file:
|
||||
path: /tmp/heart-beat.txt
|
||||
state: absent
|
||||
|
||||
# Put all computed vars here so derive properly from any prior var file
|
||||
- name: If the TZ is not set in env, set it to UTC
|
||||
|
@ -155,10 +161,11 @@
|
|||
when: iiab_fqdn != ansible_fqdn
|
||||
|
||||
- name: Add version section
|
||||
ini_file: dest='{{ iiab_config_file }}'
|
||||
section=runtime
|
||||
option='{{ item.option }}'
|
||||
value='{{ item.value }}'
|
||||
ini_file:
|
||||
dest: "{{ iiab_config_file }}"
|
||||
section: runtime
|
||||
option: "{{ item.option }}"
|
||||
value: "{{ item.value }}"
|
||||
with_items:
|
||||
- option: 'iiab_stage'
|
||||
value: '{{ iiab_stage }}'
|
||||
|
@ -202,10 +209,11 @@
|
|||
when: FQDN_changed
|
||||
|
||||
- name: STAGE 0 HAS COMPLETED ======================================
|
||||
ini_file: dest='{{ iiab_config_file }}'
|
||||
section=runtime
|
||||
option='{{ item.option }}'
|
||||
value='{{ item.value }}'
|
||||
ini_file:
|
||||
dest: "{{ iiab_config_file }}"
|
||||
section: runtime
|
||||
option: "{{ item.option }}"
|
||||
value: "{{ item.value }}"
|
||||
with_items:
|
||||
- option: 'is_VM'
|
||||
value: 'yes'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue