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
|
# Initialize
|
||||||
|
|
||||||
- name: ...IS BEGINNING ============================================
|
- name: ...IS BEGINNING ============================================
|
||||||
stat: path=/etc/iiab/iiab.env
|
stat:
|
||||||
|
path: /etc/iiab/iiab.env
|
||||||
register: NewInstall
|
register: NewInstall
|
||||||
|
|
||||||
- name: Setting first run flag
|
- name: Setting first run flag
|
||||||
|
@ -18,13 +19,14 @@
|
||||||
#- name: Loading computed_vars
|
#- name: Loading computed_vars
|
||||||
# include_tasks: roles/0-init/tasks/computed_vars.yml
|
# include_tasks: roles/0-init/tasks/computed_vars.yml
|
||||||
- name: Re-read local_facts.facts from /etc/ansible/facts.d
|
- 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
|
- name: Set top level variables from local facts for convenience
|
||||||
set_fact:
|
set_fact:
|
||||||
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 a RPi
|
- name: Discover if this is running Raspbian -- if so assume it is a RPi
|
||||||
set_fact:
|
set_fact:
|
||||||
|
@ -57,7 +59,10 @@
|
||||||
when: discovered_wan_iface != "none" and gw_active_test.stdout == "1"
|
when: discovered_wan_iface != "none" and gw_active_test.stdout == "1"
|
||||||
|
|
||||||
- name: Test for internet access
|
- 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
|
ignore_errors: True
|
||||||
# async: 10
|
# async: 10
|
||||||
# poll: 2
|
# poll: 2
|
||||||
|
@ -69,8 +74,9 @@
|
||||||
when: not internet_access_test|failed and not disregard_network
|
when: not internet_access_test|failed and not disregard_network
|
||||||
|
|
||||||
- name: Cleanup internet test file
|
- name: Cleanup internet test file
|
||||||
file: path=/tmp/heart-beat.txt
|
file:
|
||||||
state=absent
|
path: /tmp/heart-beat.txt
|
||||||
|
state: absent
|
||||||
|
|
||||||
# Put all computed vars here so derive properly from any prior var file
|
# 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
|
- name: If the TZ is not set in env, set it to UTC
|
||||||
|
@ -155,10 +161,11 @@
|
||||||
when: iiab_fqdn != ansible_fqdn
|
when: iiab_fqdn != ansible_fqdn
|
||||||
|
|
||||||
- name: Add version section
|
- name: Add version section
|
||||||
ini_file: dest='{{ iiab_config_file }}'
|
ini_file:
|
||||||
section=runtime
|
dest: "{{ iiab_config_file }}"
|
||||||
option='{{ item.option }}'
|
section: runtime
|
||||||
value='{{ item.value }}'
|
option: "{{ item.option }}"
|
||||||
|
value: "{{ item.value }}"
|
||||||
with_items:
|
with_items:
|
||||||
- option: 'iiab_stage'
|
- option: 'iiab_stage'
|
||||||
value: '{{ iiab_stage }}'
|
value: '{{ iiab_stage }}'
|
||||||
|
@ -202,10 +209,11 @@
|
||||||
when: FQDN_changed
|
when: FQDN_changed
|
||||||
|
|
||||||
- name: STAGE 0 HAS COMPLETED ======================================
|
- name: STAGE 0 HAS COMPLETED ======================================
|
||||||
ini_file: dest='{{ iiab_config_file }}'
|
ini_file:
|
||||||
section=runtime
|
dest: "{{ iiab_config_file }}"
|
||||||
option='{{ item.option }}'
|
section: runtime
|
||||||
value='{{ item.value }}'
|
option: "{{ item.option }}"
|
||||||
|
value: "{{ item.value }}"
|
||||||
with_items:
|
with_items:
|
||||||
- option: 'is_VM'
|
- option: 'is_VM'
|
||||||
value: 'yes'
|
value: 'yes'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue