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

first_run framework

just remove it
This commit is contained in:
Jerry Vonau 2017-09-19 02:46:37 -05:00
parent e57ff51ca8
commit 6e4540fa08
5 changed files with 26 additions and 21 deletions

View file

@ -1,9 +1,10 @@
# use these as a tag a release at a point in time # use these as a tag a release at a point in time
iiab_base_ver: 0 iiab_base_ver: 6.4
gui_version: 2 gui_version: 2
# 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,
first_run: False
installing: False installing: False
NUC6_firmware_needed: False NUC6_firmware_needed: False
exFAT_enabled: False exFAT_enabled: False

View file

@ -1,24 +1,26 @@
- name: Checking iiab_domain_name - name: Checking iiab_domain_name
shell: "cat /etc/sysconfig/iiab_domain_name" shell: "cat /etc/sysconfig/iiab_domain_name"
register: prior_domain register: prior_domain
ignore_errors: True when: not first_run
# above always registers # above always registers
- name: Checking for prior domain name - name: Checking for prior domain name
set_fact: set_fact:
iiab_domain: "{{ prior_domain.stdout }}" iiab_domain: "{{ prior_domain.stdout }}"
when: prior_domain.stdout != "lan" and prior_domain.stdout != "" when: not first_run and prior_domain.stdout != "lan" and prior_domain.stdout != ""
- name: iiab_wan_device - name: iiab_wan_device
shell: "cat /etc/sysconfig/iiab_wan_device" shell: "cat /etc/sysconfig/iiab_wan_device"
register: prior_gw register: prior_gw
ignore_errors: True when: not first_run
- name: Checking for old device gateway interface for device test - name: Checking for old device gateway interface for device test
set_fact: set_fact:
device_gw: "{{ prior_gw.stdout }}" device_gw: "{{ prior_gw.stdout }}"
device_gw2: "{{ prior_gw.stdout }}" device_gw2: "{{ prior_gw.stdout }}"
when: prior_gw is defined and prior_gw.stdout != "" when: not first_run and prior_gw is defined and prior_gw.stdout != ""
#pause checking
# Discover do we have a gateway? -- if ansible detects gateway, becomes WAN candidate # Discover do we have a gateway? -- if ansible detects gateway, becomes WAN candidate
- name: Finding gateway - name: Finding gateway

View file

@ -1,8 +1,3 @@
# temp
- name: temp placekeeper
set_fact:
first_run: False
- name: Checking for ifcfg-WAN file - Can Fail - name: Checking for ifcfg-WAN file - Can Fail
stat: path=/etc/sysconfig/network-scripts/ifcfg-WAN stat: path=/etc/sysconfig/network-scripts/ifcfg-WAN
register: has_ifcfg_WAN register: has_ifcfg_WAN

View file

@ -30,7 +30,5 @@
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: 'Universal Unique ID (uuid)'
value: '{{ uuid }}'
- option: 'install_xo' - option: 'install_xo'
value: '{{ xo_model }}' value: '{{ xo_model }}'

View file

@ -1,3 +1,16 @@
- name: Determine if runansible was run
stat: path=/etc/iiab/config_vars.yml
register: NewInstall
- name: Setting first run flag
set_fact:
first_run: True
when: NewInstall.stat.exists is defined and not NewInstall.stat.exists
# we need to inialize the ini file
- include: iiab_ini.yml
when: first_run
- name: Set flag for fedora 18 - name: Set flag for fedora 18
set_fact: set_fact:
is_F18: True is_F18: True
@ -50,13 +63,13 @@
- name: Disable apparmor -- on by default in ubuntu - name: Disable apparmor -- on by default in ubuntu
service: name=apparmor enabled=False state=stopped service: name=apparmor enabled=False state=stopped
when: is_ubuntu when: first_run and is_ubuntu
ignore_errors: true ignore_errors: true
- name: Disable selinux on next boot - name: Disable selinux on next boot
selinux: state=disabled selinux: state=disabled
register: selinux_disabled register: selinux_disabled
when: ansible_selinux is defined and ansible_version >= '2' and ansible_selinux or ansible_selinux['status'] is defined and ansible_version < '2' and ansible_selinux['status'] != 'disabled' when: first_run
- name: Disable selinux for this session (if needed) - name: Disable selinux for this session (if needed)
command: setenforce Permissive command: setenforce Permissive
@ -72,26 +85,22 @@
- include: prep.yml - include: prep.yml
# we need to inialize the ini file
- include: iiab_ini.yml
- include: computed_vars.yml - include: computed_vars.yml
- include: detected_network.yml - include: detected_network.yml
when: not installing when: not installing
# Put conditional actions for hardware platforms here # Put conditional actions for hardware platforms here
- include: raspberry_pi_2.yml - include: raspberry_pi_2.yml
when: rpi_model != "none" when: first_run and rpi_model != "none"
- name: Check if the identifier for intel's NUC6 builtin wifi is present - name: Check if the identifier for intel's NUC6 builtin wifi is present
shell: "lsusb | grep 8087:0a2b | wc |awk '{print $1}'" shell: "lsusb | grep 8087:0a2b | wc |awk '{print $1}'"
register: usb_NUC6 register: usb_NUC6
ignore_errors: true ignore_errors: true
when: first_run
- name: download the firmware for built in wifi on NUC6 - name: download the firmware for built in wifi on NUC6
get_url: dest=/lib/firmware get_url: dest=/lib/firmware
url={{ iiab_download_url }}/iwlwifi-8000C-13.ucode url={{ iiab_download_url }}/iwlwifi-8000C-13.ucode
when: usb_NUC6.stdout|int > 0 when: first_run and usb_NUC6.stdout|int > 0