diff --git a/roles/1-prep/defaults/main.yml b/roles/1-prep/defaults/main.yml index 30a64076d..6db2295e8 100644 --- a/roles/1-prep/defaults/main.yml +++ b/roles/1-prep/defaults/main.yml @@ -15,7 +15,7 @@ strict_networking: False iiab_demo_mode: False gw_active: False gui_static_wan: False -has_internet_connection: False +internet_available: False is_F18: False is_F20: False is_F21: False diff --git a/roles/1-prep/tasks/computed_vars.yml b/roles/1-prep/tasks/computed_vars.yml index 6f89d5579..8a0257fd5 100644 --- a/roles/1-prep/tasks/computed_vars.yml +++ b/roles/1-prep/tasks/computed_vars.yml @@ -19,9 +19,6 @@ - name: Defaulting iiab_prepped set_fact: iiab_prepped: False - tags: - - download - - download2 - name: Set exFAT enabled for XOs set_fact: diff --git a/roles/1-prep/tasks/detected_network.yml b/roles/1-prep/tasks/detected_network.yml index 07a94c7cc..4ad2b7787 100644 --- a/roles/1-prep/tasks/detected_network.yml +++ b/roles/1-prep/tasks/detected_network.yml @@ -59,26 +59,15 @@ # poll: 2 register: internet_access_test -- name: Set has_internet_connection true if wget succeeded +- name: Set internet_available true if wget succeeded set_fact: - has_internet_connection: True + internet_available: True when: not internet_access_test|failed - name: Cleanup internet test file file: path=/tmp/heart-beat.txt state=absent -- name: Turn off downloads if no internet connection - set_fact: - no_network: True - when: not has_internet_connection - -- name: Testing for iiab_preload - set_fact: - use_cache: True - no_network: True - when: iiab_preload == "True" - - name: Setting wan if detected set_fact: iiab_wan_iface: "{{ discovered_wan_iface }}" @@ -250,7 +239,7 @@ - name: for debian, always use bridging set_fact: iiab_lan_iface: br0 - when: 'discovered_lan_iface != "none" and num_lan_interfaces >= "1" and is_debian' + when: 'discovered_lan_iface != "none" and num_lan_interfaces >= "1" and is_debuntu' - name: 2 or more devices on the LAN - use bridging set_fact: @@ -279,8 +268,8 @@ with_items: - option: 'gateway_active' value: '{{ gw_active }}' - - option: 'internet_accessible' - value: '{{ has_internet_connection }}' + - option: 'internet_available' + value: '{{ internet_available }}' - option: 'gateway_ifcfg' value: '{{ has_ifcfg_gw }}' - option: 'detected_gateway' diff --git a/roles/2-common/tasks/packages.yml b/roles/2-common/tasks/packages.yml index 3a66d58fd..d916726af 100644 --- a/roles/2-common/tasks/packages.yml +++ b/roles/2-common/tasks/packages.yml @@ -37,8 +37,6 @@ - syslog - xml-common when: is_redhat - tags: - - download - name: Install yum packages for Debian package: name={{ item }} @@ -47,8 +45,6 @@ - inetutils-syslogd - wpasupplicant when: is_debuntu - tags: - - download - name: Install common packages package: name={{ item }} @@ -79,8 +75,6 @@ - curl - pandoc - lynx - tags: - - download - name: Install pip as a commonly required package management system command: curl https://bootstrap.pypa.io/get-pip.py -o {{ downloads_dir }}/get-pip.py @@ -97,8 +91,6 @@ - bash - iptables when: is_redhat - tags: - - download - name: Update common packages (debian) package: name={{ item }} @@ -108,8 +100,6 @@ - bash - iptables when: is_debuntu - tags: - - download # instuctions state to start with a fully updated system before starting, stop using diff --git a/roles/2-common/tasks/xo.yml b/roles/2-common/tasks/xo.yml index 267a56b24..e0c86b5e0 100644 --- a/roles/2-common/tasks/xo.yml +++ b/roles/2-common/tasks/xo.yml @@ -112,7 +112,7 @@ get_url: url="{{ iiab_download_url }}/{{ item }}" dest={{ downloads_dir}}/{{ item }} with_items: - hostapd_8188_i386 - when: wifi_id == "tplink_WM725M" and xo_model == "XO-1.5" and not {{ use_cache }} and not {{ no_network }} + when: wifi_id == "tplink_WM725M" and xo_model == "XO-1.5" and internet_available tags: - xo diff --git a/roles/2-common/tasks/yum.yml b/roles/2-common/tasks/yum.yml index e2e90f8ed..8db268c37 100644 --- a/roles/2-common/tasks/yum.yml +++ b/roles/2-common/tasks/yum.yml @@ -37,8 +37,6 @@ - syslog - xml-common when: is_redhat - tags: - - download - name: Install yum packages for Debian package: name={{ item }} @@ -47,8 +45,6 @@ - inetutils-syslogd - wpasupplicant when: is_debuntu - tags: - - download - name: Install common packages package: name={{ item }} @@ -77,8 +73,6 @@ - openssl #FC 18 does not supply, but pear requires - gawk - sqlite3 - tags: - - download - name: Update common packages (not debian package: name={{ item }} @@ -89,8 +83,6 @@ - bash - iptables when: is_redhat - tags: - - download - name: Update common packages (debian) package: name={{ item }} @@ -100,8 +92,6 @@ - bash - iptables when: is_debuntu - tags: - - download # instuctions state to start with a fully updated system before starting, stop using diff --git a/roles/ajenti/tasks/ajenti-wondershaper.yml b/roles/ajenti/tasks/ajenti-wondershaper.yml index 27baa6929..cdb7e9c08 100644 --- a/roles/ajenti/tasks/ajenti-wondershaper.yml +++ b/roles/ajenti/tasks/ajenti-wondershaper.yml @@ -1,14 +1,9 @@ - name: download wondershaper ajenti plugin pip: name="{{ iiab_download_url }}"/ajenti-plugin-wondershaper-0.3.tar.gz extra_args="--download {{ pip_packages_dir }}" - when: not {{ use_cache }} and not {{ no_network }} - tags: - - download2 - + when: internet_available - name: install wondershaper from local download directory pip: name=ajenti-plugin-wondershaper extra_args="--no-index --find-links=file://{{ pip_packages_dir }}" -# notify: -# - restart ajenti service diff --git a/roles/ajenti/tasks/main.yml b/roles/ajenti/tasks/main.yml index d4efa900f..2f05da436 100644 --- a/roles/ajenti/tasks/main.yml +++ b/roles/ajenti/tasks/main.yml @@ -1,8 +1,6 @@ - name: Install python-pip package package: name=python-pip state=present - tags: - - download - name: Install required libraries package: name={{ item.pkg }} @@ -14,15 +12,11 @@ - pkg: pyOpenSSL - pkg: python-daemon - pkg: gcc - tags: - - download - name: download ajenti from our repo pip: name="{{ iiab_download_url }}"/ajenti-0.99.34-patched5.tar.gz extra_args="--download {{ pip_packages_dir }}" - when: not {{ use_cache }} and not {{ no_network }} - tags: - - download2 + when: internet_available - name: install ajenti from local download directory pip: name=ajenti @@ -34,9 +28,7 @@ - name: download python-catcher pip: name=python-catcher version=0.1.3 extra_args="--download {{ pip_packages_dir }}" - when: not {{ use_cache }} and not {{ no_network }} - tags: - - download2 + when: internet_available - name: install python-catcher from local download directory pip: name=python-catcher diff --git a/roles/authserver/tasks/main.yml b/roles/authserver/tasks/main.yml index 769c86454..493953f63 100644 --- a/roles/authserver/tasks/main.yml +++ b/roles/authserver/tasks/main.yml @@ -1,15 +1,11 @@ - name: check pip is installed package: name=python-pip state=present - tags: - - download - name: download xs-authserver from pypi pip: name=xs-authserver extra_args="--download {{ pip_packages_dir }}" - when: not {{ use_cache }} and not {{ no_network }} - tags: - - download2 + when: internet_available - name: install xs-authserver from pypi pip: name=xs-authserver @@ -18,8 +14,6 @@ - name: install gunicorn package: name=python-gunicorn state=present - tags: - - download - name: Configure xs-authserver template: backup=yes diff --git a/roles/awstats/tasks/install.yml b/roles/awstats/tasks/install.yml index 4d112f07e..d495a5fd4 100644 --- a/roles/awstats/tasks/install.yml +++ b/roles/awstats/tasks/install.yml @@ -58,7 +58,6 @@ stat: path=/etc/awstats/awstats.conf register: awstats -- debug: var=awstats - name: If there was a config file installed by package, move it aside command: mv /etc/awstats/awstats.conf /etc/awstats/awstats.conf.dist diff --git a/roles/calibre/tasks/main.yml b/roles/calibre/tasks/main.yml index a4f955a61..59f62bdb0 100644 --- a/roles/calibre/tasks/main.yml +++ b/roles/calibre/tasks/main.yml @@ -4,16 +4,12 @@ url="{{ calibre_src_url }}" dest="{{ downloads_dir }}/calibre-installer.py" mode=0755 - tags: - download2 when: ansible_distribution == "CentOS" - name: Install calibre shell: "{{ downloads_dir }}/calibre-installer.py >> /dev/null" args: creates: /usr/bin/calibre-uninstall - tags: - download2 when: calibre_install and ansible_distribution == 'CentOS' - name: Install Caibre rpms @@ -23,7 +19,6 @@ with_items: - calibre when: calibre_install and ansible_distribution != 'CentOS' - tags: download - name: Create calibre service(s) and support scripts template: backup=no diff --git a/roles/cups/tasks/main.yml b/roles/cups/tasks/main.yml index 26de7a612..dc62c98e7 100644 --- a/roles/cups/tasks/main.yml +++ b/roles/cups/tasks/main.yml @@ -1,5 +1,4 @@ # administer this service by browsing to localhost:631 -- debug: var=cups_install - name: get the CUPS package installed package: name={{ item }} state=present diff --git a/roles/debian_schooltool/tasks/main.yml b/roles/debian_schooltool/tasks/main.yml index e4d853244..d7fb9ca07 100644 --- a/roles/debian_schooltool/tasks/main.yml +++ b/roles/debian_schooltool/tasks/main.yml @@ -16,8 +16,6 @@ - libjpeg-dev - xvfb when: debian_schooltool_install and is_debuntu - tags: - - download - name: Create the font directory file: path=/usr/share/fonts/truetype/ttf-ubuntu @@ -26,7 +24,6 @@ - name: get the ttf-ubuntu-font-family get_url: url={{ iiab_download_url }}/ubuntu-font-family-0.83.zip dest={{ downloads_dir }} - tags: download2 - name: expand the ttf fonts to the right place unarchive: src={{ downloads_dir }}/ubuntu-font-family-0.83.zip @@ -35,7 +32,6 @@ - name: get the schooltool source get_url: url={{ iiab_download_url }}/{{ schooltool_src }} dest={{ downloads_dir }} - tags: download2 - name: expand source to dest unarchive: src={{ downloads_dir }}/{{ schooltool_src }} diff --git a/roles/dokuwiki/tasks/install.yml b/roles/dokuwiki/tasks/install.yml index 2e4c320ab..e7d588ab5 100644 --- a/roles/dokuwiki/tasks/install.yml +++ b/roles/dokuwiki/tasks/install.yml @@ -1,8 +1,6 @@ - name: Get the Dokuwiki software get_url: url="{{ iiab_download_url }}/{{ dokuwiki_version }}.tgz" dest={{ downloads_dir}}/ - when: not {{ use_cache }} and not {{ no_network }} - tags: - - download2 + when: internet_available - name: Copy it to permanent location /library unarchive: src={{ downloads_dir }}/{{ dokuwiki_version }}.tgz dest=/library creates=/library/{{ dokuwiki_version }}/VERSION diff --git a/roles/elgg/tasks/main.yml b/roles/elgg/tasks/main.yml index 5c7b6a30d..3628742b9 100644 --- a/roles/elgg/tasks/main.yml +++ b/roles/elgg/tasks/main.yml @@ -1,8 +1,6 @@ - name: download current version from our copy shell: wget {{ iiab_download_url }}/elgg-{{ elgg_version }}.zip -c -P {{ downloads_dir }} - when: not {{ use_cache }} and not {{ no_network }} - tags: - - download2 + when: internet_available - name: Determine if software is already expanded stat: path=/opt/elgg/index.php diff --git a/roles/kalite/tasks/install-f18.yml b/roles/kalite/tasks/install-f18.yml index 8a166a760..7d32b15b1 100644 --- a/roles/kalite/tasks/install-f18.yml +++ b/roles/kalite/tasks/install-f18.yml @@ -6,16 +6,12 @@ with_items: - python-psutil - expect - tags: - - download when: is_F18 - name: Download dependent pip packages F18 pip: name=selenium extra_args="--download {{ pip_packages_dir }}" - when: not {{ use_cache }} and not {{ no_network }} and is_F18 - tags: - - download2 + when: internet_available and is_F18 - name: Install dependent pip packages F18 pip: name=selenium @@ -32,9 +28,7 @@ depth=1 version="0.13.x" ignore_errors: yes - when: not {{ use_cache }} and not {{ no_network }} and kalite.stat.exists is defined an not kalite.stat.exists - tags: - - download2 + when: internet_available and kalite.stat.exists is defined an not kalite.stat.exists - name: Create iiab-kalite user and password F18 user: name={{ kalite_user }} diff --git a/roles/kalite/tasks/install.yml b/roles/kalite/tasks/install.yml index 16ba448f0..63b26e89a 100644 --- a/roles/kalite/tasks/install.yml +++ b/roles/kalite/tasks/install.yml @@ -5,9 +5,7 @@ state=present with_items: - lsb - tags: - - download - when: not {{ use_cache }} and not {{ no_network }} and ansible_distribution == "CentOS" + when: internet_available and ansible_distribution == "CentOS" # Version 0.17.x # pip show kalite @@ -39,9 +37,7 @@ - name: Downoad kalite with pip pip: name=ka-lite version={{ kalite_version }} extra_args="--download {{ pip_packages_dir }}" - when: not {{ use_cache }} and not {{ no_network }} - tags: - - download2 + when: internet_available - name: Install kalite with pip pip: name=ka-lite version={{ kalite_version }} diff --git a/roles/kalite/tasks/main.yml b/roles/kalite/tasks/main.yml index 8d06510a6..71aadf35c 100644 --- a/roles/kalite/tasks/main.yml +++ b/roles/kalite/tasks/main.yml @@ -6,36 +6,21 @@ set_fact: kalite_db_name: "{{ kalite_root }}/kalite/database/data.sqlite" when: is_F18 - tags: - - download - - download2 - name: Calc kalite db file name set_fact: kalite_db_name: "{{ kalite_root }}/database/data.sqlite" when: not is_F18 - tags: - - download - - download2 - name: See if kalite is already configured stat: path="{{ kalite_db_name }}" register: kalite_installed - tags: - - download - - download2 - include: install-f18.yml when: not kalite_installed.stat.exists and is_F18 - tags: - - download - - download2 - include: install.yml when: kalite_installed is defined and not kalite_installed.stat.exists and not is_F18 - tags: - - download - - download2 - name: ask systemd to reread the unit files shell: systemctl daemon-reload diff --git a/roles/kiwix/tasks/kiwix_install.yml b/roles/kiwix/tasks/kiwix_install.yml index fda3bfb79..8f552b156 100644 --- a/roles/kiwix/tasks/kiwix_install.yml +++ b/roles/kiwix/tasks/kiwix_install.yml @@ -25,8 +25,6 @@ kiwix_first_pass: True when: kiwix_first_pass_test.changed -- debug: var=kiwix_first_pass_test -- debug: var=kiwix_first_pass - name: Copy test.zim file copy: src=test.zim dest={{ kiwix_content_path }}/test.zim diff --git a/roles/kiwix/tasks/main.yml b/roles/kiwix/tasks/main.yml index 8e61eac2a..fda118f4c 100644 --- a/roles/kiwix/tasks/main.yml +++ b/roles/kiwix/tasks/main.yml @@ -19,9 +19,7 @@ - name: Get the kiwix software get_url: url="{{ iiab_download_url }}/{{ kiwix_src_file }}" dest="{{ downloads_dir }}/{{ kiwix_src_file }}" - when: not {{ use_cache }} and not {{ no_network }} - tags: - - download2 + when: internet_available - include: kiwix_install.yml when: kiwix_src_file is defined diff --git a/roles/mongodb/tasks/main.yml b/roles/mongodb/tasks/main.yml index 3235f0d3e..8e445845f 100644 --- a/roles/mongodb/tasks/main.yml +++ b/roles/mongodb/tasks/main.yml @@ -4,7 +4,7 @@ with_items: - mongodb-server - mongodb - when: not {{ use_cache }} and not {{ no_network }} + when: internet_available tags: - download diff --git a/roles/moodle/tasks/main.yml b/roles/moodle/tasks/main.yml index 7335aed08..35b6ddfaf 100644 --- a/roles/moodle/tasks/main.yml +++ b/roles/moodle/tasks/main.yml @@ -6,8 +6,6 @@ - python-psycopg2 - php-pgsql when: not is_debuntu - tags: - - download - name: Install moodle required packages package: name={{ item }} @@ -20,16 +18,11 @@ - php{{ php_version }}-gd # - php-mbstring --perhaps debian libapache2-mod-php when: is_debuntu - tags: - - download - name: Determine if moodle is already downloaded stat: path={{ moodle_base }}/config-dist.php register: moodle -- debug: var=moodle -- debug: var=no_network - - name: Download the latest moodle repo git: repo={{ moodle_repo_url }} dest={{ moodle_base }} @@ -37,9 +30,7 @@ force=yes version="MOODLE_{{ moodle_version }}_STABLE" # ignore_errors: yes - when: not {{ use_cache }} and not {{ no_network }} and moodle.stat.exists is defined and not moodle.stat.exists - tags: - - download2 + when: internet_available and moodle.stat.exists is defined and not moodle.stat.exists - name: Prepare the downloaded directory so apache can install config file file: path={{ moodle_base }} diff --git a/roles/network/tasks/debian.yml b/roles/network/tasks/debian.yml index 4c42fd2a5..64a182dae 100644 --- a/roles/network/tasks/debian.yml +++ b/roles/network/tasks/debian.yml @@ -10,14 +10,6 @@ # 5. In gateway: eth0 is wan, and wlan0 is under br0 (only one adapter under br0) # 6. As a slight concess to auto config, if eth1 exists, make it wan, and force gateway -- debug: var=discovered_lan_iface -- debug: var=discovered_wan_iface -- debug: var=gui_desired_network_role -- debug: var=gui_static_wan_ip -- debug: var=hostapd_enabled -- debug: var=discovered_wireless_iface -- debug: var=gui_static_wan - - name: in upgrade from earlier 6.2, delete the resolvconf package: name=resolvconf state=absent @@ -80,8 +72,8 @@ with_items: - option: 'gateway_active' value: '{{ gw_active }}' - - option: 'internet_accessible' - value: '{{ has_internet_connection }}' + - option: 'internet_available' + value: '{{ internet_available }}' - option: 'gateway_ifcfg' value: '{{ has_ifcfg_gw }}' - option: 'detected_gateway' diff --git a/roles/network/tasks/display-discover.yml b/roles/network/tasks/display-discover.yml deleted file mode 100644 index 6304cf38f..000000000 --- a/roles/network/tasks/display-discover.yml +++ /dev/null @@ -1,4 +0,0 @@ -- debug: var=has_ifcfg_gw -- debug: var=iiab_wan_iface -- debug: var=iiab_lan_iface -- debug: var=iiab_network_mode diff --git a/roles/network/tasks/main.yml b/roles/network/tasks/main.yml index 1ba0039dc..743b3fea8 100644 --- a/roles/network/tasks/main.yml +++ b/roles/network/tasks/main.yml @@ -4,10 +4,6 @@ - network - network-discover -- include: display-discover.yml - tags: - - network-discover - - name: Set hostname template: dest=/etc/hostname src=network/hostname.j2 diff --git a/roles/network/tasks/rpi_debian.yml b/roles/network/tasks/rpi_debian.yml index 9abf08472..9686cf9ce 100644 --- a/roles/network/tasks/rpi_debian.yml +++ b/roles/network/tasks/rpi_debian.yml @@ -77,14 +77,6 @@ #allocate wlan0 under br0 in all cases #allocate eth0 under br0 if appliance, alone if gateway -- debug: var=discovered_lan_iface -- debug: var=discovered_wan_iface -- debug: var=gui_desired_network_role -- debug: var=gui_static_wan_ip -- debug: var=hostapd_enabled -- debug: var=discovered_wireless_iface -- debug: var=gui_static_wan - - name: Add location section to config file ini_file: dest='{{ iiab_config_file }}' section=network @@ -93,8 +85,8 @@ with_items: - option: 'gateway_active' value: '{{ gw_active }}' - - option: 'internet_accessible' - value: '{{ has_internet_connection }}' + - option: 'internet_available' + value: '{{ internet_available }}' - option: 'gateway_ifcfg' value: '{{ has_ifcfg_gw }}' - option: 'detected_gateway' diff --git a/roles/nextcloud/tasks/F18.yml b/roles/nextcloud/tasks/F18.yml index 3aaa1a7e3..7c5a8be68 100644 --- a/roles/nextcloud/tasks/F18.yml +++ b/roles/nextcloud/tasks/F18.yml @@ -5,9 +5,7 @@ # but we use the tar file to get the latest version; really only benefits the xo4 on fedora 18 - name: Get the nextcloud software get_url: url="{{ nextcloud_dl_url }}"/{{ nextcloud_src_file }} dest={{ downloads_dir }}/{{ nextcloud_src_file }} - when: not {{ use_cache }} and not {{ no_network }} - tags: - - download2 + when: internet_available - name: Copy it to permanent location /opt unarchive: src={{ downloads_dir }}/{{ nextcloud_src_file }} dest=/opt/ diff --git a/roles/nextcloud/tasks/main.yml b/roles/nextcloud/tasks/main.yml index 2087ad167..77b219e87 100644 --- a/roles/nextcloud/tasks/main.yml +++ b/roles/nextcloud/tasks/main.yml @@ -10,7 +10,7 @@ - name: Get the nextcloud software get_url: url={{ nextcloud_dl_url }}/{{ nextcloud_src_file }} dest={{ downloads_dir }}/{{ nextcloud_src_file }} - when: not {{ use_cache }} and not {{ no_network }} + when: internet_available async: 900 poll: 15 tags: diff --git a/roles/osm/tasks/main.yml b/roles/osm/tasks/main.yml index 69692aa56..fb2b15952 100644 --- a/roles/osm/tasks/main.yml +++ b/roles/osm/tasks/main.yml @@ -8,8 +8,6 @@ - libapache2-mod-wsgi - libapache2-mod-xsendfile when: is_debuntu - tags: - - download - name: fix the pip bug (incompatible with requests) command: easy_install --upgrade pip @@ -26,14 +24,10 @@ - mod_wsgi - mod_xsendfile when: not is_debuntu - tags: - - download #- name: download latest setuptools # shell: pip install --download {{ pip_packages_dir }} ez_setup -# when: not {{ use_cache }} and not {{ no_network }} -# tags: -# - download2 +# when: internet_available # #- name: install setuptools from local download directory # pip: name=ez_setup @@ -50,9 +44,7 @@ pip: name=MarkupSafe extra_args="--download {{ pip_packages_dir }}" state=latest - when: not {{ use_cache }} and not {{ no_network }} - tags: - - download2 + when: internet_available - name: install Markupsafe from local download directory pip: name=MarkupSafe @@ -62,9 +54,7 @@ pip: name=pytz extra_args="--download {{ pip_packages_dir }}" state=latest - when: not {{ use_cache }} and not {{ no_network }} - tags: - - download2 + when: internet_available - name: install pytz from local download directory pip: name=pytz @@ -74,9 +64,7 @@ pip: name=Internet-in-a-Box state=latest extra_args="--download {{ pip_packages_dir }}" - when: not {{ use_cache }} and not {{ no_network }} - tags: - - download2 + when: internet_available - name: install IIAB from local download directory pip: name=Internet-in-a-Box @@ -93,9 +81,7 @@ version=2.6 state=present extra_args="--download {{ pip_packages_dir }}" - when: not {{ use_cache }} and not {{ no_network }} - tags: - - download2 + when: internet_available - name: install Whoosh 2.6 from local download directory pip: name=whoosh diff --git a/roles/owncloud/tasks/F18.yml b/roles/owncloud/tasks/F18.yml index 95f8655d2..ce0486feb 100644 --- a/roles/owncloud/tasks/F18.yml +++ b/roles/owncloud/tasks/F18.yml @@ -5,9 +5,7 @@ # but we use the tar file to get the latest version; really only benefits the xo4 on fedora 18 - name: Get the owncloud software get_url: url="{{ owncloud_dl_url }}"/{{ owncloud_src_file }} dest={{ downloads_dir }}/{{ owncloud_src_file }} - when: not {{ use_cache }} and not {{ no_network }} - tags: - - download2 + when: internet_available - name: Copy it to permanent location /opt unarchive: src={{ downloads_dir }}/{{ owncloud_src_file }} dest=/opt/ diff --git a/roles/owncloud/tasks/main.yml b/roles/owncloud/tasks/main.yml index 7c980993c..9b56a568d 100644 --- a/roles/owncloud/tasks/main.yml +++ b/roles/owncloud/tasks/main.yml @@ -16,8 +16,6 @@ with_items: - curl - owncloud - tags: - - download when: owncloud_page.stat.exists is defined and not owncloud_page.stat.exists - name: Remove owncloud package @@ -42,11 +40,9 @@ - name: Get the owncloud software get_url: url={{ iiab_download_url }}/{{ owncloud_src_file }} dest={{ downloads_dir }}/{{ owncloud_src_file }} - when: not {{ use_cache }} and not {{ no_network }} + when: internet_available async: 300 poll: 5 - tags: - - download2 - name: Copy it to permanent location /opt unarchive: src={{ downloads_dir }}/{{ owncloud_src_file }} diff --git a/roles/pathagar/tasks/main.yml b/roles/pathagar/tasks/main.yml index dd6ff6107..8dd8f51e3 100644 --- a/roles/pathagar/tasks/main.yml +++ b/roles/pathagar/tasks/main.yml @@ -9,8 +9,6 @@ - python-virtualenv - python-pip - python-psycopg2 - tags: - - download - name: Install pathagar pre requisites for debian package: name={{ item }} @@ -20,8 +18,6 @@ - libxml2-dev - libxslt-dev when: is_debuntu - tags: - - download - name: Install pathagar pre requisites not debian package: name={{ item }} @@ -31,8 +27,6 @@ - libxml2-devel - libxslt-devel when: not is_debuntu - tags: - - download - name: Create destination folder file: path={{ pathagar_src }} @@ -57,9 +51,7 @@ dest={{ pathagar_src }} update=yes version=master - when: not {{ use_cache }} and not {{ no_network }} and pathagar.stat.exists is defined and not pathagar.stat.exists - tags: - - download2 + when: internet_available and pathagar.stat.exists is defined and not pathagar.stat.exists - name: download pathagar requirements in a virtualenv pip: name={{ item }} @@ -70,9 +62,7 @@ - django-sendfile==0.3.6 - django-taggit==0.14 - lxml==3.4.4 - when: not {{ use_cache }} and not {{ no_network }} - tags: - - download2 + when: internet_available - name: Install pathagar requirements in a virtualenv pip: name={{ item }} diff --git a/roles/phpmyadmin/tasks/main.yml b/roles/phpmyadmin/tasks/main.yml index 891d25f24..fc7e6e317 100644 --- a/roles/phpmyadmin/tasks/main.yml +++ b/roles/phpmyadmin/tasks/main.yml @@ -1,8 +1,6 @@ - name: Get the phpmyadmin software get_url: url="{{ iiab_download_url }}/{{ phpMyAdmin }}" dest="{{ downloads_dir}}/phpMyAdmin.zip" - when: not {{ use_cache }} and not {{ no_network }} - tags: - - download2 + when: internet_available - name: Copy it to permanent location /opt unarchive: src={{ downloads_dir }}/phpMyAdmin.zip dest=/opt/ diff --git a/roles/schooltool/tasks/main.yml b/roles/schooltool/tasks/main.yml index 2980afd1f..f29f2c0f2 100644 --- a/roles/schooltool/tasks/main.yml +++ b/roles/schooltool/tasks/main.yml @@ -4,9 +4,7 @@ ports=7080:7080 state=present pull=missing - when: schooltool_install and docker_install and not {{ use_cache }} and not {{ no_network }} - tags: - - download2 + when: schooltool_install and docker_install and internet_available - name: Configure schooltool to run in docker container under systemd diff --git a/roles/sugar-stats/tasks/statistics-consolidation.yml b/roles/sugar-stats/tasks/statistics-consolidation.yml index 738704d58..6647a198e 100644 --- a/roles/sugar-stats/tasks/statistics-consolidation.yml +++ b/roles/sugar-stats/tasks/statistics-consolidation.yml @@ -1,15 +1,11 @@ - name: Install python-pip package package: name=python-pip state=present - tags: - - download - name: Download statistics-consolidation with pip pip: name=stats-consolidation version=2.1.2 extra_args="--download {{ pip_packages_dir }}" - when: not {{ use_cache }} and not {{ no_network }} - tags: - - download2 + when: internet_available - name: Install statistics-consolidation with pip pip: name=stats-consolidation version=2.1.2 @@ -22,8 +18,6 @@ - rrdtool-python - python-sqlalchemy - python-psycopg2 - tags: - - download - name: Enable postgresl access by md5 method lineinfile: backup=yes diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 711e5b4a2..6e955d6b8 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -16,7 +16,7 @@ with_items: - nodejs - npm - when: not {{ use_cache }} and not {{ no_network }} + when: internet_available tags: - download diff --git a/roles/teamviewer/tasks/install.yml b/roles/teamviewer/tasks/install.yml index da6e845df..9e8a6d325 100644 --- a/roles/teamviewer/tasks/install.yml +++ b/roles/teamviewer/tasks/install.yml @@ -1,38 +1,38 @@ # we need to install X11 and the xfce display manager - name: Install xfce group of packages shell: "yum groupinstall -y xfce" - when: xo_model == "none" and not {{ use_cache }} and not {{ no_network }} and ansible_distribution_version <= "20" + when: xo_model == "none" and internet_available and ansible_distribution_version <= "20" tags: - download - name: Install X11 group of packages shell: "yum groupinstall -y 'X Window system'" - when: xo_model == "none" and not {{ use_cache }} and not {{ no_network }} and ansible_distribution_version <= "20" + when: xo_model == "none" and internet_available and ansible_distribution_version <= "20" tags: - download - name: Install xfce group of packages shell: yum groupinstall -y "Xfce Desktop" --exclude fedora-release\* - when: xo_model == "none" and not {{ use_cache }} and not {{ no_network }} and ansible_distribution_version >= "21" + when: xo_model == "none" and internet_available and ansible_distribution_version >= "21" tags: - download - name: Install X Windows on CentOS shell: yum groupinstall -y "Server with GUI" - when: not {{ use_cache }} and not {{ no_network }} and ansible_distribution == "CentOS" + when: internet_available and ansible_distribution == "CentOS" tags: - download - name: Get the teamviewer software get_url: url="{{ teamviewer_url }}/{{ teamviewer_rpm_file }}" dest="{{ yum_packages_dir }}/{{ teamviewer_rpm_file }}" - when: not {{ use_cache }} and not {{ no_network }} + when: internet_available tags: - download # F22 has issues with yum localinstall exclude for now - name: Do the install of teamviewer, pulling in any required dependencies shell: "yum localinstall -y {{ yum_packages_dir }}/{{ teamviewer_rpm_file }}" - when: teamviewer_install and not {{ use_cache }} and not {{ no_network }} + when: teamviewer_install and internet_available and xo_model == "none" and ansible_distribution_version <= "21" - name: making local copy available diff --git a/roles/wordpress/tasks/install.yml b/roles/wordpress/tasks/install.yml index f6775aada..66f291dae 100644 --- a/roles/wordpress/tasks/install.yml +++ b/roles/wordpress/tasks/install.yml @@ -1,8 +1,6 @@ - name: Get the WordPress software get_url: url="{{ iiab_download_url }}/{{ wordpress_src }}" dest={{ downloads_dir}}/ - when: not {{ use_cache }} and not {{ no_network }} - tags: - - download2 + when: internet_available - name: Copy it to permanent location /library unarchive: src={{ downloads_dir}}/{{ wordpress_src }} dest=/library diff --git a/roles/xovis/tasks/main.yml b/roles/xovis/tasks/main.yml index f8c74cb19..bf31043c1 100644 --- a/roles/xovis/tasks/main.yml +++ b/roles/xovis/tasks/main.yml @@ -7,9 +7,7 @@ - python-pip - nodejs - npm - when: not {{ use_cache }} and not {{ no_network }} - tags: - - download + when: internet_available - name: Determine if xovis is already downloaded stat: path={{ downloadds_dir }}/xovis/xxx @@ -19,24 +17,18 @@ git: repo={{ xovis_repo_url }} dest={{ downloads_dir }}/xovis depth=1 - when: not {{ use_cache }} and not {{ no_network }} and xovis.stat.exists is defined and not xovis.stat.exists - tags: - - download2 + when: internet_available and xovis.stat.exists is defined and not xovis.stat.exists - name: download xovis python dependencies pip: requirements={{ downloads_dir }}/xovis/process_stats/requirements.txt extra_args="--download {{ pip_packages_dir }}" - when: not {{ use_cache }} and not {{ no_network }} - tags: - - download2 + when: internet_available - name: Install node.js package kanso to maintain couchdb npm: name=kanso global=yes path={{ downloads_dir }} - when: not {{ use_cache }} and not {{ no_network }} - tags: - - download2 + when: internet_available - name: move the xovis repo into place shell: "cp -rp {{ downloads_dir }}/xovis {{ xovis_root }}"