From 51689263bcb382b12c95b568369dda0e49f25fc5 Mon Sep 17 00:00:00 2001 From: Arky Date: Wed, 25 Oct 2017 21:52:08 +0700 Subject: [PATCH 01/16] Add PR template and Bug template Adding PR template and Bug template under .github directory. These files will be picked up the github.com interface. Fixes #390 #391 --- .github/ISSUE_TEMPLATE.md | 5 +++++ .github/PULL_REQUEST_TEMPLATE.md | 7 +++++++ 2 files changed, 12 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 000000000..c62e3adb4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,5 @@ +### Expected behavior and actual behavior. + +### Steps to reproduce the problem. + +### Specifications like the version of the IIAB, operating system version, or hardware details. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..228e3f0aa --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,7 @@ +# Fixes Bug + +# Description of changes proposed in this pull request. + +# Smoke-tested in operating system. + +# Mention a team member for further information or comment using @ name From b5326941d04deb19b729c343c9ceb55dd6562cf3 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 25 Oct 2017 12:36:32 -0400 Subject: [PATCH 02/16] kiwix 2017-10-11-> 2017-10-25 --- roles/kiwix/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/kiwix/tasks/main.yml b/roles/kiwix/tasks/main.yml index 92ea14d6d..7b8c5f262 100644 --- a/roles/kiwix/tasks/main.yml +++ b/roles/kiwix/tasks/main.yml @@ -6,13 +6,13 @@ - name: Set kiwix source file name x86_64 set_fact: - kiwix_src_file: "kiwix-tools_linux64_2017-10-11.tar.gz" + kiwix_src_file: "kiwix-tools_linux64_2017-10-25.tar.gz" kiwix_src_bin_only: True when: ansible_machine == "x86_64" - name: Set kiwix source file name armv7l set_fact: - kiwix_src_file: "kiwix-tools_armhf_2017-10-11.tar.gz" + kiwix_src_file: "kiwix-tools_armhf_2017-10-25.tar.gz" kiwix_src_bin_only: True when: ansible_machine == "armv7l" or ansible_machine == "armv6l" From 0790119af178958e175468730bec957b234c21c5 Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 26 Oct 2017 10:26:12 -0400 Subject: [PATCH 03/16] Reno says ### better than # (smaller title w/ markdown viewer) --- .github/PULL_REQUEST_TEMPLATE.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 228e3f0aa..61851e1dd 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,7 +1,7 @@ -# Fixes Bug +### Fixes Bug -# Description of changes proposed in this pull request. +### Description of changes proposed in this pull request. -# Smoke-tested in operating system. +### Smoke-tested in operating system. -# Mention a team member for further information or comment using @ name +### Mention a team member for further information or comment using @ name From 9f45d12972d8cd3d301b9ebab0b0cf33c5c944e6 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Wed, 13 Sep 2017 08:37:52 -0500 Subject: [PATCH 04/16] replacement for a7a5f36... use netvars --- iiab-network.yml | 2 +- roles/netvars/defaults/main.yml | 1 + roles/netvars/tasks/main.yml | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) create mode 120000 roles/netvars/defaults/main.yml create mode 100644 roles/netvars/tasks/main.yml diff --git a/iiab-network.yml b/iiab-network.yml index 40cd8f589..e717e7fa5 100644 --- a/iiab-network.yml +++ b/iiab-network.yml @@ -9,5 +9,5 @@ - /etc/iiab/config_vars.yml roles: - - { role: 1-prep, tags: ['prep','platform','base'] } + - { role: netvars, tags: ['network'] } - { role: network, tags: ['network','base'] } diff --git a/roles/netvars/defaults/main.yml b/roles/netvars/defaults/main.yml new file mode 120000 index 000000000..b8fa87d4b --- /dev/null +++ b/roles/netvars/defaults/main.yml @@ -0,0 +1 @@ +/opt/iiab/iiab/roles/1-prep/defaults/main.yml \ No newline at end of file diff --git a/roles/netvars/tasks/main.yml b/roles/netvars/tasks/main.yml new file mode 100644 index 000000000..63e84b40a --- /dev/null +++ b/roles/netvars/tasks/main.yml @@ -0,0 +1,2 @@ +- include: roles/1-prep/tasks/computed_vars.yml +- include: roles/1-prep/tasks/detected_network.yml From dfab9635bca72bd4b75746ffe2454028192eaadd Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Tue, 19 Sep 2017 21:56:37 -0500 Subject: [PATCH 05/16] add the not installing option to netvars --- iiab-base.yml | 1 + iiab.yml | 1 + roles/netvars/tasks/main.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/iiab-base.yml b/iiab-base.yml index 4c42c01e7..23f440d66 100644 --- a/iiab-base.yml +++ b/iiab-base.yml @@ -8,5 +8,6 @@ - vars/local_vars.yml roles: + - { role: netvars, tags: ['netvars'] } - { role: 1-prep, tags: ['prep','platform','base'] } - { role: openvpn, tags: ['openvpn'] } diff --git a/iiab.yml b/iiab.yml index f4cafc001..5fc0e8e85 100644 --- a/iiab.yml +++ b/iiab.yml @@ -9,6 +9,7 @@ - /etc/iiab/config_vars.yml roles: + - { role: netvars, tags: ['netvars'] } - { role: 1-prep, tags: ['prep','platform','base'] } - { role: 2-common, tags: ['common','base'] } - { role: 3-base-server, tags: ['base'] } diff --git a/roles/netvars/tasks/main.yml b/roles/netvars/tasks/main.yml index 63e84b40a..ab59b7a9e 100644 --- a/roles/netvars/tasks/main.yml +++ b/roles/netvars/tasks/main.yml @@ -1,2 +1,3 @@ - include: roles/1-prep/tasks/computed_vars.yml - include: roles/1-prep/tasks/detected_network.yml + when: not installing From 2fc670a885cb4b0419368674591b1a16f70c3272 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Tue, 19 Sep 2017 21:18:07 -0500 Subject: [PATCH 06/16] avoid 1-prep post install --- iiab-from-console.yml | 2 +- roles/netvars/tasks/main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iiab-from-console.yml b/iiab-from-console.yml index fb47ca868..98641a303 100644 --- a/iiab-from-console.yml +++ b/iiab-from-console.yml @@ -9,7 +9,7 @@ - /etc/iiab/config_vars.yml roles: - - { role: 1-prep, tags: ['prep','platform','base'] } + - { role: netvars, tags: ['netvars'] } - { role: 4-server-options, tags: ['options'] } - { role: 5-xo-services, tags: ['xo-services'] } - { role: 6-generic-apps, tags: ['generic-apps'] } diff --git a/roles/netvars/tasks/main.yml b/roles/netvars/tasks/main.yml index ab59b7a9e..407fa54a8 100644 --- a/roles/netvars/tasks/main.yml +++ b/roles/netvars/tasks/main.yml @@ -1,3 +1,3 @@ -- include: roles/1-prep/tasks/computed_vars.yml +- include: roles/1-prep/tasks/computed_vars.yml - include: roles/1-prep/tasks/detected_network.yml when: not installing From 8c91f4075cb36abeb80aec6e4b849156e67e59ad Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Tue, 19 Sep 2017 23:22:03 -0500 Subject: [PATCH 07/16] runtags needs tags= adjustment --- runtags | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtags b/runtags index 933d07a67..ad8bde5e3 100755 --- a/runtags +++ b/runtags @@ -36,7 +36,7 @@ found="N" for tag in $tags do - if [ "$tag" == "prep" ] + if [ "$tag" == "netvars" ] then found="Y" fi @@ -48,7 +48,7 @@ taglist=$1 if [ "$found" == "N" ] then - taglist="prep,"$taglist + taglist="netvars,"$taglist fi export ANSIBLE_LOG_PATH="$XSCE_DIR/iiab-debug.log" From b61b009f08e077ac2ec3aa5595528a48e84dcb99 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Fri, 22 Sep 2017 06:02:42 -0400 Subject: [PATCH 08/16] move NewInstall --- roles/1-prep/tasks/main.yml | 13 ------------- roles/netvars/tasks/main.yml | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/roles/1-prep/tasks/main.yml b/roles/1-prep/tasks/main.yml index dc9672c67..a6ae88990 100644 --- a/roles/1-prep/tasks/main.yml +++ b/roles/1-prep/tasks/main.yml @@ -1,16 +1,3 @@ -- name: Determine if runansible was run - stat: path=/etc/iiab/iiab.env - 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 set_fact: is_F18: True diff --git a/roles/netvars/tasks/main.yml b/roles/netvars/tasks/main.yml index 407fa54a8..68b4c2b66 100644 --- a/roles/netvars/tasks/main.yml +++ b/roles/netvars/tasks/main.yml @@ -1,3 +1,17 @@ +- name: Determine if runansible was run + stat: path=/etc/iiab/iiab.env + register: NewInstall + +- name: Setting first run flag + set_fact: + first_run: True + when: not NewInstall.stat.exists +# when: NewInstall.stat.exists is defined and not NewInstall.stat.exists + +# we need to inialize the ini file +- include: roles/1-prep/tasks/iiab_ini.yml + when: first_run + - include: roles/1-prep/tasks/computed_vars.yml - include: roles/1-prep/tasks/detected_network.yml when: not installing From 337658062e9818d08338f23f70e416121b7f2430 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Fri, 22 Sep 2017 06:23:13 -0400 Subject: [PATCH 09/16] prep.yml cleanup - adjusted for iiab.env --- roles/1-prep/tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/1-prep/tasks/main.yml b/roles/1-prep/tasks/main.yml index a6ae88990..4dba2e733 100644 --- a/roles/1-prep/tasks/main.yml +++ b/roles/1-prep/tasks/main.yml @@ -71,6 +71,7 @@ ignore_errors: true - include: prep.yml + when: first_run - include: computed_vars.yml From c9332b53e11a0b432cc988e2fa00215c4c6f84de Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Fri, 22 Sep 2017 12:46:25 -0400 Subject: [PATCH 10/16] 2-common disable dup'd routine --- roles/2-common/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/2-common/tasks/main.yml b/roles/2-common/tasks/main.yml index 33a5388da..fe42574dc 100644 --- a/roles/2-common/tasks/main.yml +++ b/roles/2-common/tasks/main.yml @@ -1,5 +1,5 @@ -- include: iiab_ini.yml +#- include: iiab_ini.yml # create the directory structure for XSCE - include: fl.yml From ae5434bd3d4735a1d4d8c54e52c47c0a215be7ab Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Sat, 23 Sep 2017 02:04:55 -0400 Subject: [PATCH 11/16] move internet detection to be global - adjused iiab.env 2 --- roles/1-prep/tasks/computed_vars.yml | 36 +++++++++++++++++++++++ roles/1-prep/tasks/detected_network.yml | 38 ------------------------- roles/1-prep/tasks/main.yml | 5 ---- 3 files changed, 36 insertions(+), 43 deletions(-) diff --git a/roles/1-prep/tasks/computed_vars.yml b/roles/1-prep/tasks/computed_vars.yml index e775e9fc3..964f0b723 100644 --- a/roles/1-prep/tasks/computed_vars.yml +++ b/roles/1-prep/tasks/computed_vars.yml @@ -14,6 +14,38 @@ exFAT_enabled: True when: xo_model != "none" +# Discover do we have a gateway? -- if ansible detects gateway, becomes WAN candidate +- name: Finding gateway + set_fact: + discovered_wan_iface: "{{ ansible_default_ipv4.alias }}" + when: 'ansible_default_ipv4.gateway is defined' + +- name: Verify gateway present + shell: ping -c4 "{{ ansible_default_ipv4.gateway }}" &> /dev/null ; echo $? + when: discovered_wan_iface != "none" + register: gw_active_test + +- name: Recording gateway response + set_fact: + gw_active: True + when: discovered_wan_iface != "none" and gw_active_test.stdout == "0" + +- name: Test for internet access + get_url: url="{{ iiab_download_url }}/heart-beat.txt" dest=/tmp/heart-beat.txt + ignore_errors: True +# async: 10 +# poll: 2 + register: internet_access_test + +- name: Set internet_available true if wget succeeded + set_fact: + internet_available: True + when: not internet_access_test|failed and not disregard_network + +- name: Cleanup internet test file + file: path=/tmp/heart-beat.txt + state=absent + - name: add version section ini_file: dest='{{ iiab_config_file }}' section=runtime @@ -36,6 +68,10 @@ value: '{{ ansible_swaptotal_mb }}' - option: 'product_id' value: '{{ ansible_product_uuid }}' + - option: 'gw_active' + value: '{{ gw_active }}' + - option: 'internet_available' + value: '{{ internet_available }}' # 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 diff --git a/roles/1-prep/tasks/detected_network.yml b/roles/1-prep/tasks/detected_network.yml index 502f3dc1c..800becccf 100644 --- a/roles/1-prep/tasks/detected_network.yml +++ b/roles/1-prep/tasks/detected_network.yml @@ -20,40 +20,6 @@ device_gw2: "{{ 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 -- name: Finding gateway - set_fact: - discovered_wan_iface: "{{ ansible_default_ipv4.alias }}" - when: 'ansible_default_ipv4.gateway is defined' - -- name: Verify gateway present - shell: ping -c2 "{{ ansible_default_ipv4.gateway }}" &> /dev/null ; echo $? - register: gw_active_test - when: discovered_wan_iface != "none" - -- name: Recording gateway response - set_fact: - gw_active: True - when: discovered_wan_iface != "none" and gw_active_test.stdout == "0" - -- name: Test for internet access - get_url: url="{{ iiab_download_url }}/heart-beat.txt" dest=/tmp/heart-beat.txt - ignore_errors: True -# async: 10 -# poll: 2 - register: internet_access_test - -- name: Set internet_available true if wget succeeded - set_fact: - internet_available: True - when: not internet_access_test|failed and not disregard_network - -- name: Cleanup internet test file - file: path=/tmp/heart-beat.txt - state=absent - - name: Setting wan if detected set_fact: iiab_wan_iface: "{{ discovered_wan_iface }}" @@ -197,10 +163,6 @@ option='{{ item.option }}' value='{{ item.value }}' with_items: - - option: 'gw_active' - value: '{{ gw_active }}' - - option: 'internet_available' - value: '{{ internet_available }}' - option: 'has_ifcfg_gw' value: '{{ has_ifcfg_gw }}' - option: 'discovered_wan_iface' diff --git a/roles/1-prep/tasks/main.yml b/roles/1-prep/tasks/main.yml index 4dba2e733..49672c3a8 100644 --- a/roles/1-prep/tasks/main.yml +++ b/roles/1-prep/tasks/main.yml @@ -73,11 +73,6 @@ - include: prep.yml when: first_run -- include: computed_vars.yml - -- include: detected_network.yml - when: not installing - # Put conditional actions for hardware platforms here - include: raspberry_pi_2.yml when: first_run and rpi_model != "none" From bd5043387407c63566bad743b60ca7740b17d708 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Sat, 23 Sep 2017 03:03:58 -0400 Subject: [PATCH 12/16] move network detection to network -- adjused for hostname --- roles/1-prep/defaults/main.yml | 55 ++++++------------- roles/1-prep/tasks/main.yml | 5 -- roles/netvars/tasks/main.yml | 8 +-- roles/network/defaults/main.yml | 27 +++++++++ .../tasks/detected_network.yml | 0 .../tasks/detected_redhat.yml | 0 roles/network/tasks/main.yml | 6 ++ 7 files changed, 52 insertions(+), 49 deletions(-) rename roles/{1-prep => network}/tasks/detected_network.yml (100%) rename roles/{1-prep => network}/tasks/detected_redhat.yml (100%) diff --git a/roles/1-prep/defaults/main.yml b/roles/1-prep/defaults/main.yml index 71af080a7..89df65e47 100644 --- a/roles/1-prep/defaults/main.yml +++ b/roles/1-prep/defaults/main.yml @@ -6,49 +6,26 @@ gui_version: 2 # These are defaults for boolean routines, first_run: False installing: False -NUC6_firmware_needed: False -exFAT_enabled: False -no_NM_reload: False -has_WAN: False -wireless_lan_present: False -strict_networking: False -iiab_demo_mode: False -gw_active: False -gui_static_wan: False +discovered_wan_iface: "none" +gw_active: "none" internet_available: False is_F18: False +no_NM_reload: False +exFAT_enabled: False +gui_port: 80 + +# Set default for discovered hardware +rpi_model: none +is_rpi: False +xo_model: none +rtc_id: ds3231 +NUC6_firmware_needed: False + +# used in 2-common xo.yml +wifi_id: none + is_F20: False is_F21: False is_F22: False is_F23: False is_F24: False - -# Set default for discovered hardware -driver_name: nl80211 -rpi_model: none -is_rpi: False -xo_model: none -rtc_id: ds3231 - -# Set defaults for discovery process as strings -wifi1: "not found-1" -wifi2: "not found-2" -discovered_wan_iface: "none" -discovered_lan_iface: "none" -discovered_wireless_iface: "none" -iiab_wireless_lan_iface: "none" -iiab_lan_iface: "none" -iiab_wan_iface: "none" -device_gw: "none" -has_ifcfg_gw: "none" -has_wifi_gw: "none" -ap_device: "none" -device_gw2: "" - -gui_port: 80 - -# must keep roles/iiab-admin/defaults/main.yml sync'd -admin_console_path: "{{ iiab_base }}/admin_console" -cmdsrv_path: "{{ iiab_base }}/iiab_cmdsrv" -iiab_cmdsrv_dbname : "iiab_cmdsrv.0.2.db" -wifi_id: none diff --git a/roles/1-prep/tasks/main.yml b/roles/1-prep/tasks/main.yml index 49672c3a8..60b896567 100644 --- a/roles/1-prep/tasks/main.yml +++ b/roles/1-prep/tasks/main.yml @@ -1,8 +1,3 @@ -- name: Set flag for fedora 18 - set_fact: - is_F18: True - when: ansible_distribution_release == "based on Fedora 18" or ansible_distribution_version == "18" - - name: get the uuidgen program package: name=uuid-runtime state=present diff --git a/roles/netvars/tasks/main.yml b/roles/netvars/tasks/main.yml index 68b4c2b66..54ec4b7d3 100644 --- a/roles/netvars/tasks/main.yml +++ b/roles/netvars/tasks/main.yml @@ -6,12 +6,10 @@ set_fact: first_run: True when: not NewInstall.stat.exists -# when: NewInstall.stat.exists is defined and not NewInstall.stat.exists -# we need to inialize the ini file +# 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. - include: roles/1-prep/tasks/iiab_ini.yml when: first_run - +# Now load the computed vars - include: roles/1-prep/tasks/computed_vars.yml -- include: roles/1-prep/tasks/detected_network.yml - when: not installing diff --git a/roles/network/defaults/main.yml b/roles/network/defaults/main.yml index 722761dda..25c7b6b31 100644 --- a/roles/network/defaults/main.yml +++ b/roles/network/defaults/main.yml @@ -1,10 +1,36 @@ --- +# Defaults for network detection +wireless_lan_present: False +strict_networking: False +iiab_demo_mode: False +gui_static_wan: False + +# Set defaults for discovery process as strings +wifi1: "not found-1" +wifi2: "not found-2" +discovered_lan_iface: "none" +discovered_wireless_iface: "none" +#Redhat +iiab_lan_iface: "none" +iiab_wan_iface: "none" +iiab_wireless_lan_iface: "none" +device_gw: "none" +device_gw2: "" +has_WAN: False +has_ifcfg_gw: "none" +has_wifi_gw: "none" +ap_device: "none" +#Debian +dhcpcd_result: "" +wan_in_interfaces: False + # The values here are default local variables. gui_wan_iface: "unset" gui_static_wan_ip: "unset" gui_desired_network_role: Gateway wondershaper_dspeed: "4096" wondershaper_upspeed: "1024" + # WiFi host_ssid: IIAB hostapd_wait: 10 @@ -15,6 +41,7 @@ host_country_code: US hostapd_secure: True hostapd_password: "iiab2017" driver_name: nl80211 + network_config_dir: /etc/network/interfaces.d iiab_network_mode: "Gateway" dns_jail_enabled: False diff --git a/roles/1-prep/tasks/detected_network.yml b/roles/network/tasks/detected_network.yml similarity index 100% rename from roles/1-prep/tasks/detected_network.yml rename to roles/network/tasks/detected_network.yml diff --git a/roles/1-prep/tasks/detected_redhat.yml b/roles/network/tasks/detected_redhat.yml similarity index 100% rename from roles/1-prep/tasks/detected_redhat.yml rename to roles/network/tasks/detected_redhat.yml diff --git a/roles/network/tasks/main.yml b/roles/network/tasks/main.yml index 5e93f5c3f..20a94af78 100644 --- a/roles/network/tasks/main.yml +++ b/roles/network/tasks/main.yml @@ -1,3 +1,9 @@ +- include: detected_network.yml + when: not installing + tags: + - network + - network-discover + - include: computed_network.yml when: not installing tags: From 0aedaa24fdd2ca3b8bc891721be10b3183573aa9 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Sun, 15 Oct 2017 20:22:22 -0500 Subject: [PATCH 13/16] split network up in iiab.ini --- roles/network/tasks/computed_network.yml | 2 +- roles/network/tasks/detected_network.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/network/tasks/computed_network.yml b/roles/network/tasks/computed_network.yml index 28cb52463..4b4b0f1ef 100644 --- a/roles/network/tasks/computed_network.yml +++ b/roles/network/tasks/computed_network.yml @@ -155,7 +155,7 @@ - name: Add location section to config file ini_file: dest='{{ iiab_config_file }}' - section=network + section=computed_network option='{{ item.option }}' value='{{ item.value }}' with_items: diff --git a/roles/network/tasks/detected_network.yml b/roles/network/tasks/detected_network.yml index 800becccf..e38409257 100644 --- a/roles/network/tasks/detected_network.yml +++ b/roles/network/tasks/detected_network.yml @@ -159,7 +159,7 @@ - name: Add location section to config file ini_file: dest='{{ iiab_config_file }}' - section=network + section=detected_network option='{{ item.option }}' value='{{ item.value }}' with_items: From c6060835537eca0d454f71447a7ec0afae70d6d5 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Tue, 24 Oct 2017 11:39:49 -0500 Subject: [PATCH 14/16] XSCE -> IIAB --- iiab-network | 8 ++++--- install-support | 3 ++- roles/1-prep/templates/iiab.env.j2 | 4 ++-- runansible | 37 ++++++++---------------------- runtags | 20 ++++++++-------- 5 files changed, 28 insertions(+), 44 deletions(-) diff --git a/iiab-network b/iiab-network index 5a065e556..9e24154be 100755 --- a/iiab-network +++ b/iiab-network @@ -3,15 +3,17 @@ if [ -f /etc/iiab/iiab.env ] then . /etc/iiab/iiab.env - cd $XSCE_DIR + cd $IIAB_DIR else echo /etc/iiab/iiab.env is missing. Playbook has not been run. exit 1 fi +CWD=`pwd` + if [ ! -f iiab-network.yml ] then - echo "XSCE Playbook not found." + echo "IIAB Playbook not found." echo "Please run this command from the top level of the git repo." echo "Exiting." exit @@ -22,7 +24,7 @@ then touch /etc/iiab/config_vars.yml fi -export ANSIBLE_LOG_PATH="$XSCE_DIR/iiab-network.log" +export ANSIBLE_LOG_PATH="$CWD/iiab-network.log" ansible-playbook -i ansible_hosts iiab-network.yml --connection=local echo "" >> iiab-network.log ls -la /etc/sys*/net*/ifcfg* >> iiab-network.log diff --git a/install-support b/install-support index cd73aade8..b7df01489 100755 --- a/install-support +++ b/install-support @@ -2,6 +2,7 @@ PLAYBOOK="iiab-base.yml" INVENTORY="ansible_hosts" +CWD=`pwd` if [ ! -f $PLAYBOOK ] then @@ -14,5 +15,5 @@ fi sed -i -e "s/openvpn_install: False/openvpn_install: True/" vars/local_vars.yml sed -i -e "s/openvpn_enabled: False/openvpn_enabled: True/" vars/local_vars.yml -export ANSIBLE_LOG_PATH="$XSCE_DIR/iiab-install.log" +export ANSIBLE_LOG_PATH="$CWD/iiab-install.log" ansible-playbook -i $INVENTORY $PLAYBOOK --connection=local diff --git a/roles/1-prep/templates/iiab.env.j2 b/roles/1-prep/templates/iiab.env.j2 index 602256841..b472d4fe6 100644 --- a/roles/1-prep/templates/iiab.env.j2 +++ b/roles/1-prep/templates/iiab.env.j2 @@ -1,7 +1,7 @@ # This is a configuration file for XSCE # It can sourced in a shell script or read into an application -XSCE_BASE_PATH={{ iiab_base }} -XSCE_DIR={{ iiab_dir }} +IIAB_BASE_PATH={{ iiab_base }} +IIAB_DIR={{ iiab_dir }} OS={{ ansible_local.local_facts.os }} OS_VER={{ ansible_local.local_facts.os_ver }} WWWROOT={{ doc_root }} diff --git a/runansible b/runansible index 2a6ea4954..51cee7876 100755 --- a/runansible +++ b/runansible @@ -1,4 +1,8 @@ #!/bin/bash -e +PLAYBOOK="iiab.yml" +INVENTORY="ansible_hosts" +# Pass cmdline options for ansible +ARGS="$@" # copy var files to /etc/iiab for subsequent use mkdir -p /etc/iiab @@ -28,13 +32,14 @@ fi if [ -f /etc/iiab/iiab.env ] then . /etc/iiab/iiab.env - cd $XSCE_DIR + cd $IIAB_DIR else - XSCE_DIR=/opt/iiab/iiab + IIAB_DIR=/opt/iiab/iiab mkdir -p /etc/iiab fi +CWD=`pwd` -if [ ! -f iiab.yml ] +if [ ! -f $PLAYBOOK ] then echo "IIAB Playbook not found." echo "Please run this command from the top level of the git repo." @@ -47,34 +52,10 @@ if [ ! -f /etc/ansible/facts.d/local_facts.fact ]; then fi cp ./scripts/local_facts.fact /etc/ansible/facts.d/local_facts.fact -PLAYBOOK="iiab.yml" -INVENTORY="ansible_hosts" -CWD=`pwd` echo "Running local playbooks! " -XSDOMAIN="" -# Pass in Existing Domain -if [ -f /etc/sysconfig/xs_domain_name ] -then - XSDOMAIN=`cat /etc/sysconfig/xs_domain_name` -fi - -# Or accept Domain on command line -if [ x"$1" != x ] -then - XSDOMAIN=$1 -fi - -# Pass in git location -if [ x"$XSDOMAIN" != x ] -then - ARGS="--extra-vars '{\"iiab_domain\":\"$XSDOMAIN\"}'" -else - ARGS="" -fi - -export ANSIBLE_LOG_PATH="$XSCE_DIR/iiab-install.log" +export ANSIBLE_LOG_PATH="$CWD/iiab-install.log" ansible -m setup -i $INVENTORY localhost --connection=local >> /dev/null ansible-playbook -i $INVENTORY $PLAYBOOK ${ARGS} --connection=local diff --git a/runtags b/runtags index ad8bde5e3..cb3b94af8 100755 --- a/runtags +++ b/runtags @@ -1,20 +1,20 @@ #!/bin/bash - -# copy var files to /etc/iiab for subsequent use - -#./install-init - -# if not the first run, repo location is here +PLAYBOOK="iiab.yml" +INVENTORY="ansible_hosts" +# Pass cmdline options for ansible +ARGS="$@" if [ -f /etc/iiab/iiab.env ] then . /etc/iiab/iiab.env - cd $XSCE_DIR + cd $IIAB_DIR fi -if [ ! -f iiab.yml ] +CWD=`pwd` + +if [ ! -f $PLAYBOOK ] then - echo "XSCE Playbook not found." + echo "IIAB Playbook not found." echo "Please run this command from the top level of the git repo." echo "Exiting." exit @@ -51,5 +51,5 @@ then taglist="netvars,"$taglist fi -export ANSIBLE_LOG_PATH="$XSCE_DIR/iiab-debug.log" +export ANSIBLE_LOG_PATH="$CWD/iiab-debug.log" ansible-playbook -i ansible_hosts iiab.yml --connection=local --tags="""$taglist""" From 99633173a47b1d16bb062a86f8f601eeb71cf794 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Tue, 24 Oct 2017 11:47:28 -0500 Subject: [PATCH 15/16] remove args from runtags --- runtags | 1 - 1 file changed, 1 deletion(-) diff --git a/runtags b/runtags index cb3b94af8..ffd00a02c 100755 --- a/runtags +++ b/runtags @@ -2,7 +2,6 @@ PLAYBOOK="iiab.yml" INVENTORY="ansible_hosts" # Pass cmdline options for ansible -ARGS="$@" if [ -f /etc/iiab/iiab.env ] then From 2d49a1590b3f399103a650f7e567aeb0b78c1e6a Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Thu, 26 Oct 2017 10:44:48 -0500 Subject: [PATCH 16/16] change netvars to 0-init --- iiab-base.yml | 2 +- iiab-from-console.yml | 2 +- iiab-network.yml | 2 +- iiab.yml | 2 +- roles/{netvars => 0-init}/defaults/main.yml | 0 roles/{netvars => 0-init}/tasks/main.yml | 0 runtags | 4 ++-- 7 files changed, 6 insertions(+), 6 deletions(-) rename roles/{netvars => 0-init}/defaults/main.yml (100%) rename roles/{netvars => 0-init}/tasks/main.yml (100%) diff --git a/iiab-base.yml b/iiab-base.yml index 23f440d66..a359808d9 100644 --- a/iiab-base.yml +++ b/iiab-base.yml @@ -8,6 +8,6 @@ - vars/local_vars.yml roles: - - { role: netvars, tags: ['netvars'] } + - { role: 0-init, tags: ['init'] } - { role: 1-prep, tags: ['prep','platform','base'] } - { role: openvpn, tags: ['openvpn'] } diff --git a/iiab-from-console.yml b/iiab-from-console.yml index 98641a303..1c29d7b18 100644 --- a/iiab-from-console.yml +++ b/iiab-from-console.yml @@ -9,7 +9,7 @@ - /etc/iiab/config_vars.yml roles: - - { role: netvars, tags: ['netvars'] } + - { role: 0-init, tags: ['init'] } - { role: 4-server-options, tags: ['options'] } - { role: 5-xo-services, tags: ['xo-services'] } - { role: 6-generic-apps, tags: ['generic-apps'] } diff --git a/iiab-network.yml b/iiab-network.yml index e717e7fa5..989108cb3 100644 --- a/iiab-network.yml +++ b/iiab-network.yml @@ -9,5 +9,5 @@ - /etc/iiab/config_vars.yml roles: - - { role: netvars, tags: ['network'] } + - { role: 0-init, tags: ['network'] } - { role: network, tags: ['network','base'] } diff --git a/iiab.yml b/iiab.yml index 5fc0e8e85..b46cac86e 100644 --- a/iiab.yml +++ b/iiab.yml @@ -9,7 +9,7 @@ - /etc/iiab/config_vars.yml roles: - - { role: netvars, tags: ['netvars'] } + - { role: 0-init, tags: ['init'] } - { role: 1-prep, tags: ['prep','platform','base'] } - { role: 2-common, tags: ['common','base'] } - { role: 3-base-server, tags: ['base'] } diff --git a/roles/netvars/defaults/main.yml b/roles/0-init/defaults/main.yml similarity index 100% rename from roles/netvars/defaults/main.yml rename to roles/0-init/defaults/main.yml diff --git a/roles/netvars/tasks/main.yml b/roles/0-init/tasks/main.yml similarity index 100% rename from roles/netvars/tasks/main.yml rename to roles/0-init/tasks/main.yml diff --git a/runtags b/runtags index ffd00a02c..ae25ea4df 100755 --- a/runtags +++ b/runtags @@ -35,7 +35,7 @@ found="N" for tag in $tags do - if [ "$tag" == "netvars" ] + if [ "$tag" == "init" ] then found="Y" fi @@ -47,7 +47,7 @@ taglist=$1 if [ "$found" == "N" ] then - taglist="netvars,"$taglist + taglist="init,"$taglist fi export ANSIBLE_LOG_PATH="$CWD/iiab-debug.log"