diff --git a/roles/1-prep/tasks/computed_vars.yml b/roles/1-prep/tasks/computed_vars.yml index 24b0e59b2..71c3b4383 100644 --- a/roles/1-prep/tasks/computed_vars.yml +++ b/roles/1-prep/tasks/computed_vars.yml @@ -8,17 +8,6 @@ - set_fact: xo_model: '{{ ansible_local["local_facts"]["xo_model"] }}' phplib_dir: '{{ ansible_local["local_facts"]["phplib_dir"] }}' - iiab_base_ver: '{{ ansible_local["local_facts"]["iiab_base_ver"] }}' - iiab_preload: '{{ ansible_local["local_facts"]["iiab_preload"] }}' - -- name: Defaulting iiab_base_ver - set_fact: - iiab_base_ver: 0 - when: iiab_base_ver == "" - -- name: Defaulting iiab_prepped - set_fact: - iiab_prepped: False - name: Set exFAT enabled for XOs set_fact: @@ -39,10 +28,6 @@ value: '{{ ansible_date_time["iso8601"] }}' - option: 'runtime_php' value: '{{ phplib_dir }}' - - option: 'runtime_preload' - value: '{{ iiab_preload }}' - - option: 'runtime_base_ver' - value: '{{ iiab_base_ver }}' - option: 'kernel' value: '{{ ansible_kernel }}' - option: 'memory_mb' @@ -114,6 +99,7 @@ mysql_service: mysql when: is_debuntu +# PLATFORM variables - name: Fedora 20 set_fact: is_F20: True diff --git a/roles/1-prep/tasks/prep.yml b/roles/1-prep/tasks/prep.yml index 833a51295..989b5bc3c 100644 --- a/roles/1-prep/tasks/prep.yml +++ b/roles/1-prep/tasks/prep.yml @@ -51,21 +51,10 @@ mode=0750 state=directory -- name: local facts script - template: src=local_facts.fact.j2 - dest=/etc/ansible/facts.d/local_facts.fact - owner=root - group=root - mode=0700 - -- name: re-read facts - setup: filter=ansible_local - -- name: Set XO model and preload +- name: Set XO model set_fact: phplib_dir: '{{ ansible_local["local_facts"]["phplib_dir"] }}' xo_model: '{{ ansible_local["local_facts"]["xo_model"] }}' - iiab_preload: '{{ ansible_local["local_facts"]["iiab_preload"] }}' - name: Install script to fully initialize network config, and/or collect data # calling iiab-network-reset w/ snapshot name, stores info, but aborts reset diff --git a/roles/2-common/tasks/packages.yml b/roles/2-common/tasks/packages.yml index d916726af..de2269746 100644 --- a/roles/2-common/tasks/packages.yml +++ b/roles/2-common/tasks/packages.yml @@ -38,7 +38,15 @@ - xml-common when: is_redhat -- name: Install yum packages for Debian +- name: Download usbmount -- not in debian-9 + command: wget {{ iiab_download_url }}/usbmount_0.0.14.1_all.deb -P {{ downloads_dir }} + when: is_debian and ansible_distribution_major_version == "9" + +- name: Install usbmount for debian-9 + command: apt install -y {{ downloads_dir }}/usbmount_0.0.14.1_all.deb + when: is_debian and ansible_distribution_major_version == "9" + +- name: Install packages for Debian package: name={{ item }} state=present with_items: diff --git a/roles/httpd/tasks/main.yml b/roles/httpd/tasks/main.yml index cb08075fa..584056eb0 100644 --- a/roles/httpd/tasks/main.yml +++ b/roles/httpd/tasks/main.yml @@ -3,13 +3,21 @@ state=present with_items: - apache2 - - php5 - - php5-curl - - php5-sqlite + - php{{ php_version }} + - php{{ php_version }}-curl +# - php{{ php_version }}-sqlite tags: - download when: is_debian +- name: Debian changed sqlite name + package: name=php{{ php_version }}-sqlite + when: is_debian and ansible_distribution_major_version == "8" + +- name: Debian changed sqlite name + package: name=php{{ php_version }}-sqlite3 + when: ansible_local.local_facts.os_ver == "debian-9" + - name: Install httpd required packages package: name={{ item }} state=present diff --git a/roles/monit/tasks/main.yml b/roles/monit/tasks/main.yml index f14d945e7..3fb6690b0 100644 --- a/roles/monit/tasks/main.yml +++ b/roles/monit/tasks/main.yml @@ -4,10 +4,10 @@ tags: - download -- name: Install chkconfig package +- name: Install chkconfig package -- not in debian 9 package: name=chkconfig state=present - when: is_debian + when: is_debian and ansible_distribution_major_version == "8" tags: - download @@ -36,7 +36,7 @@ #TODO: create systemd script - name: Enable monit service command: chkconfig monit on - when: is_debian + when: is_debian and ansible_local.local_facts.os_ver == "debian-8" #- name: Restart monit service # command: service monit restart diff --git a/roles/moodle/tasks/main.yml b/roles/moodle/tasks/main.yml index 35b6ddfaf..6d15478cc 100644 --- a/roles/moodle/tasks/main.yml +++ b/roles/moodle/tasks/main.yml @@ -14,9 +14,9 @@ - python-psycopg2 - php{{ php_version }}-pgsql - php{{ php_version }}-curl -# - php-zip debian has php-pclzip + - php{{ php_version }}-zip - php{{ php_version }}-gd -# - php-mbstring --perhaps debian libapache2-mod-php + - php{{ php_version }}-mbstring when: is_debuntu - name: Determine if moodle is already downloaded diff --git a/roles/mysql/tasks/main.yml b/roles/mysql/tasks/main.yml index 9b9600a7e..ccd145d5a 100644 --- a/roles/mysql/tasks/main.yml +++ b/roles/mysql/tasks/main.yml @@ -12,7 +12,7 @@ - php{{ php_version }}-imap - php{{ php_version }}-ldap - php{{ php_version }}-odbc - - php-xml-parser + - php{{ php_version }}-xml - php{{ php_version }}-xmlrpc when: is_debuntu tags: diff --git a/roles/network/tasks/ifcfg_mods.yml b/roles/network/tasks/ifcfg_mods.yml index 35f6f32cc..8b5fa01a1 100644 --- a/roles/network/tasks/ifcfg_mods.yml +++ b/roles/network/tasks/ifcfg_mods.yml @@ -28,7 +28,7 @@ shell: nmcli con delete id iiab-LAN ignore_errors: True changed_when: False - when: iiab_prepped and (num_lan_interfaces != "0" or iiab_wireless_lan_iface != "none") + when: (num_lan_interfaces != "0" or iiab_wireless_lan_iface != "none") ## vars/ users should set user_wan_iface to avoid messy redetect - include: redetect.yml diff --git a/roles/network/tasks/main.yml b/roles/network/tasks/main.yml index 743b3fea8..a305e6211 100644 --- a/roles/network/tasks/main.yml +++ b/roles/network/tasks/main.yml @@ -34,10 +34,6 @@ - network - domain -- name: Domain name did not change setting iiab_prepped - set_fact: - iiab_prepped: True - when: not domainname.changed and iiab_base_ver == gui_version ##### Start static ip address info for first run ##### #- include: static.yml @@ -49,31 +45,26 @@ - network - include: named.yml -# when: not iiab_prepped tags: - named - network - include: dhcpd.yml -# when: not iiab_prepped tags: - dhcpd - network - include: squid.yml -# when: not iiab_prepped tags: - squid - network - include: wondershaper.yml - when: not iiab_prepped tags: - wondershaper - network - include: iptables.yml -# when: not iiab_prepped tags: - iptables - network diff --git a/roles/nextcloud/tasks/main.yml b/roles/nextcloud/tasks/main.yml index 77b219e87..ac757506d 100644 --- a/roles/nextcloud/tasks/main.yml +++ b/roles/nextcloud/tasks/main.yml @@ -19,7 +19,7 @@ - name: ubuntu and debian treat names differently package: name={{ item }} state=present with_items: - - libapache2-mod-php5 + - libapache2-mod-php{{ php_version }} when: is_debian - name: ubuntu and debian treat names differently diff --git a/roles/postgresql/tasks/main.yml b/roles/postgresql/tasks/main.yml index 8f6670e74..ac125b67a 100644 --- a/roles/postgresql/tasks/main.yml +++ b/roles/postgresql/tasks/main.yml @@ -42,7 +42,7 @@ when: is_debuntu - name: Initialize the postgres db - command: su - postgres -c "/usr/lib/postgresql/9.4/bin/initdb -E 'UTF-8' --locale={{ postgresql_locale }} -D /library/pgsql-iiab" + command: su - postgres -c "/usr/lib/postgresql/{{ postgresql_version }}/bin/initdb -E 'UTF-8' --locale={{ postgresql_locale }} -D /library/pgsql-iiab" creates=/library/pgsql-iiab/pg_hba.conf when: is_debian diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 6e955d6b8..b28193b82 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -11,14 +11,23 @@ state=link - name: Install sugarizer required packages - package: name={{ item }} + package: name=nodejs state=present - with_items: - - nodejs - - npm +# - npm when: internet_available - tags: - - download + +- name: Install npm non debian + package: name=npm + state=present + when: internet_available and not is_debian + +- name: Install npm on debian -- set up apt sources + shell: curl -sL https://deb.nodesource.com/setup_6.x | bash - + when: internet_available and is_debian + +- name: Actually get it installed + command: apt install -y npm + when: internet_available and is_debian - name: Create systemd files and copy our ini file template: src={{ item.src }} diff --git a/vars/debian-9.yml b/vars/debian-9.yml new file mode 100644 index 000000000..6f412ac3e --- /dev/null +++ b/vars/debian-9.yml @@ -0,0 +1,24 @@ +is_debian: True +is_debuntu: True +dns_service: bind9 +dns_user: bind +proxy: squid +proxy_user: proxy +apache_service: apache2 +apache_config_dir: apache2/sites-available +apache_user: www-data +apache_log_dir: /var/log/apache2 +smb_service: smbd +nmb_service: nmbd +kalite_program: /usr/local/bin/kalite +systemctl_program: /bin/systemctl +mysql_service: mysql +apache_log: /var/log/apache2/access.log +# cups lp module not available in raspbian, causes systemd-modueles-load to fail +# which in turn cause netfilter-persistent to fail, which is essential +cups_install: True +sshd_service: ssh +php_version: 7.0 +postgresql_version: 9.6 + +