1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00
* do a special download and install of usbmount

* misspelled iiab_download_url

* misspell downloads_dir

* diable php-sqlite

* php version issues

* fixes transferred from recognize branch

* local_fact moved

* remove preload

* remove preload

* spell ansible

* debian9 sqlite3

* package needs name

* remove prepped

* use apt ratheer than ansible package for npm

* monit disable chkconfig

* moodle needs php-zip and php-mbstring

* debian9 -> debian-9

* returen to os_ver nomenclature for OS.yml
This commit is contained in:
georgejhunt 2017-07-04 13:27:44 -07:00 committed by GitHub
parent 842e617e42
commit 29b0b50885
13 changed files with 70 additions and 55 deletions

View file

@ -8,17 +8,6 @@
- set_fact: - set_fact:
xo_model: '{{ ansible_local["local_facts"]["xo_model"] }}' xo_model: '{{ ansible_local["local_facts"]["xo_model"] }}'
phplib_dir: '{{ ansible_local["local_facts"]["phplib_dir"] }}' 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 - name: Set exFAT enabled for XOs
set_fact: set_fact:
@ -39,10 +28,6 @@
value: '{{ ansible_date_time["iso8601"] }}' value: '{{ ansible_date_time["iso8601"] }}'
- option: 'runtime_php' - option: 'runtime_php'
value: '{{ phplib_dir }}' value: '{{ phplib_dir }}'
- option: 'runtime_preload'
value: '{{ iiab_preload }}'
- option: 'runtime_base_ver'
value: '{{ iiab_base_ver }}'
- option: 'kernel' - option: 'kernel'
value: '{{ ansible_kernel }}' value: '{{ ansible_kernel }}'
- option: 'memory_mb' - option: 'memory_mb'
@ -114,6 +99,7 @@
mysql_service: mysql mysql_service: mysql
when: is_debuntu when: is_debuntu
# PLATFORM variables
- name: Fedora 20 - name: Fedora 20
set_fact: set_fact:
is_F20: True is_F20: True

View file

@ -51,21 +51,10 @@
mode=0750 mode=0750
state=directory state=directory
- name: local facts script - name: Set XO model
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
set_fact: set_fact:
phplib_dir: '{{ ansible_local["local_facts"]["phplib_dir"] }}' phplib_dir: '{{ ansible_local["local_facts"]["phplib_dir"] }}'
xo_model: '{{ ansible_local["local_facts"]["xo_model"] }}' 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 - name: Install script to fully initialize network config, and/or collect data
# calling iiab-network-reset w/ snapshot name, stores info, but aborts reset # calling iiab-network-reset w/ snapshot name, stores info, but aborts reset

View file

@ -38,7 +38,15 @@
- xml-common - xml-common
when: is_redhat 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 }} package: name={{ item }}
state=present state=present
with_items: with_items:

View file

@ -3,13 +3,21 @@
state=present state=present
with_items: with_items:
- apache2 - apache2
- php5 - php{{ php_version }}
- php5-curl - php{{ php_version }}-curl
- php5-sqlite # - php{{ php_version }}-sqlite
tags: tags:
- download - download
when: is_debian 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 - name: Install httpd required packages
package: name={{ item }} package: name={{ item }}
state=present state=present

View file

@ -4,10 +4,10 @@
tags: tags:
- download - download
- name: Install chkconfig package - name: Install chkconfig package -- not in debian 9
package: name=chkconfig package: name=chkconfig
state=present state=present
when: is_debian when: is_debian and ansible_distribution_major_version == "8"
tags: tags:
- download - download
@ -36,7 +36,7 @@
#TODO: create systemd script #TODO: create systemd script
- name: Enable monit service - name: Enable monit service
command: chkconfig monit on command: chkconfig monit on
when: is_debian when: is_debian and ansible_local.local_facts.os_ver == "debian-8"
#- name: Restart monit service #- name: Restart monit service
# command: service monit restart # command: service monit restart

View file

@ -14,9 +14,9 @@
- python-psycopg2 - python-psycopg2
- php{{ php_version }}-pgsql - php{{ php_version }}-pgsql
- php{{ php_version }}-curl - php{{ php_version }}-curl
# - php-zip debian has php-pclzip - php{{ php_version }}-zip
- php{{ php_version }}-gd - php{{ php_version }}-gd
# - php-mbstring --perhaps debian libapache2-mod-php - php{{ php_version }}-mbstring
when: is_debuntu when: is_debuntu
- name: Determine if moodle is already downloaded - name: Determine if moodle is already downloaded

View file

@ -12,7 +12,7 @@
- php{{ php_version }}-imap - php{{ php_version }}-imap
- php{{ php_version }}-ldap - php{{ php_version }}-ldap
- php{{ php_version }}-odbc - php{{ php_version }}-odbc
- php-xml-parser - php{{ php_version }}-xml
- php{{ php_version }}-xmlrpc - php{{ php_version }}-xmlrpc
when: is_debuntu when: is_debuntu
tags: tags:

View file

@ -28,7 +28,7 @@
shell: nmcli con delete id iiab-LAN shell: nmcli con delete id iiab-LAN
ignore_errors: True ignore_errors: True
changed_when: False 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 ## vars/ users should set user_wan_iface to avoid messy redetect
- include: redetect.yml - include: redetect.yml

View file

@ -34,10 +34,6 @@
- network - network
- domain - 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 ##### ##### Start static ip address info for first run #####
#- include: static.yml #- include: static.yml
@ -49,31 +45,26 @@
- network - network
- include: named.yml - include: named.yml
# when: not iiab_prepped
tags: tags:
- named - named
- network - network
- include: dhcpd.yml - include: dhcpd.yml
# when: not iiab_prepped
tags: tags:
- dhcpd - dhcpd
- network - network
- include: squid.yml - include: squid.yml
# when: not iiab_prepped
tags: tags:
- squid - squid
- network - network
- include: wondershaper.yml - include: wondershaper.yml
when: not iiab_prepped
tags: tags:
- wondershaper - wondershaper
- network - network
- include: iptables.yml - include: iptables.yml
# when: not iiab_prepped
tags: tags:
- iptables - iptables
- network - network

View file

@ -19,7 +19,7 @@
- name: ubuntu and debian treat names differently - name: ubuntu and debian treat names differently
package: name={{ item }} state=present package: name={{ item }} state=present
with_items: with_items:
- libapache2-mod-php5 - libapache2-mod-php{{ php_version }}
when: is_debian when: is_debian
- name: ubuntu and debian treat names differently - name: ubuntu and debian treat names differently

View file

@ -42,7 +42,7 @@
when: is_debuntu when: is_debuntu
- name: Initialize the postgres db - 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 creates=/library/pgsql-iiab/pg_hba.conf
when: is_debian when: is_debian

View file

@ -11,14 +11,23 @@
state=link state=link
- name: Install sugarizer required packages - name: Install sugarizer required packages
package: name={{ item }} package: name=nodejs
state=present state=present
with_items: # - npm
- nodejs
- npm
when: internet_available 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 - name: Create systemd files and copy our ini file
template: src={{ item.src }} template: src={{ item.src }}

24
vars/debian-9.yml Normal file
View file

@ -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