From fd3d1ae86ad88879a637d2179578ac7202918313 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Sat, 18 Nov 2017 22:08:11 -0500 Subject: [PATCH 1/7] DHCPCD_PATH --- scripts/local_facts.fact | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/local_facts.fact b/scripts/local_facts.fact index 67c274826..1735a2b60 100755 --- a/scripts/local_facts.fact +++ b/scripts/local_facts.fact @@ -5,7 +5,7 @@ VERSION_ID=`grep VERSION_ID /etc/*elease | cut -d= -f2` VERSION_ID=${VERSION_ID//\"/} VERSION_ID=${VERSION_ID%%.*} OS_VER=$OS-$VERSION_ID -DHCPCD=`which dhcpcd` +DHCPCD_PATH=`which dhcpcd` case $OS_VER in "fedora-18" | \ @@ -53,6 +53,11 @@ else STAGE=0 fi ANSIBLE_VERSION=$(ansible --version|head -n 1|cut -f 2 -d " ") + +if [ ! x$DHCPCD_PATH = x ] +then + DHCPCD=`systemctl is-enabled dhcpcd` +fi cat < Date: Thu, 16 Nov 2017 06:01:58 -0600 Subject: [PATCH 2/7] network - disable is_redhat specific detection --- roles/network/tasks/computed_network.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/roles/network/tasks/computed_network.yml b/roles/network/tasks/computed_network.yml index 19cd1048a..6b3eba538 100644 --- a/roles/network/tasks/computed_network.yml +++ b/roles/network/tasks/computed_network.yml @@ -6,19 +6,19 @@ user_wan_iface: "{{ discovered_wan_iface }}" when: discovered_wan_iface != "none" and xo_model != "none" and has_ifcfg_gw == "none" -- name: Checking for NetworkManager-config-server - shell: rpm -qa | grep NetworkManager-config-server | wc -l - register: strict_networking_check +#- name: Checking for NetworkManager-config-server +# shell: rpm -qa | grep NetworkManager-config-server | wc -l +# register: strict_networking_check -- name: Found Checking for NetworkManager-config-server - set_fact: - strict_networking: True - when: strict_networking_check == "1" +#- name: Found Checking for NetworkManager-config-server +# set_fact: +# strict_networking: True +# when: strict_networking_check == "1" -- name: Use restricted network features - set_fact: - iiab_demo_mode: True - when: teamviewer_install and not strict_networking +#- name: Use restricted network features +# set_fact: +# iiab_demo_mode: True +# when: teamviewer_install and not strict_networking - name: XO laptop wants USB WiFi interface as AP mode set_fact: From 4416cf5e5543cc2a9ba57efd31741e65ebca096f Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Sat, 11 Nov 2017 17:43:55 -0600 Subject: [PATCH 3/7] make that a 2 min timeout for squid --- roles/network/tasks/restart.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/network/tasks/restart.yml b/roles/network/tasks/restart.yml index 62eed3108..49fff4e68 100644 --- a/roles/network/tasks/restart.yml +++ b/roles/network/tasks/restart.yml @@ -10,6 +10,7 @@ - name: Stop Squid service service: name={{ proxy }} state=stopped + async: 120 when: squid_install - name: Stop DansGuardian From db38c9a1d0d392facd32cccc5fb5463b13464094 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Sun, 12 Nov 2017 20:52:02 -0600 Subject: [PATCH 4/7] move hostname.yml --- roles/{2-common => 0-init}/tasks/hostname.yml | 6 +++--- roles/0-init/tasks/main.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) rename roles/{2-common => 0-init}/tasks/hostname.yml (84%) diff --git a/roles/2-common/tasks/hostname.yml b/roles/0-init/tasks/hostname.yml similarity index 84% rename from roles/2-common/tasks/hostname.yml rename to roles/0-init/tasks/hostname.yml index 4726ec306..9a535761f 100644 --- a/roles/2-common/tasks/hostname.yml +++ b/roles/0-init/tasks/hostname.yml @@ -22,6 +22,6 @@ include_tasks: roles/httpd/tasks/main.yml when: iiab_stage|int > 3 -- name: Re-configuring rest of networking - not initial install - include_tasks: roles/network/tasks/main.yml - when: iiab_stage|int > 4 +#- name: Re-configuring rest of networking - not initial install +# include_tasks: roles/network/tasks/main.yml +# when: iiab_stage|int > 4 diff --git a/roles/0-init/tasks/main.yml b/roles/0-init/tasks/main.yml index dd80cc686..0c9d0b27a 100644 --- a/roles/0-init/tasks/main.yml +++ b/roles/0-init/tasks/main.yml @@ -199,7 +199,7 @@ value: '{{ FQDN_changed }}' - name: Now changing FQDN - include_tasks: roles/2-common/tasks/hostname.yml + include_tasks: hostname.yml when: FQDN_changed - name: STAGE 0 HAS COMPLETED ====================================== From 3abea5f1473e138c8a520ea6128deb092d71d54d Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Sat, 18 Nov 2017 12:40:40 -0500 Subject: [PATCH 5/7] FQDN disable httpd --- roles/0-init/tasks/hostname.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/0-init/tasks/hostname.yml b/roles/0-init/tasks/hostname.yml index 9a535761f..b929e18f1 100644 --- a/roles/0-init/tasks/hostname.yml +++ b/roles/0-init/tasks/hostname.yml @@ -18,9 +18,9 @@ group=root mode=0644 -- name: Re-configuring httpd - not initial install - include_tasks: roles/httpd/tasks/main.yml - when: iiab_stage|int > 3 +#- name: Re-configuring httpd - not initial install +# include_tasks: roles/httpd/tasks/main.yml +# when: iiab_stage|int > 3 #- name: Re-configuring rest of networking - not initial install # include_tasks: roles/network/tasks/main.yml From 90020a25bab5df6295c509a1eba072c834b2474b Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Sat, 18 Nov 2017 22:29:45 -0500 Subject: [PATCH 6/7] iiab-install ordering --- iiab-install | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/iiab-install b/iiab-install index 8e16c53bd..7ede032ab 100755 --- a/iiab-install +++ b/iiab-install @@ -3,15 +3,6 @@ # Add cmdline options for passing to ansible # Todo add proper shift to gobble up --debug --reinstall -if [ "$1" != "--debug" ] && [ "$1" != "--reinstall" ] && [ "$1" != "" ]; then - echo "Use './iiab-install' for regular installs, or to continue an install." - echo "Use './iiab-install --reinstall' to force running all Stages 0-9." - echo "Use './iiab-install --debug' to run Stage 0, followed by Stages 3-9." - echo "Use './runtags' to run a single Stage or Tag or Role." - echo "Use './iiab-network' to run Network sections." - exit 1 -fi - PLAYBOOK="iiab-stages.yml" INVENTORY="ansible_hosts" ARGS="" @@ -23,12 +14,27 @@ MIN_ANSIBLE_VER=2.4.1.0 export ANSIBLE_LOG_PATH="$CWD/iiab-install.log" +if [ ! -f /etc/ansible/facts.d/local_facts.fact ]; then + mkdir -p /etc/ansible/facts.d +fi +cp ./scripts/local_facts.fact /etc/ansible/facts.d/local_facts.fact +echo "Placed /etc/ansible/facts.d/local_facts.fact into position." + if [ ! -f $PLAYBOOK ]; then echo "EXITING: IIAB Playbook not found." echo "Please run 'iiab-install' from /opt/iiab/iiab (top level of git repo)." exit 1 fi +if [ "$1" != "--debug" ] && [ "$1" != "--reinstall" ] && [ "$1" != "" ]; then + echo "Use './iiab-install' for regular installs, or to continue an install." + echo "Use './iiab-install --reinstall' to force running all Stages 0-9." + echo "Use './iiab-install --debug' to run Stage 0, followed by Stages 3-9." + echo "Use './runtags' to run a single Stage or Tag or Role." + echo "Use './iiab-network' to run Network sections." + exit 1 +fi + # Subroutine compares software version numbers. Generates rare false positives # like "1.0 > 1" and "2.4.0 > 2.4". Avoid risks by structuring conditionals w/ # a consistent # of decimal points e.g. "if version_gt w.x.y.z a.b.c.d; then" @@ -61,12 +67,6 @@ if version_gt $MIN_ANSIBLE_VER $CURR_ANSIBLE_VER; then exit 1 fi -if [ ! -f /etc/ansible/facts.d/local_facts.fact ]; then - mkdir -p /etc/ansible/facts.d -fi -cp ./scripts/local_facts.fact /etc/ansible/facts.d/local_facts.fact -echo "Placed /etc/ansible/facts.d/local_facts.fact into position." - # Stage 0 will always be run. From there on up to Stage 9 we keep a counter # (in /etc/iiab/iiab.env) of the highest completed Stage. Avoid repetition! STAGE=0 From 0143cea2dd4545e5f26709dc14f845bb257df1e2 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Sun, 19 Nov 2017 20:34:19 -0600 Subject: [PATCH 7/7] dhcpd move stock disable --- roles/network/tasks/dhcpd.yml | 8 +++++++- roles/network/tasks/enable_services.yml | 6 ------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/roles/network/tasks/dhcpd.yml b/roles/network/tasks/dhcpd.yml index f5612df22..3896c6381 100644 --- a/roles/network/tasks/dhcpd.yml +++ b/roles/network/tasks/dhcpd.yml @@ -17,7 +17,13 @@ createhome=no when: is_debuntu -- name: Configure dhcpd +- name: Disable stock dhcp_service + service: name={{ dhcp_service }} + enabled=no + state=stopped + when: is_debuntu + +- name: Install systemd unit file to /etc/systemd/system/dhcpd.service template: src={{ item.src }} dest={{ item.dest }} owner=root diff --git a/roles/network/tasks/enable_services.yml b/roles/network/tasks/enable_services.yml index 6e53c08cb..e8e272a78 100644 --- a/roles/network/tasks/enable_services.yml +++ b/roles/network/tasks/enable_services.yml @@ -1,9 +1,3 @@ -- name: Disable stock dhcp_service - service: name={{ dhcp_service }} - enabled=no - state=stopped - when: dhcpd_install and first_run and is_debuntu - - name: Disable dhcpd service service: name=dhcpd enabled=no