1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 11:42:08 +00:00

Merge pull request #177 from iiab/master

sync from iiab/iiab
This commit is contained in:
A Holt 2018-11-02 01:20:43 -04:00 committed by GitHub
commit 1518be298b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
54 changed files with 546 additions and 560 deletions

View file

@ -3,20 +3,20 @@
path: /usr/libexec/iiab-startup.sh path: /usr/libexec/iiab-startup.sh
register: startup_script register: startup_script
- name: Copy template script to /usr/libexec/iiab-startup.sh - name: If not, install /usr/libexec/iiab-startup.sh from template
template: template:
src: iiab-startup.sh src: iiab-startup.sh
dest: /usr/libexec/ dest: /usr/libexec/
mode: 0755 mode: 0755
when: not startup_script.stat.exists when: not startup_script.stat.exists
- name: Copy iiab-startup.service to {{ systemd_location }} - name: Install {{ systemd_location }}/iiab-startup.service from template
template: template:
src: iiab-startup.service src: iiab-startup.service
dest: "{{ systemd_location }}" dest: "{{ systemd_location }}"
when: not startup_script.stat.exists when: not startup_script.stat.exists
- name: Enable & restart the systemd service after daemon-reload - name: Enable & restart systemd service (iiab-startup) after daemon-reload
# shell: systemctl daemon-reload # shell: systemctl daemon-reload
# shell: systemctl restart iiab-startup.service # shell: systemctl restart iiab-startup.service
# shell: systemctl enable iiab-startup.service # shell: systemctl enable iiab-startup.service

View file

@ -4,12 +4,13 @@
enabled: no enabled: no
when: not is_debuntu when: not is_debuntu
- name: Use larger hammer to disable firewalld -- 2 symbolic links involved (OS's other than debuntu) # Likely no longer nec as of 2019
shell: "systemctl disable firewalld.service" - name: Use larger hammer -- systemctl disable firewalld -- 2 symbolic links involved (OS's other than debuntu)
shell: systemctl disable firewalld.service
when: not is_debuntu when: not is_debuntu
- name: Mask firewalld service (OS's other than debuntu) - name: Mask firewalld service (OS's other than debuntu)
shell: 'systemctl mask firewalld' shell: systemctl mask firewalld
ignore_errors: yes ignore_errors: yes
when: not installing and not is_debuntu when: not installing and not is_debuntu
@ -20,17 +21,17 @@
ignore_errors: yes ignore_errors: yes
when: not installing and not is_debuntu when: not installing and not is_debuntu
- name: Remove iptables.service file from /etc - name: Remove /etc/systemd/system/iptables.service
file: file:
path: /etc/systemd/system/iptables.service path: /etc/systemd/system/iptables.service
state: absent state: absent
- name: Remove iptables-xs.service file from /etc #- name: Remove iptables-xs.service file from /etc
file: # file:
path: /etc/systemd/system/iptables-xs.service # path: /etc/systemd/system/iptables-xs.service
state: absent # state: absent
- name: Install iptables service package (debuntu) - name: Install package iptables-persistent (debuntu)
package: package:
name: iptables-persistent name: iptables-persistent
state: present state: present
@ -38,7 +39,7 @@
tags: tags:
- download - download
- name: Install iptables service package (OS's other than debuntu) - name: Install package iptables-services (OS's other than debuntu)
package: package:
name: iptables-services name: iptables-services
state: present state: present
@ -46,17 +47,15 @@
tags: tags:
- download - download
- name: Install iptables services - name: Install /etc/sysconfig/iptables-config from template
template: template:
src: "{{ item.0 }}" src: iptables-config
dest: "{{ item.1 }}" dest: /etc/sysconfig/iptables-config
owner: root owner: root
group: root group: root
mode: "{{ item.2 }}" mode: 0644
with_items:
- { 0: 'iptables-config', 1: '/etc/sysconfig/iptables-config', 2: '0644' }
- name: Install Debian config (debuntu) - name: Install /etc/network/if-pre-up.d/iptables from template (debuntu)
template: template:
src: iptables src: iptables
dest: /etc/network/if-pre-up.d/iptables dest: /etc/network/if-pre-up.d/iptables

View file

@ -72,7 +72,7 @@
value: 1 value: 1
state: present state: present
- name: Install custom profile file - name: Install custom /etc/profile.d/zzz_iiab.sh from template
template: template:
dest: /etc/profile.d/zzz_iiab.sh dest: /etc/profile.d/zzz_iiab.sh
src: zzz_iiab.sh src: zzz_iiab.sh

View file

@ -1,72 +1,72 @@
- name: Install yum/dnf packages (redhat) - name: "Install 10 yum/dnf packages: avahi, avahi-tools, createrepo, linux-firmware, nss-mdns, openssl, syslog, wpa_supplicant, xml-common, yum-utils (redhat)"
package: package:
name: name:
- yum-utils
- createrepo
- wpa_supplicant
- linux-firmware
- syslog
- xml-common
- nss-mdns
- avahi - avahi
- avahi-tools - avahi-tools
- createrepo
- linux-firmware
- nss-mdns
- openssl # FC 18 does not supply, but pear requires
- syslog
- wpa_supplicant
- xml-common
- yum-utils
state: present state: present
when: is_redhat when: is_redhat
- name: Download & install usbmount, missing from Debian Stretch (debian-9) - name: Install {{ iiab_download_url }}/usbmount_0.0.14.1_all.deb, missing from Debian Stretch (debian-9)
apt: apt:
deb: "{{ iiab_download_url }}/usbmount_0.0.14.1_all.deb" deb: "{{ iiab_download_url }}/usbmount_0.0.14.1_all.deb"
#timeout: "{{ download_timeout }}" # Ansible's apt module doesn't support timeout parameter; that's ok as usbmount_0.0.14.1_all.deb is only 10KB #timeout: "{{ download_timeout }}" # Ansible's apt module doesn't support timeout parameter; that's ok as usbmount_0.0.14.1_all.deb is only 10KB
when: internet_available and is_debian_9 when: internet_available and is_debian_9
- name: Install packages (debuntu) - name: "Install 7 deb/apt packages: avahi-daemon, avahi-discover, exfat-fuse, exfat-utils, inetutils-syslogd, libnss-mdns, wpasupplicant (debuntu)"
package: package:
name: name:
- inetutils-syslogd
- wpasupplicant
- libnss-mdns
- avahi-daemon - avahi-daemon
- avahi-discover - avahi-discover
- exfat-fuse - exfat-fuse
- exfat-utils - exfat-utils
- inetutils-syslogd
- libnss-mdns
- wpasupplicant
state: present state: present
when: is_debuntu when: is_debuntu
- name: Install common packages - name: "Install 23 common packages: acpid, bridge-utils, bzip2, curl, gawk, hostapd, htop, i2c-tools, logrotate, make, mlocate, netmask, net-tools, ntfs-3g, openssh-server, pandoc, rsync, sudo, tar, unzip, usbmount, usbutils, wget"
package: package:
name: name:
- acpid - acpid
- mlocate - bridge-utils
- rsync - bzip2
- htop - curl
#- etckeeper # "nobody is really using etckeeper and it's bloating the filesystem every time apt runs" per @jvonau at https://github.com/iiab/iiab/issues/1146 #- etckeeper # "nobody is really using etckeeper and it's bloating the filesystem every time apt runs" per @jvonau at https://github.com/iiab/iiab/issues/1146
- python-passlib - gawk
- usbmount - hostapd
- net-tools - htop
- openssh-server - i2c-tools
- sudo
- logrotate - logrotate
#- lynx # already installed by 1-prep's roles/iiab-admin/tasks/access.yml
- make - make
- mlocate
- netmask
- net-tools
- ntfs-3g
- openssh-server
- pandoc
- rsync
- sudo
- tar - tar
- unzip - unzip
- bzip2 - usbmount
- i2c-tools
- bridge-utils
- netmask
- usbutils - usbutils
- hostapd
- wget - wget
- openssl # FC 18 does not supply, but pear requires
- gawk
- curl
- pandoc
- lynx # already installed by 1-prep's roles/iiab-admin/tasks/access.yml
- ntfs-3g
state: present state: present
- name: Install common Python packages {python-pip, python-setuptools, python-virtualenv} - name: "Install 4 common Python packages: python-passlib, python-pip, python-setuptools, python-virtualenv"
package: package:
name: name:
- python-passlib
- python-pip - python-pip
- python-setuptools - python-setuptools
- python-virtualenv - python-virtualenv

View file

@ -15,8 +15,8 @@
# has no "when: XXXXX_install" flag # has no "when: XXXXX_install" flag
tags: base, mysql tags: base, mysql
- name: Restart httpd - name: Restart Apache systemd service ({{ apache_service }})
service: systemd:
name: "{{ apache_service }}" name: "{{ apache_service }}"
state: restarted state: restarted
when: not installing when: not installing

View file

@ -3,22 +3,22 @@
- name: ...IS BEGINNING ================================== - name: ...IS BEGINNING ==================================
command: echo command: echo
- name: Installing dnsmasq - name: Install dnsmasq
include_tasks: roles/network/tasks/dnsmasq.yml include_tasks: roles/network/tasks/dnsmasq.yml
when: dnsmasq_install when: dnsmasq_install
tags: base, domain, dnsmasq, network tags: base, domain, dnsmasq, network
- name: Installing named - name: Install named / BIND
include_tasks: roles/network/tasks/named.yml include_tasks: roles/network/tasks/named.yml
when: named_install when: named_install
tags: base, named, network, domain tags: base, named, network, domain
- name: Installing dhcpd - name: Install dhcpd
include_tasks: roles/network/tasks/dhcpd.yml include_tasks: roles/network/tasks/dhcpd.yml
when: dhcpd_install when: dhcpd_install
tags: base, dhcpd, network, domain tags: base, dhcpd, network, domain
- name: Installing Squid - name: Install Squid (and DansGuardian if dansguardian_install)
include_tasks: roles/network/tasks/squid.yml include_tasks: roles/network/tasks/squid.yml
when: squid_install when: squid_install
tags: base, squid, network, domain tags: base, squid, network, domain

View file

@ -116,11 +116,12 @@
enabled=yes enabled=yes
state=restarted state=restarted
- name: add xs-activity-server to service list - name: Add 'activity-server' variable values to {{ iiab_ini_file }}
ini_file: dest='{{ iiab_ini_file }}' ini_file:
section=activity-server path: "{{ iiab_ini_file }}"
option='{{ item.option }}' section: activity-server
value='{{ item.value }}' option: "{{ item.option }}"
value: "{{ item.value }}"
with_items: with_items:
- option: name - option: name
value: "Activity Server" value: "Activity Server"

View file

@ -47,11 +47,12 @@
state=restarted state=restarted
when: ajenti_enabled when: ajenti_enabled
- name: Add ajenti to service list - name: Add 'ajenti' variable values to {{ iiab_ini_file }}
ini_file: dest='{{ iiab_ini_file }}' ini_file:
section=ajenti path: "{{ iiab_ini_file }}"
option='{{ item.option }}' section: ajenti
value='{{ item.value }}' option: "{{ item.option }}"
value: "{{ item.value }}"
with_items: with_items:
- option: name - option: name
value: ajenti value: ajenti

View file

@ -50,18 +50,19 @@
enabled=yes enabled=yes
when: authserver_enabled when: authserver_enabled
- name: add xs-authserver to service list - name: Add 'authserver' variable values to {{ iiab_ini_file }}
ini_file: dest='{{ iiab_ini_file }}' ini_file:
section=xs-authserver path: "{{ iiab_ini_file }}"
option='{{ item.option }}' section: authserver
value='{{ item.value }}' option: "{{ item.option }}"
value: "{{ item.value }}"
with_items: with_items:
- option: name - option: name
value: XS-authserver value: XS-authserver
- option: description - option: description
value: '"xs-authserver implements a seamless web authentication service value: '"authserver (xs-authserver) implements a seamless web authentication
using XO laptop registration capabilities. It is heavily inspired service using XO laptop registration capabilities. It is heavily
by the Moodle OLPC-XS authentication plugin"' inspired by the Moodle OLPC-XS authentication plugin"'
- option: port - option: port
value: 5000 value: 5000
- option: path - option: path

View file

@ -1,4 +1,4 @@
- name: Install packages {awstats, pwauth, openssl} - name: 'Install 3 packages: awstats, openssl, pwauth'
package: package:
name: name:
- awstats - awstats
@ -8,7 +8,7 @@
tags: tags:
- download - download
- name: Install packages libapache2-mod-authnz-external and apache2-utils (debuntu) - name: 'Install 2 packages: apache2-utils, libapache2-mod-authnz-external (debuntu)'
package: package:
name: name:
- libapache2-mod-authnz-external - libapache2-mod-authnz-external
@ -22,7 +22,7 @@
command: a2enmod cgi command: a2enmod cgi
when: is_debuntu when: is_debuntu
- name: Create directory for AWStats to use as intermediate summary storage - name: 'Mandate {{ apache_user }}:{{ apache_user }} perm 0750 dirs: {{ awstats_data_dir }} (intermediate summary storage) & {{ apache_log_dir }}' # /library/awstats & /var/log/apache2 typically
file: file:
path: "{{ item }}" path: "{{ item }}"
mode: 0750 mode: 0750

View file

@ -1,9 +1,9 @@
- include_tasks: install.yml - include_tasks: install.yml
when: awstats_install when: awstats_install
- name: Add 'awstats' to list of services at {{ iiab_ini_file }} - name: Add 'awstats' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"
section: awstats section: awstats
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"

View file

@ -1,4 +1,4 @@
- name: Create Calibre-Web folders to store data and configuration files - name: Create 3 Calibre-Web folders to store data and configuration files
file: file:
path: "{{ item }}" path: "{{ item }}"
owner: "{{ calibreweb_user }}" owner: "{{ calibreweb_user }}"
@ -84,7 +84,7 @@
when: not metadatadb.stat.exists when: not metadatadb.stat.exists
#when: calibreweb_provision #when: calibreweb_provision
- name: Enable and restart 'calibre-web' service - name: Enable and restart 'calibre-web' systemd service
systemd: systemd:
name: calibre-web name: calibre-web
daemon_reload: yes daemon_reload: yes
@ -101,7 +101,7 @@
# command: apachectl -k graceful # command: apachectl -k graceful
# when: calibreweb_enabled # when: calibreweb_enabled
- name: Disable 'calibre-web' service - name: Disable 'calibre-web' systemd service
systemd: systemd:
name: calibre-web name: calibre-web
daemon_reload: yes daemon_reload: yes
@ -117,14 +117,14 @@
# command: apachectl -k graceful # command: apachectl -k graceful
# when: not calibreweb_enabled # when: not calibreweb_enabled
- name: Restart Apache - name: Restart Apache service {{ apache_service }}
systemd: systemd:
name: "{{ apache_service }}" # httpd or apache2 name: "{{ apache_service }}" # httpd or apache2
state: restarted state: restarted
- name: Add 'calibre-web' to list of services at {{ iiab_ini_file }} - name: Add 'calibre-web' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"
section: calibre-web section: calibre-web
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"

View file

@ -1,6 +1,6 @@
# 1. INSTALL THE LATEST CALIBRE 3.X+ (calibre, calibredb, calibre-server etc) ON ALL OS'S # 1. INSTALL THE LATEST CALIBRE 3.X+ (calibre, calibredb, calibre-server etc) ON ALL OS'S
- name: Check if /usr/bin/calibre exists - name: Does /usr/bin/calibre exist?
stat: stat:
path: "/usr/bin/calibre" path: "/usr/bin/calibre"
register: calib_executable register: calib_executable
@ -39,7 +39,7 @@
group: root group: root
mode: "{{ item.mode }}" mode: "{{ item.mode }}"
backup: no backup: no
# register: calibre_config #register: calibre_config
with_items: with_items:
- { src: 'calibre-serve.service.j2', dest: '/etc/systemd/system/calibre-serve.service', mode: '0644'} - { src: 'calibre-serve.service.j2', dest: '/etc/systemd/system/calibre-serve.service', mode: '0644'}
- { src: 'calibre.conf', dest: '/etc/{{ apache_config_dir }}', mode: '0644'} - { src: 'calibre.conf', dest: '/etc/{{ apache_config_dir }}', mode: '0644'}
@ -49,7 +49,7 @@
systemd: systemd:
daemon_reload: yes daemon_reload: yes
when: (not calib_executable.stat.exists) when: (not calib_executable.stat.exists)
# when: calibre_config.changed #when: calibre_config.changed
# 2. STOP CALIBRE SERVICE IF IT EXISTS (REQUIRED FOR DB ACTIVITY...AND IF not calibre_enabled) # 2. STOP CALIBRE SERVICE IF IT EXISTS (REQUIRED FOR DB ACTIVITY...AND IF not calibre_enabled)
@ -59,14 +59,13 @@
# register: calibre_svc # register: calibre_svc
- name: Stop Calibre service -- calibre-server by Kovid Goyal - name: Stop Calibre service -- calibre-server by Kovid Goyal
# systemd: systemd:
service:
name: calibre-serve name: calibre-serve
state: stopped state: stopped
#enabled: no #enabled: no
# register: command_result # gist.github.com/tyrells/0a79681de339237cb04c #register: command_result # gist.github.com/tyrells/0a79681de339237cb04c
# failed_when: false # Never Fail during "systemctl stop calibre-serve" (even if service doesn't exist!) #failed_when: false # Never Fail during "systemctl stop calibre-serve" (even if service doesn't exist!)
# when: calibre_svc.stat.exists #when: calibre_svc.stat.exists
# 3. CREATE USER DATABASE # 3. CREATE USER DATABASE
@ -87,7 +86,7 @@
# 4. CREATE CONTENT DATABASE WITH A SAMPLE BOOK (REQUIRED AS OF CALIBRE 3.x) # 4. CREATE CONTENT DATABASE WITH A SAMPLE BOOK (REQUIRED AS OF CALIBRE 3.x)
- name: Check if /library/calibre/metadata.db exists - name: Does /library/calibre/metadata.db exist?
stat: stat:
path: "{{ calibre_dbpath }}/metadata.db" path: "{{ calibre_dbpath }}/metadata.db"
register: calibre_db register: calibre_db
@ -104,20 +103,20 @@
# https://github.com/iiab/iiab/tree/master/roles/calibre-web/templates/calibre-web.conf.j2 # https://github.com/iiab/iiab/tree/master/roles/calibre-web/templates/calibre-web.conf.j2
# (anyway this works great for calibre-web, allowing http://box/books # (anyway this works great for calibre-web, allowing http://box/books
# to work even better than http://box:8083 when box == 192.168.0.x !) # to work even better than http://box:8083 when box == 192.168.0.x !)
- name: Create calibre.conf link for UNTESTED http://box/calibre etc (debuntu) - name: Create symlink calibre.conf from sites-enabled to sites-available, for UNTESTED http://box/calibre etc (debuntu)
file: file:
src: /etc/apache2/sites-available/calibre.conf src: /etc/apache2/sites-available/calibre.conf
dest: /etc/apache2/sites-enabled/calibre.conf dest: /etc/apache2/sites-enabled/calibre.conf
state: link state: link
when: calibre_enabled and is_debuntu when: calibre_enabled and is_debuntu
- name: Remove calibre.conf link if disabled (debuntu) - name: Remove symlink /etc/apache2/sites-enabled/calibre.conf (debuntu)
file: file:
dest: /etc/apache2/sites-enabled/calibre.conf dest: /etc/apache2/sites-enabled/calibre.conf
state: absent state: absent
when: (not calibre_enabled) and is_debuntu when: (not calibre_enabled) and is_debuntu
- name: Enable Calibre service -- runs calibre-server by Kovid Goyal - name: Enable & Start Calibre service -- runs calibre-server by Kovid Goyal
service: service:
name: calibre-serve name: calibre-serve
enabled: yes enabled: yes
@ -126,14 +125,14 @@
#async: 900 #async: 900
#poll: 5 #poll: 5
- name: Forcing apache to reread configs - name: Reload Apache
service: systemd:
name: "{{ apache_service }}" name: "{{ apache_service }}"
state: reloaded state: reloaded
- name: Add 'calibre' to list of services at {{ iiab_ini_file }} - name: Add 'calibre' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"
section: calibre section: calibre
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"

View file

@ -7,24 +7,24 @@
tags: tags:
- download - download
- name: Put our own /etc/cups/cupsd.conf in place, to permit local LAN admin - name: Install our own /etc/cups/cupsd.conf from template, to permit local LAN admin
template: template:
src: cupsd.conf src: cupsd.conf
dest: /etc/cups/cupsd.conf dest: /etc/cups/cupsd.conf
- name: Put an apache2 config file in place - name: Install /etc/{{ apache_config_dir }}/cups.conf from template
template: template:
src: cups.conf src: cups.conf
dest: "/etc/{{ apache_config_dir }}/" dest: "/etc/{{ apache_config_dir }}/"
- name: Create the link for sites-enabled (debuntu) - name: Create symlink cups.conf from sites-enabled to sites-available (debuntu)
file: file:
src: /etc/apache2/sites-available/cups.conf src: /etc/apache2/sites-available/cups.conf
dest: /etc/apache2/sites-enabled/cups.conf dest: /etc/apache2/sites-enabled/cups.conf
state: link state: link
when: cups_enabled and is_debuntu when: cups_enabled and is_debuntu
- name: Enable services for CUPS (OS's other than Fedora 18) - name: Enable & Start services 'cups' and 'cups-browsed' (OS's other than Fedora 18)
service: service:
name: "{{ item }}" name: "{{ item }}"
state: started state: started
@ -34,8 +34,8 @@
- cups-browsed - cups-browsed
when: cups_enabled and not is_F18 when: cups_enabled and not is_F18
- name: Enable services for CUPS (Fedora 18, for XO laptops) - name: Enable & Start service 'cups' (Fedora 18, for XO laptops)
service: systemd:
name: cups name: cups
state: started state: started
enabled: yes enabled: yes
@ -45,8 +45,8 @@
shell: "cupsctl --remote-admin" shell: "cupsctl --remote-admin"
when: cups_enabled when: cups_enabled
- name: Disable services for CUPS (OS's other than Fedora 18) - name: Disable both CUPS services (OS's other than Fedora 18)
service: systemd:
name: "{{ item }}" name: "{{ item }}"
state: stopped state: stopped
enabled: no enabled: no
@ -56,15 +56,15 @@
when: not cups_enabled and not is_F18 when: not cups_enabled and not is_F18
- name: Disable services for CUPS (Fedora 18, for XO laptops) - name: Disable services for CUPS (Fedora 18, for XO laptops)
service: systemd:
name: cups name: cups
state: stopped state: stopped
enabled: no enabled: no
when: not cups_enabled and is_F18 when: not cups_enabled and is_F18
- name: Add 'cups' to list of services at {{ iiab_ini_file }} - name: Add 'cups' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"
section: cups section: cups
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"

View file

@ -40,11 +40,12 @@
enabled=false enabled=false
when: not docker_enabled when: not docker_enabled
- name: add docker to service list - name: Add 'docker' variable values to {{ iiab_ini_file }}
ini_file: dest='{{ iiab_ini_file }}' ini_file:
section=docker path: "{{ iiab_ini_file }}"
option='{{ item.option }}' section: docker
value='{{ item.value }}' option: "{{ item.option }}"
value: "{{ item.value }}"
with_items: with_items:
- option: name - option: name
value: Docker Container value: Docker Container

View file

@ -2,9 +2,9 @@
include_tasks: install.yml include_tasks: install.yml
when: dokuwiki_install when: dokuwiki_install
- name: Add 'dokuwiki' to list of services at {{ iiab_ini_file }} - name: Add 'dokuwiki' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"
section: dokuwiki section: dokuwiki
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"

View file

@ -119,7 +119,7 @@
name: /tmp/elggdb.sql name: /tmp/elggdb.sql
state: absent state: absent
- name: Install Apache's elgg.conf from template, for http://box/elgg - name: Install /etc/{{ apache_config_dir }}/elgg.conf from template, for http://box/elgg
template: template:
src: elgg.conf src: elgg.conf
dest: "/etc/{{ apache_config_dir }}/elgg.conf" dest: "/etc/{{ apache_config_dir }}/elgg.conf"
@ -131,7 +131,7 @@
state: link state: link
when: elgg_enabled and is_debuntu when: elgg_enabled and is_debuntu
- name: Remove symlink elgg.conf from sites-enabled (debuntu) - name: Remove symlink /etc/apache2/sites-enabled/elgg.conf (debuntu)
file: file:
path: /etc/apache2/sites-enabled/elgg.conf path: /etc/apache2/sites-enabled/elgg.conf
state: absent state: absent
@ -143,14 +143,14 @@
state: absent state: absent
when: not elgg_enabled and is_redhat when: not elgg_enabled and is_redhat
- name: Restart Apache, to enable/disable http://box/elgg - name: Restart Apache ({{ apache_service }}) to enable/disable http://box/elgg
service: service:
name: "{{ apache_service }}" name: "{{ apache_service }}"
state: restarted state: restarted
- name: Add 'elgg' to list of services at {{ iiab_ini_file }} - name: Add 'elgg' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"
section: elgg section: elgg
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"

View file

@ -1,4 +1,4 @@
- name: Install Apache's required packages (debian) - name: 'Install 3 packages: apache2, php{{ php_version }}, php{{ php_version }}-curl (debian)'
package: package:
#name: [u'apache2', u'php{{ php_version }}', u'php{{ php_version }}-curl'] # FAILS ('u' for Unicode strings) #name: [u'apache2', u'php{{ php_version }}', u'php{{ php_version }}-curl'] # FAILS ('u' for Unicode strings)
#name: ['apache2', 'php{{ php_version }}', 'php{{ php_version }}-curl'] # WORKS? #name: ['apache2', 'php{{ php_version }}', 'php{{ php_version }}-curl'] # WORKS?
@ -11,17 +11,7 @@
tags: tags:
- download - download
- name: Debian changed SQLite name (debian-8) - name: 'Install 2 packages: apache2, php (ubuntu)'
package:
name: "php{{ php_version }}-sqlite"
when: is_debian and ansible_distribution_major_version == "8"
- name: Debian changed SQLite3 name (debian-9)
package:
name: "php{{ php_version }}-sqlite3"
when: is_debian and ansible_distribution_major_version == "9"
- name: Install Apache's required packages (ubuntu)
package: package:
#name: [u'apache2', u'php'] # FAILS ('u' for Unicode strings) #name: [u'apache2', u'php'] # FAILS ('u' for Unicode strings)
#name: ['apache2', 'php'] # WORKS #name: ['apache2', 'php'] # WORKS
@ -33,32 +23,31 @@
tags: tags:
- download - download
- name: SQLite3 no longer included in another package (ubuntu-18) - name: Install php{{ php_version }}-sqlite (debian-8)
package: package:
name: php{{ php_version }}-sqlite3 name: "php{{ php_version }}-sqlite"
when: is_ubuntu_18 when: is_debian and ansible_distribution_major_version == "8"
- name: Install Apache's required packages (redhat) # SQLite3 no longer included in another package
- name: Install php{{ php_version }}-sqlite3 (debian-9 or ubuntu-18)
package:
name: "php{{ php_version }}-sqlite3"
when: (is_debian and ansible_distribution_major_version == "9") or is_ubuntu_18
- name: 'Install 4 packages: httpd, mod_authnz_external, php, php-curl (redhat)'
package: package:
#name: [u'httpd', u'php', u'php-curl', u'mod_authnz_external'] # FAILS ('u' for Unicode strings) #name: [u'httpd', u'php', u'php-curl', u'mod_authnz_external'] # FAILS ('u' for Unicode strings)
#name: ['httpd', 'php', 'php-curl', 'mod_authnz_external'] # WORKS #name: ['httpd', 'php', 'php-curl', 'mod_authnz_external'] # WORKS
name: name:
- httpd - httpd
- mod_authnz_external
- php - php
- php-curl - php-curl
- mod_authnz_external
state: present state: present
when: is_redhat when: is_redhat
tags: tags:
- download - download
# MOVED DOWN ~58 LINES
#- name: Remove the default apache2 config file (debuntu)
# file:
# path: /etc/apache2/sites-enabled/000-default.conf
# state: absent
# when: is_debuntu
- name: Install Apache's 010-iiab.conf & proxy_ajp.conf into /etc/apache2/sites-available, from templates - name: Install Apache's 010-iiab.conf & proxy_ajp.conf into /etc/apache2/sites-available, from templates
template: template:
backup: yes backup: yes
@ -88,7 +77,7 @@
- { regexp: '^max_input_time', line: 'max_input_time = 300 ; default is 60' } - { regexp: '^max_input_time', line: 'max_input_time = 300 ; default is 60' }
# remove symlinks for mpm-event, replace with mpm-prefork # remove symlinks for mpm-event, replace with mpm-prefork
- name: Remove mpm event symlinks (debuntu) - name: Remove both mpm_event symlinks from /etc/apache2/mods-enabled (debuntu)
file: file:
path: "/etc/apache2/mods-enabled/{{ item }}" path: "/etc/apache2/mods-enabled/{{ item }}"
state: absent state: absent
@ -97,7 +86,7 @@
- mpm_event.load - mpm_event.load
when: is_debuntu when: is_debuntu
- name: Create symlinks for mpm-prefork (debuntu) - name: Create both mpm_prefork symlinks from /etc/apache2/mods-enabled to /etc/apache2/mods-available (debuntu)
file: file:
src: "/etc/apache2/mods-available/{{ item }}" src: "/etc/apache2/mods-available/{{ item }}"
path: "/etc/apache2/mods-enabled/{{ item }}" path: "/etc/apache2/mods-enabled/{{ item }}"
@ -107,7 +96,7 @@
- mpm_prefork.load - mpm_prefork.load
when: is_debuntu when: is_debuntu
- name: Turn on mod_proxy (debuntu) - name: 'Turn on mod_proxy using a2enmod with: proxy, proxy_html, headers, rewrite (debuntu)'
command: a2enmod {{ item }} command: a2enmod {{ item }}
with_items: with_items:
- proxy - proxy
@ -116,14 +105,14 @@
- rewrite - rewrite
when: is_debuntu when: is_debuntu
- name: Create 010-iiab.conf symlink enabling our site (debuntu) - name: Enable our site, creating 010-iiab.conf symlink from sites-enabled to sites-available (debuntu)
file: file:
src: "/etc/{{ apache_config_dir }}/010-iiab.conf" src: "/etc/{{ apache_config_dir }}/010-iiab.conf"
path: /etc/apache2/sites-enabled/010-iiab.conf path: /etc/apache2/sites-enabled/010-iiab.conf
state: link state: link
when: is_debuntu when: is_debuntu
- name: Remove apache2 default config files (debuntu) - name: Remove 000-default.conf from /etc/apache2 and /etc/apache2/sites-enabled (debuntu)
file: file:
path: "{{ item }}" path: "{{ item }}"
state: absent state: absent
@ -140,19 +129,19 @@
group: root group: root
state: directory state: directory
- name: Create admin group - name: 'Create group: admin'
group: group:
name: admin name: admin
state: present state: present
- name: Add user {{ apache_user }} (from variable apache_user) to admin group - name: Add user {{ apache_user }} (from variable apache_user) to group admin
user: user:
name: "{{ apache_user }}" name: "{{ apache_user }}"
groups: admin groups: admin
state: present state: present
createhome: no createhome: no
- name: Create Apache's log dir /var/log/{{ apache_service }} - name: Create Apache dir /var/log/{{ apache_service }}
file: file:
path: "/var/log/{{ apache_service }}" path: "/var/log/{{ apache_service }}"
mode: 0755 mode: 0755
@ -160,7 +149,7 @@
group: "{{ apache_user }}" group: "{{ apache_user }}"
state: directory state: directory
- name: Enable systemd service {{ apache_service }} - name: Enable {{ apache_service }} systemd service
service: service:
name: "{{ apache_service }}" name: "{{ apache_service }}"
enabled: yes enabled: yes
@ -173,23 +162,8 @@
group: "{{ apache_user }}" group: "{{ apache_user }}"
state: directory state: directory
# roles/httpd/templates/iiab-info.conf.j2.deprecated is no longer needed, as
# Apache serves http://box/info directly from above /library/www/html/info
# directly (as generated by /usr/bin/iiab-refresh-wiki-docs)
#
#- name: Remove iiab-info.conf
# file:
# path: "/etc/{{ apache_config_dir }}/iiab-info.conf"
# state: absent
#
#- name: Remove iiab-info.conf symlink (debuntu)
# file:
# path: /etc/apache2/sites-enabled/iiab-info.conf
# state: absent
# when: is_debuntu
# SEE https://github.com/iiab/iiab/issues/1143 as the old roles/osm playbook is rarely used as of late 2018 (if anybody still uses roles/osm, they can overwrite osm.conf using the original osm playbook, or in other ways) # SEE https://github.com/iiab/iiab/issues/1143 as the old roles/osm playbook is rarely used as of late 2018 (if anybody still uses roles/osm, they can overwrite osm.conf using the original osm playbook, or in other ways)
- name: Copy osm.conf for http://box/maps (all OS's) - name: Copy osm.conf to /etc/{{ apache_config_dir }} for http://box/maps (all OS's)
copy: copy:
src: osm.conf src: osm.conf
dest: "/etc/{{ apache_config_dir }}" dest: "/etc/{{ apache_config_dir }}"
@ -215,7 +189,7 @@
tags: tags:
- base - base
- name: Install /usr/bin/iiab-refresh-wiki-docs (scraper script) to create http://box/info offline documentation. (This script will run at the end of Stage 4 = roles/4-server-options/tasks/main.yml) - name: Install /usr/bin/iiab-refresh-wiki-docs (scraper script) to create http://box/info offline documentation. (Script can be run manually and/or at the end of Stage 4 = roles/4-server-options/tasks/main.yml)
template: template:
src: refresh-wiki-docs.sh src: refresh-wiki-docs.sh
dest: /usr/bin/iiab-refresh-wiki-docs dest: /usr/bin/iiab-refresh-wiki-docs
@ -233,3 +207,8 @@
path: /etc/sudoers.d/020_apache_poweroff path: /etc/sudoers.d/020_apache_poweroff
state: absent state: absent
when: not apache_allow_sudo when: not apache_allow_sudo
- name: Restart Apache systemd service ({{ apache_service }})
systemd:
name: "{{ apache_service }}"
state: restarted

View file

@ -11,7 +11,7 @@
# command: cd /; wget http://download.iiab.io/packages/php-stem.x64.tar # command: cd /; wget http://download.iiab.io/packages/php-stem.x64.tar
# when: not is_rpi # when: not is_rpi
- name: Download & unpack php-stem.rpi.tar to / (rpi) - name: Unarchive http://download.iiab.io/packages/php-stem.rpi.tar to / (rpi)
unarchive: unarchive:
src: http://download.iiab.io/packages/php-stem.rpi.tar src: http://download.iiab.io/packages/php-stem.rpi.tar
dest: / dest: /
@ -21,7 +21,7 @@
remote_src: yes remote_src: yes
when: is_rpi when: is_rpi
- name: Download & unpack php-stem.x86.tar to / (debian-9 on x86_64 only) - name: Unarchive http://download.iiab.io/packages/php-stem.x64.tar to / (debian-9 on x86_64 only)
unarchive: unarchive:
src: http://download.iiab.io/packages/php-stem.x64.tar src: http://download.iiab.io/packages/php-stem.x64.tar
dest: / dest: /
@ -33,9 +33,3 @@
# Presumably fails on Debian 8 & 10? # Presumably fails on Debian 8 & 10?
# Fails on Debian i686 as of 2018-08-07: https://github.com/iiab/iiab/issues/983 # Fails on Debian i686 as of 2018-08-07: https://github.com/iiab/iiab/issues/983
# Fails on Ubuntu 18.04 as of 2018-07-28: https://github.com/iiab/iiab/issues/829 # Fails on Ubuntu 18.04 as of 2018-07-28: https://github.com/iiab/iiab/issues/829
# No need to do this twice? Happens later @ https://github.com/iiab/iiab/blob/master/roles/3-base-server/tasks/main.yml#L24-L28
#- name: Restart apache2 / httpd
# service:
# name: "{{ apache_service }}"
# state: restarted

View file

@ -79,15 +79,16 @@
insertafter='^#allowsftp' insertafter='^#allowsftp'
line=allowsftp line=allowsftp
- name: Add idmgr to service list - name: Add 'idmgr' variable values to {{ iiab_ini_file }}
ini_file: dest='{{ iiab_ini_file }}' ini_file:
section=idmgr path: "{{ iiab_ini_file }}"
option='{{ item.option }}' section: idmgr
value='{{ item.value }}' option: "{{ item.option }}"
value: "{{ item.value }}"
with_items: with_items:
- option: name - option: name
value: idmgr value: idmgr
- option: description - option: description
value: '"Idmgr is an automatic identity manager for XO clients which enables automatic backup"' value: '"IdMgr is an automatic identity manager for XO clients which enables automatic backup"'
- option: enabled - option: enabled
value: "{{ xo_services_enabled }}" value: "{{ xo_services_enabled }}"

View file

@ -1,4 +1,4 @@
- name: Install textmode remote access packages {screen, lynx} - name: "Install textmode remote access packages: screen, lynx"
package: package:
name: name:
- screen - screen

View file

@ -12,7 +12,7 @@
kalite_db_name: "{{ kalite_root }}/database/data.sqlite" kalite_db_name: "{{ kalite_root }}/database/data.sqlite"
when: not is_F18 when: not is_F18
- name: See if KA Lite is already configured - name: Does KA Lite database {{ kalite_db_name }} exist? # See if KA Lite is already configured
stat: stat:
path: "{{ kalite_db_name }}" path: "{{ kalite_db_name }}"
register: kalite_installed register: kalite_installed
@ -36,9 +36,9 @@
- include_tasks: enable.yml - include_tasks: enable.yml
- name: Add 'kalite' to list of services at {{ iiab_ini_file }} - name: Add 'kalite' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"
section: kalite section: kalite
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"

View file

@ -1,6 +1,6 @@
# 1. CREATE/VERIFY CRITICAL DIRECTORIES & FILES ARE IN PLACE # 1. CREATE/VERIFY CRITICAL DIRECTORIES & FILES ARE IN PLACE
- name: Create various directories for Kiwix ZIM files - name: Create directory {{ iiab_zim_path }} and subdirs {content, index} for Kiwix ZIM files
file: file:
path: "{{ item }}" path: "{{ item }}"
owner: root owner: root
@ -12,12 +12,12 @@
- "{{ iiab_zim_path }}/content" - "{{ iiab_zim_path }}/content"
- "{{ iiab_zim_path }}/index" - "{{ iiab_zim_path }}/index"
- name: Check for /library/zims/library.xml - name: Check for {{ kiwix_library_xml }} # /library/zims/library.xml
stat: stat:
path: "{{ kiwix_library_xml }}" path: "{{ kiwix_library_xml }}"
register: kiwix_xml register: kiwix_xml
- name: Place a stub /library/zims/library.xml if file does not exist - name: Install a stub /library/zims/library.xml if one doesn't exist
template: template:
src: "{{ item }}" src: "{{ item }}"
dest: "{{ kiwix_library_xml }}" dest: "{{ kiwix_library_xml }}"
@ -34,12 +34,12 @@
path: "{{ kiwix_path }}/bin/kiwix-serve" path: "{{ kiwix_path }}/bin/kiwix-serve"
register: kiwix_bin register: kiwix_bin
- name: Set kiwix_force_install if kiwix-serve not found - name: Set fact kiwix_force_install if kiwix-serve not found
set_fact: set_fact:
kiwix_force_install: True kiwix_force_install: True
when: not kiwix_bin.stat.exists when: not kiwix_bin.stat.exists
- name: Copy test.zim file if kiwix_force_install - name: Install {{ iiab_zim_path }}/content/test.zim if kiwix_force_install
copy: copy:
src: test.zim src: test.zim
dest: "{{ iiab_zim_path }}/content/test.zim" dest: "{{ iiab_zim_path }}/content/test.zim"
@ -49,7 +49,7 @@
force: no force: no
when: kiwix_force_install when: kiwix_force_install
- name: Create /opt/iiab/kiwix/bin directory - name: Create {{ kiwix_path }}/bin directory # /opt/iiab/kiwix/bin
file: file:
path: "{{ kiwix_path }}/bin" path: "{{ kiwix_path }}/bin"
owner: root owner: root
@ -59,7 +59,7 @@
# 2. INSTALL KIWIX-TOOLS EXECUTABLES IF kiwix_force_install # 2. INSTALL KIWIX-TOOLS EXECUTABLES IF kiwix_force_install
- name: Unarchive kiwix-tools .tar.gz to /tmp - name: Unarchive {{ kiwix_src_file }} to /tmp # e.g. kiwix-tools_linux-armhf-0.6.1-1.tar.gz
unarchive: unarchive:
src: "{{ downloads_dir }}/{{ kiwix_src_file }}" src: "{{ downloads_dir }}/{{ kiwix_src_file }}"
dest: /tmp dest: /tmp
@ -73,7 +73,7 @@
# 3. ENABLE MODS FOR APACHE PROXY IF DEBUNTU # 3. ENABLE MODS FOR APACHE PROXY IF DEBUNTU
- name: Enable the mods which permit Apache to proxy (debuntu) - name: Enable the 4 mods which permit Apache to proxy (debuntu)
apache2_module: apache2_module:
name: "{{ item }}" name: "{{ item }}"
with_items: with_items:
@ -85,7 +85,7 @@
# 4. CREATE/ENABLE/RESTART (OR DISABLE) KIWIX SERVICE & ITS CRON JOB # 4. CREATE/ENABLE/RESTART (OR DISABLE) KIWIX SERVICE & ITS CRON JOB
- name: Create 'kiwix-serve' service and related files - name: 'Install from templates: kiwix-serve.service, iiab-make-kiwix-lib, iiab-make-kiwix-lib.py, kiwix.conf'
template: template:
backup: no backup: no
src: "{{ item.src }}" src: "{{ item.src }}"
@ -101,14 +101,14 @@
# - { src: 'iiab-make-apache-config.py', dest: '/usr/bin/iiab-make-apache-config.py', mode: '0755'} # - { src: 'iiab-make-apache-config.py', dest: '/usr/bin/iiab-make-apache-config.py', mode: '0755'}
- { src: 'kiwix.conf.j2', dest: '/etc/{{ apache_config_dir }}/kiwix.conf', mode: '0644'} - { src: 'kiwix.conf.j2', dest: '/etc/{{ apache_config_dir }}/kiwix.conf', mode: '0644'}
- name: Enable Kiwix Proxy in Apache - is disabled by turning off kiwix service (debuntu) - name: Create softlink kiwix.conf from sites-enabled to sites-available - for Kiwix Proxy in Apache - is disabled by turning off service kiwix-serve (debuntu)
file: file:
src: /etc/apache2/sites-available/kiwix.conf src: /etc/apache2/sites-available/kiwix.conf
path: /etc/apache2/sites-enabled/kiwix.conf path: /etc/apache2/sites-enabled/kiwix.conf
state: link state: link
when: is_debuntu when: is_debuntu
- name: Enable 'kiwix-serve' service - name: Enable & Restart 'kiwix-serve' service
service: service:
name: kiwix-serve name: kiwix-serve
enabled: yes enabled: yes
@ -149,9 +149,9 @@
# 5. FINALIZE # 5. FINALIZE
- name: Add 'kiwix' to list of services at {{ iiab_ini_file }} - name: Add 'kiwix' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"
section: kiwix section: kiwix
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"

View file

@ -9,7 +9,7 @@
system: yes system: yes
create_home: no create_home: no
- name: Create /library/kolibri to store data and configuration files - name: Create {{ kolibri_home }} (for data) and {{ kolibri_venv_path }} (for program/config)
file: file:
path: "{{ item }}" path: "{{ item }}"
owner: "{{ kolibri_user }}" owner: "{{ kolibri_user }}"
@ -20,7 +20,7 @@
- "{{ kolibri_home }}" - "{{ kolibri_home }}"
- "{{ kolibri_venv_path }}" - "{{ kolibri_venv_path }}"
- name: Install kolibri using pip on all OS's - name: Install latest kolibri using pip
pip: pip:
name: kolibri name: kolibri
virtualenv: "{{ kolibri_venv_path }}" virtualenv: "{{ kolibri_venv_path }}"
@ -29,17 +29,17 @@
extra_args: --no-cache-dir extra_args: --no-cache-dir
when: internet_available when: internet_available
- name: Run kolibri migrations - name: Run Kolibri migrations
shell: export KOLIBRI_HOME="{{ kolibri_home }}" && "{{ kolibri_exec_path }}" manage migrate shell: export KOLIBRI_HOME="{{ kolibri_home }}" && "{{ kolibri_exec_path }}" manage migrate
ignore_errors: yes ignore_errors: yes
when: kolibri_provision when: kolibri_provision
- name: Set kolibri default language - name: Set Kolibri default language
shell: export KOLIBRI_HOME="{{ kolibri_home }}" && "{{ kolibri_exec_path }}" language setdefault "{{ kolibri_language }}" shell: export KOLIBRI_HOME="{{ kolibri_home }}" && "{{ kolibri_exec_path }}" language setdefault "{{ kolibri_language }}"
ignore_errors: yes ignore_errors: yes
when: kolibri_provision when: kolibri_provision
- name: Create kolibri default facility name, admin account and language - name: Create Kolibri default facility name, admin account and language
shell: > shell: >
export KOLIBRI_HOME="{{ kolibri_home }}" && export KOLIBRI_HOME="{{ kolibri_home }}" &&
"{{ kolibri_exec_path }}" manage provisiondevice --facility "{{ kolibri_facility }}" "{{ kolibri_exec_path }}" manage provisiondevice --facility "{{ kolibri_facility }}"
@ -48,7 +48,7 @@
ignore_errors: yes ignore_errors: yes
when: kolibri_provision when: kolibri_provision
- name: Change /library/kolibri directory permissions - name: chown -R {{ kolibri_user }}:{{ apache_user }} {{ kolibri_home }}
file: file:
path: "{{ kolibri_home }}" path: "{{ kolibri_home }}"
owner: "{{ kolibri_user }}" owner: "{{ kolibri_user }}"
@ -80,9 +80,9 @@
state: stopped state: stopped
when: not kolibri_enabled when: not kolibri_enabled
- name: Add 'kolibri' to list of services at {{ iiab_ini_file }} - name: Add 'kolibri' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"
section: kolibri section: kolibri
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"

View file

@ -1,4 +1,4 @@
- name: Install packages php{{ php_version }}-intl and php{{ php_version }}-mbstring - name: 'Install packages: php{{ php_version }}-intl, php{{ php_version }}-mbstring'
package: package:
name: name:
- "php{{ php_version }}-intl" - "php{{ php_version }}-intl"
@ -25,7 +25,7 @@
mode: 0755 mode: 0755
keep_newer: yes keep_newer: yes
- name: Ensure MySQL is running, so we can create db - name: Start MySQL service, so we can create db
service: service:
state: started state: started
name: "{{ mysql_service }}" name: "{{ mysql_service }}"
@ -60,12 +60,12 @@
chdir: "{{ mediawiki_abs_path }}" chdir: "{{ mediawiki_abs_path }}"
creates: "{{ mediawiki_abs_path }}/LocalSettings.php" creates: "{{ mediawiki_abs_path }}/LocalSettings.php"
- name: Copy mediawiki.conf to permit http://box{{ mediawiki_url }} - name: Install /etc/{{ apache_config_dir }}/mediawiki.conf from template, for http://box{{ mediawiki_url }}
template: template:
src: mediawiki.conf.j2 src: mediawiki.conf.j2
dest: "/etc/{{ apache_config_dir }}/mediawiki.conf" dest: "/etc/{{ apache_config_dir }}/mediawiki.conf"
- name: Enable mediawiki.conf if mediawiki_enabled (debuntu) - name: Create softlink mediawiki.conf from sites-enabled to sites-available, if mediawiki_enabled (debuntu)
file: file:
src: /etc/apache2/sites-available/mediawiki.conf src: /etc/apache2/sites-available/mediawiki.conf
dest: /etc/apache2/sites-enabled/mediawiki.conf dest: /etc/apache2/sites-enabled/mediawiki.conf
@ -83,9 +83,9 @@
name: "{{ apache_service }}" name: "{{ apache_service }}"
state: restarted state: restarted
- name: Add 'mediawiki' to list of services at {{ iiab_ini_file }} - name: Add 'mediawiki' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"
section: mediawiki section: mediawiki
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"

View file

@ -1,4 +1,4 @@
- name: Install packages mongodb-server and mongodb - name: 'Install packages: mongodb, mongodb-server'
package: package:
name: name:
- mongodb-server - mongodb-server
@ -8,7 +8,7 @@
tags: tags:
- download - download
- name: Create the data directory for MongoDB - name: Create 3 dirs for MongoDB
file: file:
state: directory state: directory
path: "{{ item.path }}" path: "{{ item.path }}"
@ -18,7 +18,7 @@
- { path: "{{ mongodb_db_path }}" } # == /library/dbdata/mongodb/ - { path: "{{ mongodb_db_path }}" } # == /library/dbdata/mongodb/
- { path: '/var/log/mongodb' } - { path: '/var/log/mongodb' }
- name: Populate & position /etc/mongod.conf, mongodb.service - name: Populate & position /etc/mongod.conf, mongodb.service, /usr/bin/iiab-mongodb-repair-if-no-lock
template: template:
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
@ -30,7 +30,7 @@
- { src: 'mongodb.service.j2', dest: '/etc/systemd/system/mongodb.service', mode: '0644' } - { src: 'mongodb.service.j2', dest: '/etc/systemd/system/mongodb.service', mode: '0644' }
- { src: 'iiab-mongodb-repair-if-no-lock.j2', dest: '/usr/bin/iiab-mongodb-repair-if-no-lock', mode: '0755' } - { src: 'iiab-mongodb-repair-if-no-lock.j2', dest: '/usr/bin/iiab-mongodb-repair-if-no-lock', mode: '0755' }
- name: Enable+restart systemd service if mongodb_enabled, with "systemctl daemon-reload" (in case mongodb.service changed?) - name: Enable & Restart 'mongodb' systemd service if mongodb_enabled, incl daemon-reload (in case mongodb.service changed?)
systemd: systemd:
name: mongodb name: mongodb
enabled: yes enabled: yes
@ -38,16 +38,16 @@
daemon_reload: yes daemon_reload: yes
when: mongodb_enabled when: mongodb_enabled
- name: 'Disable+stop systemd service if mongodb_enabled: False' - name: Disable 'mongodb' service, if not mongodb_enabled
systemd: systemd:
name: mongodb name: mongodb
enabled: no enabled: no
state: stopped state: stopped
when: not mongodb_enabled when: not mongodb_enabled
- name: Add 'mongodb' to list of services at {{ iiab_ini_file }} - name: Add 'mongodb' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"
section: mongodb section: mongodb
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"

View file

@ -5,7 +5,7 @@
tags: tags:
- download - download
- name: Install chkconfig package -- not in Debian 8 - name: Install chkconfig package (debian-8)
package: package:
name: chkconfig name: chkconfig
state: present state: present
@ -13,7 +13,7 @@
tags: tags:
- download - download
- name: Update main config file - name: Install /etc/monitrc from template
template: template:
backup: yes backup: yes
src: monitrc src: monitrc
@ -22,15 +22,14 @@
group: root group: root
mode: 0600 mode: 0600
- name: Update config files - name: Install config file /etc/monit.d/watchdog from template
template: template:
src: "{{ item }}" src: watchdog
dest: "/etc/monit.d/{{ item }}" dest: /etc/monit.d/watchdog
owner: root owner: root
group: root group: root
force: yes force: yes
mode: 0755 mode: 0755
with_items: watchdog
register: monit_config register: monit_config
when: false when: false
until: monit_config | success until: monit_config | success
@ -38,16 +37,16 @@
delay: 1 delay: 1
#TODO: create systemd script #TODO: create systemd script
- name: Enable 'monit' service - name: Enable 'monit' service (chkconfig monit on)
command: chkconfig monit on command: chkconfig monit on
when: is_debian and ansible_local.local_facts.os_ver == "debian-8" 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
- name: Add 'monit' to list of services at {{ iiab_ini_file }} - name: Add 'monit' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"
section: monit section: monit
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"

View file

@ -75,11 +75,12 @@
shell: cat /etc/moodle/adminpw shell: cat /etc/moodle/adminpw
register: moodlepw register: moodlepw
- name: add moodle to service list - name: Add 'moodle' variable values to {{ iiab_ini_file }}
ini_file: dest='{{ iiab_ini_file }}' ini_file:
section=moodle path: "{{ iiab_ini_file }}"
option='{{ item.option }}' section: moodle
value='{{ item.value }}' option: "{{ item.option }}"
value: "{{ item.value }}"
with_items: with_items:
- option: name - option: name
value: Moodle value: Moodle

View file

@ -46,21 +46,21 @@
#ignore_errors: yes #ignore_errors: yes
when: internet_available and moodle.stat.exists is defined and not moodle.stat.exists 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 - name: Create dir {{ moodle_base }} owned by {{ apache_user }} (for config file?)
file: file:
path: "{{ moodle_base }}" path: "{{ moodle_base }}"
owner: "{{ apache_user }}" owner: "{{ apache_user }}"
recurse: yes recurse: yes
state: directory state: directory
- name: Give Apache permission to write Moodle data directory - name: Create dir {{ content_base }}/dbdata/moodle owned by {{ apache_user }} with write permission 0755
file: file:
path: "{{ content_base }}/dbdata/moodle" path: "{{ content_base }}/dbdata/moodle"
owner: "{{ apache_user }}" owner: "{{ apache_user }}"
mode: 0755 mode: 0755
state: directory state: directory
- name: Create a Moodle data dir with Apache permission to write - name: Create dir {{ moodle_data }} owned by {{ apache_user }}:{{ apache_user }} with write permission 0770 # /library/moodle
file: file:
path: "{{ moodle_data }}" path: "{{ moodle_data }}"
owner: "{{ apache_user }}" owner: "{{ apache_user }}"
@ -73,7 +73,7 @@
path: "/etc/{{ apache_config_dir }}/moodle.conf" path: "/etc/{{ apache_config_dir }}/moodle.conf"
state: absent state: absent
- name: Install Apache's 022-moodle.conf from template - name: Install Apache's 022-moodle.conf from template, if moodle_enabled
template: template:
src: 022-moodle.j2 src: 022-moodle.j2
dest: "/etc/{{ apache_config_dir }}/022-moodle.conf" dest: "/etc/{{ apache_config_dir }}/022-moodle.conf"
@ -82,25 +82,25 @@
mode: 0644 mode: 0644
when: moodle_enabled when: moodle_enabled
- name: Create symlink 022-moodle.conf from sites-enabled to sites-available (debuntu) - name: Create symlink 022-moodle.conf from sites-enabled to sites-available, if moodle_enabled (debuntu)
file: file:
src: /etc/apache2/sites-available/022-moodle.conf src: /etc/apache2/sites-available/022-moodle.conf
dest: /etc/apache2/sites-enabled/022-moodle.conf dest: /etc/apache2/sites-enabled/022-moodle.conf
state: link state: link
when: moodle_enabled and is_debuntu when: moodle_enabled and is_debuntu
- name: Remove symlink 022-moodle.conf (debuntu) - name: Remove symlink 022-moodle.conf, if not moodle_enabled (debuntu)
file: file:
path: /etc/apache2/sites-enabled/022-moodle.conf path: /etc/apache2/sites-enabled/022-moodle.conf
state: absent state: absent
when: not moodle_enabled and is_debuntu when: not moodle_enabled and is_debuntu
- name: Start postgresql-iiab - name: Restart postgresql-iiab
service: service:
name: postgresql-iiab name: postgresql-iiab
state: restarted state: restarted
- name: Create db user - name: Create PostgreSQL db user Admin/changeme
postgresql_user: postgresql_user:
name: Admin name: Admin
password: changeme password: changeme
@ -110,7 +110,7 @@
become: yes become: yes
become_user: postgres become_user: postgres
- name: Create database - name: 'Create database: {{ moodle_database_name }}'
postgresql_db: postgresql_db:
name: "{{ moodle_database_name }}" name: "{{ moodle_database_name }}"
encoding: utf8 encoding: utf8
@ -120,42 +120,42 @@
become: yes become: yes
become_user: postgres become_user: postgres
- name: Put moodle_installer script in {{ moodle_base }} - name: Install {{ moodle_base }}/moodle_installer from template
template: template:
dest: "{{ moodle_base }}"
src: moodle_installer src: moodle_installer
dest: "{{ moodle_base }}"
mode: 0755 mode: 0755
- name: Restart postgresql-iiab - name: Enable & Restart postgresql-iiab
service: service:
name: postgresql-iiab name: postgresql-iiab
state: restarted state: restarted
enabled: yes enabled: yes
when: moodle_enabled when: moodle_enabled
- name: Restart Apache - name: Restart Apache ({{ apache_service }})
service: service:
name: "{{ apache_service }}" name: "{{ apache_service }}"
state: restarted state: restarted
- name: See if {{ moodle_base }}/config.php exists - name: Does {{ moodle_base }}/config.php exist?
stat: stat:
path: "{{ moodle_base }}/config.php" path: "{{ moodle_base }}/config.php"
register: config register: config
- name: Execute moodle_installer script - name: Execute {{ moodle_base }}/moodle_installer
shell: '{{ moodle_base }}/moodle_installer' shell: "{{ moodle_base }}/moodle_installer"
when: config.stat.exists is defined and not config.stat.exists when: config.stat.exists is defined and not config.stat.exists
- name: Give Apache permission to read {{ moodle_base }}/config.php - name: Give read permission 0644 to {{ moodle_base }}/config.php # /opt/iiab/moodle/config.php
#command: chown -R {{ apache_user }} {{ moodle_base }} #command: chown -R {{ apache_user }} {{ moodle_base }}
file: file:
path: "{{ moodle_base }}/config.php" path: "{{ moodle_base }}/config.php"
mode: 0644 mode: 0644
- name: Add 'moodle' to list of services at {{ iiab_ini_file }} - name: Add 'moodle' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"
section: moodle section: moodle
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"

View file

@ -40,7 +40,7 @@
create: yes create: yes
state: present state: present
- name: Enable munin-node service - name: Enable & Start munin-node systemd service
service: service:
name: munin-node name: munin-node
enabled: yes enabled: yes
@ -54,7 +54,7 @@
state: link state: link
when: munin_enabled and is_debuntu when: munin_enabled and is_debuntu
- name: Remove symlink munin24.conf in sites-enabled if not munin_enabled (debuntu) - name: Remove symlink /etc/apache2/sites-enabled/munin24.conf if not munin_enabled (debuntu)
file: file:
path: /etc/apache2/sites-enabled/munin24.conf path: /etc/apache2/sites-enabled/munin24.conf
state: absent state: absent
@ -81,9 +81,9 @@
- /usr/share/munin/plugins/mysql_threads - /usr/share/munin/plugins/mysql_threads
when: mysql_enabled when: mysql_enabled
- name: Add 'munin' to list of services at {{ iiab_ini_file }} - name: Add 'munin' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"
section: munin section: munin
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"

View file

@ -1,4 +1,4 @@
- name: Install MySQL (debuntu) - name: 'Install MySQL packages: mariadb-server, mariadb-client, python-mysqldb and 8 php packages (debuntu)'
package: package:
name: name:
- mariadb-server - mariadb-server
@ -18,19 +18,19 @@
tags: tags:
- download - download
- name: php-xml (ubuntu or debian-9) - name: Install php{{ php_version }}-xml (ubuntu or debian-9)
package: package:
name: "php{{ php_version }}-xml" name: "php{{ php_version }}-xml"
state: present state: present
when: is_ubuntu or is_debian_9 when: is_ubuntu or is_debian_9
- name: php-xml (debian-8) - name: Install php-xml-parser (debian-8)
package: package:
name: "php-xml-parser" name: php-xml-parser
state: present state: present
when: is_debian_8 when: is_debian_8
- name: Install MySQL (OS's other than debuntu) - name: "Install packages: mysql, MySQL-python and 9 php packages (OS's other than debuntu)"
package: package:
name: name:
- MySQL-python - MySQL-python
@ -59,14 +59,15 @@
tags: tags:
- download - download
# Name of mysql service varies by OS so softcoded in 1-prep # Name of MySQL service varies by OS so softcoded in 1-prep
- name: Start the MySQL service - name: 'Start MySQL systemd service: {{ mysql_service }}'
service: systemd:
name: "{{ mysql_service }}" name: "{{ mysql_service }}"
state: started state: started
when: mysql_enabled
- name: Enable the MySQL service - name: Enable MySQL systemd service (upon subsequent boots) if mysql_enabled
service: systemd:
name: "{{ mysql_service }}" name: "{{ mysql_service }}"
enabled: yes enabled: yes
when: mysql_enabled when: mysql_enabled
@ -74,17 +75,15 @@
# 'localhost' needs to be the last item for idempotency, see # 'localhost' needs to be the last item for idempotency, see
# http://ansible.cc/docs/modules.html#mysql-user # http://ansible.cc/docs/modules.html#mysql-user
# unfortunately it still doesn't work # unfortunately it still doesn't work
- name: Update MySQL root password for localhost root accounts - name: Update MySQL root password for localhost root accounts, if mysql_enabled
mysql_user: mysql_user:
name: root name: root
host: "{{ item }}" host: localhost
password: "{{ mysql_root_password }}" password: "{{ mysql_root_password }}"
priv: "*.*:ALL,GRANT" priv: "*.*:ALL,GRANT"
with_items:
- localhost
when: mysql_enabled when: mysql_enabled
- name: Install .my.cnf file from template, with root password credentials - name: Install .my.cnf file from template, with root password credentials, if mysql_enabled
template: template:
src: my.cnf.j2 src: my.cnf.j2
dest: /root/.my.cnf dest: /root/.my.cnf
@ -92,7 +91,7 @@
mode: 0600 mode: 0600
when: mysql_enabled when: mysql_enabled
- name: Update MySQL root password for all remaining root accounts - name: Update MySQL root password for all remaining root accounts (127.0.0.1, ::1) if mysql_enabled
mysql_user: mysql_user:
name: root name: root
host: "{{ item }}" host: "{{ item }}"
@ -104,36 +103,36 @@
- ::1 - ::1
when: mysql_enabled when: mysql_enabled
- name: Delete anonymous MySQL server user for {{ ansible_hostname }} - name: Delete anonymous MySQL server user for {{ ansible_hostname }}, if mysql_enabled
mysql_user: mysql_user:
user: "" user: ""
host: "{{ ansible_hostname }}" host: "{{ ansible_hostname }}"
state: absent state: absent
when: mysql_enabled when: mysql_enabled
- name: Delete anonymous MySQL server user for localhost - name: Delete anonymous MySQL server user for localhost, if mysql_enabled
mysql_user: mysql_user:
user: "" user: ""
state: absent state: absent
when: mysql_enabled when: mysql_enabled
- name: Remove the MySQL test database - name: Remove the MySQL 'test' database, if mysql_enabled
mysql_db: mysql_db:
db: test db: test
state: absent state: absent
when: mysql_enabled when: mysql_enabled
# we had to start mysql in order to configure it, now turn if off if not enabled # we had to start mysql in order to configure it, now turn if off if not enabled
- name: Provisionally Disable the MySQL service - name: Config is done but now DISABLE MySQL service, if not mysql_enabled
service: systemd:
name: "{{ mysql_service }}" name: "{{ mysql_service }}"
enabled: no enabled: no
state: stopped state: stopped
when: not mysql_enabled when: not mysql_enabled
- name: Add 'mysql' to list of services at {{ iiab_ini_file }} - name: Add 'mysql' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"
section: mysql section: mysql
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"

View file

@ -5,7 +5,7 @@
tags: tags:
- download - download
- name: Copy DansGuardian config file (Fedora) - name: Install /etc/dansguardian/dansguardian.conf from template (Fedora)
template: template:
src: roles/network/templates/squid/dansguardian.conf.j2 src: roles/network/templates/squid/dansguardian.conf.j2
dest: /etc/dansguardian/dansguardian.conf dest: /etc/dansguardian/dansguardian.conf
@ -14,7 +14,7 @@
mode: 0640 mode: 0640
when: ansible_distribution == "Fedora" when: ansible_distribution == "Fedora"
- name: Copy DansGuardian config file (debuntu) - name: Install /etc/dansguardian/dansguardian.conf from template (debuntu)
template: template:
src: roles/network/templates/squid/dansguardian.conf.debian.j2 src: roles/network/templates/squid/dansguardian.conf.debian.j2
dest: /etc/dansguardian/dansguardian.conf dest: /etc/dansguardian/dansguardian.conf
@ -23,7 +23,7 @@
mode: 0640 mode: 0640
when: is_debuntu when: is_debuntu
- name: Copy DansGuardian config file (CentOS) - name: Install /etc/dansguardian/dansguardian.conf from template (CentOS)
template: template:
src: roles/network/templates/squid/dansguardian.conf.centos.j2 src: roles/network/templates/squid/dansguardian.conf.centos.j2
dest: /etc/dansguardian/dansguardian.conf dest: /etc/dansguardian/dansguardian.conf
@ -32,7 +32,7 @@
mode: 0640 mode: 0640
when: ansible_distribution == "CentOS" when: ansible_distribution == "CentOS"
- name: Create 'dansguardian' log directory (OS's other than CentOS) - name: Create directory /var/log/dansguardian (OS's other than CentOS)
file: file:
path: /var/log/dansguardian path: /var/log/dansguardian
owner: dansguardian owner: dansguardian
@ -41,7 +41,7 @@
state: directory state: directory
when: ansible_distribution != "CentOS" when: ansible_distribution != "CentOS"
- name: Create DansGuardian log directory (CentOS) - name: Create directory /var/log/dansguardian (CentOS)
file: file:
path: /var/log/dansguardian path: /var/log/dansguardian
owner: dansguardian owner: dansguardian

View file

@ -11,7 +11,7 @@
enabled: yes enabled: yes
when: dhcpd_enabled and dhcpd_install when: dhcpd_enabled and dhcpd_install
- name: Copy /etc/sysconfig/dhcpd file - name: Install /etc/sysconfig/dhcpd, /etc/dhcpd-iiab.conf from templates
template: template:
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
@ -23,7 +23,7 @@
- { src: 'dhcp/dhcpd-iiab.conf.j2', dest: '/etc/dhcpd-iiab.conf', mode: '0644' } - { src: 'dhcp/dhcpd-iiab.conf.j2', dest: '/etc/dhcpd-iiab.conf', mode: '0644' }
when: dhcpd_enabled and dhcpd_install when: dhcpd_enabled and dhcpd_install
- name: Copy named file - name: Install /etc/named-iiab.conf and two *.zone.db files into /var/named-iiab
template: template:
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
@ -35,63 +35,63 @@
- { src: 'named/school.local.zone.db', dest: '/var/named-iiab/', mode: '0644' } - { src: 'named/school.local.zone.db', dest: '/var/named-iiab/', mode: '0644' }
- { src: 'named/school.internal.zone.db', dest: '/var/named-iiab/', mode: '0644' } - { src: 'named/school.internal.zone.db', dest: '/var/named-iiab/', mode: '0644' }
- name: Enable named service - name: Enable named service ({{ dns_service }}) if named_enabled
service: systemd:
name: "{{ dns_service }}" name: "{{ dns_service }}"
enabled: yes enabled: yes
when: named_enabled and named_install when: named_enabled and named_install
- name: Disable named service - name: Disable named service ({{ dns_service }}) if not named_enabled
service: systemd:
name: "{{ dns_service }}" name: "{{ dns_service }}"
enabled: no enabled: no
when: not named_enabled and named_install when: not named_enabled and named_install
- name: Disable dnsmasq - name: Disable dnsmasq, if not dnsmasq_enabled
service: systemd:
name: dnsmasq name: dnsmasq
enabled: no enabled: no
when: not dnsmasq_enabled and dnsmasq_install when: not dnsmasq_enabled and dnsmasq_install
- name: Copy dnsmasq.conf to /etc - name: Install /etc/dnsmasq.conf from template, if dnsmasq_enabled
template: template:
src: network/dnsmasq.conf.j2 src: network/dnsmasq.conf.j2
dest: /etc/dnsmasq.conf dest: /etc/dnsmasq.conf
when: dnsmasq_enabled and dnsmasq_install when: dnsmasq_enabled and dnsmasq_install
- name: Enable dnsmasq - name: Enable dnsmasq systemd service, if dnsmasq_enabled
service: systemd:
name: dnsmasq name: dnsmasq
enabled: yes enabled: yes
when: dnsmasq_enabled and dnsmasq_install when: dnsmasq_enabled and dnsmasq_install
- name: Enable DansGuardian - name: Enable DansGuardian systemd service, if dansguardian_enabled
service: systemd:
name: dansguardian name: dansguardian
enabled: yes enabled: yes
when: dansguardian_enabled and dansguardian_install when: dansguardian_enabled and dansguardian_install
- name: Disable DansGuardian - name: Disable DansGuardian, if not dansguardian_enabled
service: systemd:
name: dansguardian name: dansguardian
enabled: no enabled: no
when: not dansguardian_enabled and dansguardian_install when: not dansguardian_enabled and dansguardian_install
- name: Create xs_httpcache flag - name: Mandate 'HTTPCACHE_ON=True' in {{ iiab_env_file }}, if squid_enabled
lineinfile: lineinfile:
dest: "{{ iiab_env_file }}" path: "{{ iiab_env_file }}"
regexp: '^HTTPCACHE_ON=*' regexp: '^HTTPCACHE_ON=*'
line: 'HTTPCACHE_ON=True' line: 'HTTPCACHE_ON=True'
state: present state: present
when: squid_enabled and squid_install when: squid_enabled and squid_install
- name: Enable Squid service - name: Enable Squid systemd service ({{ proxy }}) if squid_enabled
service: systemd:
name: "{{ proxy }}" name: "{{ proxy }}"
enabled: yes enabled: yes
when: squid_enabled and squid_install when: squid_enabled and squid_install
- name: Copy init script and config file - name: Install /etc/{{ proxy }}/squid-iiab.conf from template, owned by {{ proxy_user }}:{{ proxy_user }}
template: template:
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
@ -106,20 +106,20 @@
mode: 0644 mode: 0644
when: squid_enabled and squid_install when: squid_enabled and squid_install
- name: Point to Squid config file from startup file - name: Point to Squid config file from startup file, if squid_enabled (debuntu)
lineinfile: lineinfile:
regexp: '^CONFIG' regexp: '^CONFIG'
line: "CONFIG=/etc/{{ proxy }}/squid-iiab.conf" line: "CONFIG=/etc/{{ proxy }}/squid-iiab.conf"
dest: "/etc/init.d/{{ proxy }}" path: "/etc/init.d/{{ proxy }}"
when: squid_enabled and squid_install and is_debuntu when: squid_enabled and squid_install and is_debuntu
- name: Disable Squid service - name: Disable Squid service, if not squid_enabled
service: systemd:
name: "{{ proxy }}" name: "{{ proxy }}"
enabled: no enabled: no
when: not squid_enabled and squid_install when: not squid_enabled and squid_install
- name: Remove xs_httpcache flag - name: Revert to 'HTTPCACHE_ON=False' if not squid_enabled
lineinfile: lineinfile:
dest: "{{ iiab_env_file }}" dest: "{{ iiab_env_file }}"
regexp: '^HTTPCACHE_ON=*' regexp: '^HTTPCACHE_ON=*'
@ -127,32 +127,30 @@
state: present state: present
when: not squid_enabled when: not squid_enabled
- name: Enable Wondershaper service - name: Enable Wondershaper service, if wondershaper_enabled
service: systemd:
name: wondershaper name: wondershaper
enabled: yes enabled: yes
when: wondershaper_enabled and wondershaper_install when: wondershaper_enabled and wondershaper_install
- name: Disable Wondershaper service - name: Disable Wondershaper service, if not wondershaper_enabled
service: systemd:
name: wondershaper name: wondershaper
enabled: no enabled: no
when: not wondershaper_enabled and wondershaper_install when: not wondershaper_enabled and wondershaper_install
# check-LAN should be iptables.yml remove later # check-LAN should be iptables.yml remove later
- name: Grab clean copy of iiab-gen-iptables - name: Install clean copy of /usr/bin/iiab-gen-iptables from template
template: template:
src: "{{ item.0 }}" src: gateway/iiab-gen-iptables
dest: "{{ item.1 }}" dest: /usr/bin/iiab-gen-iptables
owner: root owner: root
group: root group: root
mode: 0755 mode: 0755
with_items:
- { 0: 'gateway/iiab-gen-iptables', 1: '/usr/bin/iiab-gen-iptables' }
- name: Add 'squid' to list of services at {{ iiab_ini_file }} - name: Add 'squid' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"
section: squid section: squid
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"
@ -160,9 +158,9 @@
- option: enabled - option: enabled
value: "{{ squid_enabled }}" value: "{{ squid_enabled }}"
- name: Add 'dansguardian' to list of services at {{ iiab_ini_file }} - name: Add 'dansguardian' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"
section: dansguardian section: dansguardian
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"
@ -170,9 +168,9 @@
- option: enabled - option: enabled
value: "{{ dansguardian_enabled }}" value: "{{ dansguardian_enabled }}"
- name: Add 'wondershaper' to list of services at {{ iiab_ini_file }} - name: Add 'wondershaper' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"
section: wondershaper section: wondershaper
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"

View file

@ -1,4 +1,4 @@
- name: Install named packages {bind9, bind9utils} (if debuntu) - name: "Install named packages: bind9, bind9utils (debuntu)"
package: package:
name: name:
- bind9 - bind9
@ -8,7 +8,7 @@
tags: tags:
- download - download
- name: Install named packages {bind, bind-utils} (if not debuntu) - name: "Install named packages: bind, bind-utils (OS's other than debuntu)"
package: package:
name: name:
- bind - bind
@ -25,7 +25,7 @@
state: stopped state: stopped
when: first_run and is_debuntu when: first_run and is_debuntu
- name: Set folder permission - name: "Set 3 folders' ownership to {{ dns_user }}:root and permission to 0755"
file: file:
path: "{{ item }}" path: "{{ item }}"
owner: "{{ dns_user }}" owner: "{{ dns_user }}"
@ -37,7 +37,7 @@
- /var/named-iiab/data - /var/named-iiab/data
- /etc/sysconfig/olpc-scripts/domain_config.d - /etc/sysconfig/olpc-scripts/domain_config.d
- name: Configure named - name: Install 21 configuration files for named, from templates
template: template:
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
@ -68,39 +68,39 @@
- { src: 'roles/network/templates/named/dummy', dest: '/var/named-iiab/data/dummy', owner: "{{ dns_user }}", mode: '0644' } - { src: 'roles/network/templates/named/dummy', dest: '/var/named-iiab/data/dummy', owner: "{{ dns_user }}", mode: '0644' }
- { src: 'roles/network/templates/named/named.blackhole', dest: '/var/named-iiab/named.blackhole', owner: "{{ dns_user }}", mode: '0644' } - { src: 'roles/network/templates/named/named.blackhole', dest: '/var/named-iiab/named.blackhole', owner: "{{ dns_user }}", mode: '0644' }
- name: Substitute our unit file which uses $OPTIONS from sysconfig - name: Install named unit file /etc/systemd/system/{{ dns_service }}.service, which uses $OPTIONS from sysconfig
template: template:
src: "roles/network/templates/named/{{ dns_service }}.service" src: "roles/network/templates/named/{{ dns_service }}.service"
dest: "/etc/systemd/system/{{ dns_service }}.service" dest: "/etc/systemd/system/{{ dns_service }}.service"
mode: 0644 mode: 0644
- name: The dns-jail redirect requires the named.blackhole, disabling recursion (if dns_jail_enabled) - name: "Install /etc/{{ apache_config_dir }}/dns-jail.conf from template: dns-jail redirect requires the named.blackhole, disabling recursion (if dns_jail_enabled)"
# in named-iiab.conf, and the redirection of 404 error documents to / # in named-iiab.conf, and the redirection of 404 error documents to /
template: template:
src: roles/network/templates/named/dns-jail.conf src: roles/network/templates/named/dns-jail.conf
dest: "/etc/{{ apache_config_dir }}/" dest: "/etc/{{ apache_config_dir }}/"
when: dns_jail_enabled when: dns_jail_enabled
- name: Separate enabling required (if debuntu and dns_jail_enabled) - name: Create symlink dns-jail.conf from sites-enabled to sites-available (if debuntu and dns_jail_enabled)
file: file:
src: "/etc/{{ apache_config_dir }}/dns-jail.conf" src: "/etc/{{ apache_config_dir }}/dns-jail.conf"
path: "/etc/{{ apache_service }}/sites-enabled/dns-jail.conf" path: "/etc/{{ apache_service }}/sites-enabled/dns-jail.conf"
state: link state: link
when: is_debuntu and dns_jail_enabled when: is_debuntu and dns_jail_enabled
- name: Separate disabling required (if debuntu and not dns_jail_enabled) - name: Remove symlink /etc/{{ apache_service }}/sites-enabled/dns-jail.conf (if debuntu and not dns_jail_enabled)
file: file:
path: "/etc/{{ apache_service }}/sites-enabled/dns-jail.conf" path: "/etc/{{ apache_service }}/sites-enabled/dns-jail.conf"
state: absent state: absent
when: is_debuntu and not dns_jail_enabled when: is_debuntu and not dns_jail_enabled
- name: Separate enabling/disabling required (if not debuntu and not dns_jail_enabled) - name: Remove symlink /etc/{{ apache_config_dir }}/dns-jail.conf (if not debuntu and not dns_jail_enabled)
file: file:
path: "/etc/{{ apache_config_dir }}/dns-jail.conf" path: "/etc/{{ apache_config_dir }}/dns-jail.conf"
state: absent state: absent
when: not is_debuntu and not dns_jail_enabled when: not is_debuntu and not dns_jail_enabled
- name: Start named after copying files - name: Start named systemd service
service: systemd:
name: "{{ dns_service }}" name: "{{ dns_service }}"
state: started state: started

View file

@ -1,4 +1,4 @@
- name: Install Squid packages {{ proxy }} and cadaver - name: "Install 2 packages: {{ proxy }}, cadaver"
package: package:
name: name:
- "{{ proxy }}" - "{{ proxy }}"
@ -7,7 +7,7 @@
tags: tags:
- download - download
- name: Bigger hammer for Ubuntu - name: "Bigger hammer for Ubuntu, run: /etc/init.d/squid stop"
command: /etc/init.d/squid stop command: /etc/init.d/squid stop
when: is_ubuntu when: is_ubuntu
@ -17,13 +17,13 @@
state: stopped state: stopped
when: not installing when: not installing
- name: Create the Squid user - name: "Create the Squid user: {{ proxy_user }}"
user: user:
name: "{{ proxy_user }}" name: "{{ proxy_user }}"
createhome: False createhome: False
shell: /bin/false shell: /bin/false
- name: Copy init script and config file - name: "Install from template: /usr/bin/iiab-httpcache, /etc/sysconfig/squid, /etc/{{ proxy }}/sites.whitelist.txt and 3 .rules files"
template: template:
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
@ -62,7 +62,7 @@
group: 'root' group: 'root'
mode: '0755' mode: '0755'
- name: Create Squid cache directory - name: Create Squid directory /library/cache
file: file:
path: /library/cache path: /library/cache
owner: "{{ proxy_user }}" owner: "{{ proxy_user }}"
@ -70,7 +70,7 @@
mode: 0750 mode: 0750
state: directory state: directory
- name: Create Squid log directory - name: Create Squid directory /var/log/{{ proxy }}
file: file:
path: "/var/log/{{ proxy }}" path: "/var/log/{{ proxy }}"
owner: "{{ proxy_user }}" owner: "{{ proxy_user }}"
@ -82,7 +82,7 @@
when: dansguardian_install when: dansguardian_install
# {{ proxy }} is normally "squid", but is "squid3" on raspbian-8 & debian-8 # {{ proxy }} is normally "squid", but is "squid3" on raspbian-8 & debian-8
- name: Add '{{ proxy }}' to list of services at {{ iiab_ini_file }} - name: Add '{{ proxy }}' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" dest: "{{ iiab_ini_file }}"
section: "{{ proxy }}" section: "{{ proxy }}"

View file

@ -1,4 +1,4 @@
- name: Check for existence of /opt/nextcloud/version.php - name: Does /opt/nextcloud/version.php exist?
stat: stat:
path: "{{ nextcloud_prefix }}/nextcloud/version.php" path: "{{ nextcloud_prefix }}/nextcloud/version.php"
register: nextcloud_page register: nextcloud_page
@ -83,7 +83,7 @@
state: present state: present
when: is_redhat when: is_redhat
- name: Unpack {{ nextcloud_src_file }} to permanent location /opt/nextcloud - name: Unarchive {{ nextcloud_src_file }} to permanent location {{ nextcloud_prefix }}/nextcloud # e.g. unpack nextcloud_latest-14.tar.bz2 to /opt/nextcloud
unarchive: unarchive:
src: "{{ downloads_dir }}/{{ nextcloud_src_file }}" src: "{{ downloads_dir }}/{{ nextcloud_src_file }}"
dest: "{{ nextcloud_prefix }}" dest: "{{ nextcloud_prefix }}"
@ -150,9 +150,9 @@
# Enables or disable Nextcloud! # Enables or disable Nextcloud!
- include_tasks: nextcloud_enabled.yml - include_tasks: nextcloud_enabled.yml
- name: Add 'nextcloud' to list of services at {{ iiab_ini_file }} - name: Add 'nextcloud' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"
section: Nextcloud section: Nextcloud
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"

View file

@ -1,9 +1,9 @@
- name: nodogsplash dependencies - name: Install package libmicrohttpd12 (Nodogsplash dependencies)
package: package:
name: libmicrohttpd12 name: libmicrohttpd12
state: present state: present
- name: Download nodogsplash software - name: Download {{ iiab_download_url }}/{{ nodogsplash_arm_deb }} to {{ downloads_dir }}
get_url: get_url:
url: "{{ iiab_download_url }}/{{ nodogsplash_arm_deb }}" url: "{{ iiab_download_url }}/{{ nodogsplash_arm_deb }}"
dest: "{{ downloads_dir }}/{{ nodogsplash_arm_deb }}" dest: "{{ downloads_dir }}/{{ nodogsplash_arm_deb }}"
@ -12,9 +12,9 @@
#async: 300 #async: 300
#poll: 5 #poll: 5
- name: Install nodogsplash - name: Install Nodogsplash
apt: apt:
deb="{{ downloads_dir }}/{{ nodogsplash_arm_deb }}" deb: "{{ downloads_dir }}/{{ nodogsplash_arm_deb }}"
#- name: Create nodogsplash.service # deb file has one #- name: Create nodogsplash.service # deb file has one
# template: # template:
@ -25,7 +25,7 @@
# group: root # group: root
# mode: 0644 # mode: 0644
- name: Install custom files - name: Install custom /etc/nodogsplash/nodogsplash.conf, /etc/nodogsplash/htdocs/splash.html
template: template:
backup: no backup: no
src: "{{ item.src }}" src: "{{ item.src }}"
@ -38,23 +38,23 @@
- { src: 'splash.html.j2', dest: '/etc/nodogsplash/htdocs/splash.html', mode: '0644'} - { src: 'splash.html.j2', dest: '/etc/nodogsplash/htdocs/splash.html', mode: '0644'}
# We should probably only start this service on next boot # We should probably only start this service on next boot
- name: Enable nodogsplash service - name: Enable & Start 'nodogsplash' systemd service, if nodogsplash_enabled
service: systemd:
name: nodogsplash name: nodogsplash
enabled: yes enabled: yes
state: started state: started
when: nodogsplash_enabled when: nodogsplash_enabled
- name: Disable nodogsplash service - name: Disable 'nodogsplash' systemd service, if not nodogsplash_enabled
service: systemd:
name: nodogsplash name: nodogsplash
enabled: no enabled: no
state: stopped state: stopped
when: not nodogsplash_enabled when: not nodogsplash_enabled
- name: Add 'nodogsplash' to list of services at {{ iiab_ini_file }} - name: Add 'nodogsplash' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"
section: nodogsplash section: nodogsplash
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"

View file

@ -43,7 +43,7 @@
- "tUM4hl009fbXY4Yy3bAadWL1CquVrZmKfBBWhyhz8zLD6TQ== ghunt@ip-192-168-123-123.ec2.internal$" - "tUM4hl009fbXY4Yy3bAadWL1CquVrZmKfBBWhyhz8zLD6TQ== ghunt@ip-192-168-123-123.ec2.internal$"
- "heOMXXNU6skxdPh2fcHh0bzQcaCSQ== holt@crank$" - "heOMXXNU6skxdPh2fcHh0bzQcaCSQ== holt@crank$"
- name: "Create 3 directories for: OpenVPN keys, scripts & up_wan" - name: 'Create dirs: /etc/openvpn/keys, /etc/openvpn/scripts'
file: file:
path: "{{ item }}" path: "{{ item }}"
state: directory state: directory
@ -205,9 +205,9 @@
# when: not openvpn_enabled and not installing # when: not openvpn_enabled and not installing
- name: Add 'openvpn' to list of services at {{ iiab_ini_file }} - name: Add 'openvpn' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"
section: openvpn section: openvpn
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"

View file

@ -1,30 +1,28 @@
- name: Install OSM required packages (debuntu) - name: Install 5 OSM required packages (debuntu)
package: package:
name: "{{ item }}" name:
- gcc
- python-dev
- liblzma-dev
- libapache2-mod-wsgi
- libapache2-mod-xsendfile
state: present state: present
with_items:
- gcc
- python-dev
- liblzma-dev
- libapache2-mod-wsgi
- libapache2-mod-xsendfile
when: is_debuntu when: is_debuntu
- name: Install OSM required packages (not debuntu) - name: Install 6 OSM required packages (not debuntu)
package: package:
name: "{{ item }}" name:
- python-pip
- gcc
- python-devel
- xz-devel
- mod_wsgi
- mod_xsendfile
state: present state: present
with_items:
- python-pip
- gcc
- python-devel
- xz-devel
- mod_wsgi
- mod_xsendfile
when: not is_debuntu when: not is_debuntu
# OSM wants a specific version do that first # OSM wants a specific version do that first
- name: Install Whoosh 2.6 (debuntu) - name: Install Whoosh 2.6 using pip, into virtualenv (debuntu)
pip: pip:
name: whoosh name: whoosh
virtualenv: "{{ osm_venv }}" virtualenv: "{{ osm_venv }}"
@ -33,7 +31,7 @@
extra_args: "--no-cache-dir" extra_args: "--no-cache-dir"
when: internet_available and is_debuntu when: internet_available and is_debuntu
- name: Install Flask 0.12X (debuntu) - name: Install Flask 0.12.4 using pip, into virtualenv (debuntu)
pip: pip:
name: Flask name: Flask
virtualenv: "{{ osm_venv }}" virtualenv: "{{ osm_venv }}"
@ -42,7 +40,7 @@
extra_args: "--no-cache-dir" extra_args: "--no-cache-dir"
when: internet_available and is_debuntu when: internet_available and is_debuntu
- name: Install OSM with dependencies (debuntu) - name: Install OSM with dependencies using pip, into virtualenv (debuntu)
pip: pip:
name: "{{ item }}" name: "{{ item }}"
virtualenv: "{{ osm_venv }}" virtualenv: "{{ osm_venv }}"
@ -55,56 +53,56 @@
when: internet_available and is_debuntu when: internet_available and is_debuntu
# OSM wants a specific version do that first # OSM wants a specific version do that first
- name: Install Whoosh 2.6 (not debuntu) - name: Install Whoosh 2.6 using pip, into virtualenv (not debuntu)
pip: pip:
name: whoosh name: whoosh
virtualenv: "{{ osm_venv }}" virtualenv: "{{ osm_venv }}"
virtualenv_site_packages: no virtualenv_site_packages: no
version: 2.6 version: 2.6
# extra_args="--no-cache-dir" #extra_args: "--no-cache-dir"
when: internet_available and not is_debuntu when: internet_available and not is_debuntu
- name: Install Flask 0.12X (not debuntu) - name: Install Flask 0.12.4 using pip, into virtualenv (not debuntu)
pip: pip:
name: Flask name: Flask
virtualenv: "{{ osm_venv }}" virtualenv: "{{ osm_venv }}"
virtualenv_site_packages: no virtualenv_site_packages: no
version: 0.12.4 version: 0.12.4
# extra_args="--no-cache-dir" #extra_args: "--no-cache-dir"
when: internet_available and not is_debuntu when: internet_available and not is_debuntu
- name: Install OSM with dependencies (not debuntu) - name: Install OSM with dependencies using pip, into virtualenv (not debuntu)
pip: pip:
name: "{{ item }}" name: "{{ item }}"
virtualenv: "{{ osm_venv }}" virtualenv: "{{ osm_venv }}"
virtualenv_site_packages: no virtualenv_site_packages: no
# extra_args="--no-cache-dir" #extra_args: "--no-cache-dir"
with_items: with_items:
- MarkupSafe - MarkupSafe
- pytz - pytz
- Internet-in-a-Box - Internet-in-a-Box
when: internet_available and not is_debuntu when: internet_available and not is_debuntu
- name: Set osm_path (redhat) - name: Set osm_path fact (redhat)
set_fact: set_fact:
#osm_path: "{{ osm_venv }}/{{ python_path }}/iiab" #osm_path: "{{ osm_venv }}/{{ python_path }}/iiab"
osm_path: "{{ osm_venv }}{{ python_path }}/iiab" osm_path: "{{ osm_venv }}{{ python_path }}/iiab"
when: osm_enabled and is_redhat when: osm_enabled and is_redhat
- name: Set osm_path (debuntu) - name: Set osm_path fact (debuntu)
set_fact: set_fact:
#osm_path: "{{ osm_venv }}/lib/python2.7/site-packages/iiab" #osm_path: "{{ osm_venv }}/lib/python2.7/site-packages/iiab"
osm_path: "{{ osm_venv }}lib/python2.7/site-packages/iiab" osm_path: "{{ osm_venv }}lib/python2.7/site-packages/iiab"
when: osm_enabled and is_debuntu when: osm_enabled and is_debuntu
- name: Point wsgi to virtual environment (all OS's) - name: Point wsgi to virtual environment
lineinfile: lineinfile:
dest: "{{ osm_venv }}/bin/iiab.wsgi" path: "{{ osm_venv }}/bin/iiab.wsgi"
regexp: "path_to_virtualenv = None" regexp: "path_to_virtualenv = None"
line: "path_to_virtualenv = '/usr/local/osm'" line: "path_to_virtualenv = '/usr/local/osm'"
state: present state: present
- name: Copy OSM config file (all OS's) - name: Install /etc/{{ apache_config_dir }}/osm.conf from template
template: template:
src: osm.conf.j2 src: osm.conf.j2
dest: "/etc/{{ apache_config_dir }}/osm.conf" dest: "/etc/{{ apache_config_dir }}/osm.conf"
@ -114,41 +112,41 @@
backup: no backup: no
when: osm_enabled when: osm_enabled
- name: Create a link from sites-enabled to sites-available (debuntu) - name: Create softlink osm.conf from sites-enabled to sites-available (debuntu)
file: file:
src: "/etc/{{ apache_config_dir }}/osm.conf" src: "/etc/{{ apache_config_dir }}/osm.conf"
dest: /etc/apache2/sites-enabled/osm.conf path: /etc/apache2/sites-enabled/osm.conf
state: link state: link
when: osm_enabled and is_debuntu when: osm_enabled and is_debuntu
- name: Remove the link from sites-enabled to sites-available (debuntu) - name: Remove softlink osm.conf from sites-enabled (debuntu)
file: file:
dest: /etc/apache2/sites-enabled/osm.conf path: /etc/apache2/sites-enabled/osm.conf
state: absent state: absent
when: not osm_enabled and is_debuntu when: not osm_enabled and is_debuntu
- name: Remove the osm.conf (redhat) - name: Remove /{{ apache_config_dir }}/osm.conf (redhat)
file: file:
dest: "/{{ apache_config_dir }}/osm.conf" path: "/{{ apache_config_dir }}/osm.conf"
state: absent state: absent
when: not osm_enabled and is_redhat when: not osm_enabled and is_redhat
- name: Remove link to cgi (all OS's) - name: Remove link {{ doc_root }}/osm.wsgi
file: file:
dest: "{{ doc_root }}/osm.wsgi" path: "{{ doc_root }}/osm.wsgi"
state: absent state: absent
when: not osm_enabled when: not osm_enabled
- name: Create link to cgi (all OS's) - name: Create softlink osm.wsgi to iiab.cgi
file: file:
src: "{{ osm_venv }}/bin/iiab.wsgi" src: "{{ osm_venv }}/bin/iiab.wsgi"
dest: "{{ doc_root }}/osm.wsgi" path: "{{ doc_root }}/osm.wsgi"
owner: root owner: root
group: root group: root
state: link state: link
when: osm_enabled when: osm_enabled
- name: Create the knowledge data set folders - name: Create dir /library/knowledge/modules
file: file:
path: /library/knowledge/modules path: /library/knowledge/modules
state: directory state: directory
@ -156,7 +154,7 @@
group: "{{ apache_user }}" group: "{{ apache_user }}"
# the following was brought into OSM playbook from iiab-factory osm-fix script # the following was brought into OSM playbook from iiab-factory osm-fix script
- name: Copy the files - name: Install 6 files from templates
template: template:
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
@ -174,9 +172,9 @@
name: "{{ apache_service }}" name: "{{ apache_service }}"
state: restarted state: restarted
- name: Add 'osm' to list of services at {{ iiab_ini_file }} - name: Add 'osm' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"
section: osm section: osm
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"

View file

@ -105,11 +105,12 @@
- include_tasks: owncloud_enabled.yml - include_tasks: owncloud_enabled.yml
when: owncloud_enabled when: owncloud_enabled
- name: Add owncloud to service list - name: Add 'owncloud' variable values to {{ iiab_ini_file }}
ini_file: dest='{{ iiab_ini_file }}' ini_file:
section=owncloud path: "{{ iiab_ini_file }}"
option='{{ item.option }}' section: owncloud
value='{{ item.value }}' option: "{{ item.option }}"
value: "{{ item.value }}"
with_items: with_items:
- option: name - option: name
value: owncloud value: owncloud

View file

@ -188,14 +188,14 @@
state: absent state: absent
when: not pathagar_enabled and is_debuntu when: not pathagar_enabled and is_debuntu
- name: Restart http - name: Reload Apache ({{ apache_service }})
service: systemd:
name: "{{ apache_service }}" name: "{{ apache_service }}"
state: reloaded state: reloaded
- name: Add 'pathagar' to list of services at {{ iiab_ini_file }} - name: Add 'pathagar' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"
section: pathagar section: pathagar
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"

View file

@ -1,4 +1,4 @@
- name: Download phpMyAdmin software - name: Download {{ iiab_download_url }}/{{ phpmyadmin_name_zip }} to {{ downloads_dir }}
get_url: get_url:
url: "{{ iiab_download_url }}/{{ phpmyadmin_name_zip }}" url: "{{ iiab_download_url }}/{{ phpmyadmin_name_zip }}"
dest: "{{ downloads_dir }}" dest: "{{ downloads_dir }}"
@ -6,7 +6,7 @@
#register: phpmyadmin_dl_output #register: phpmyadmin_dl_output
when: internet_available when: internet_available
- name: Check if /opt/iiab/downloads/{{ phpmyadmin_name_zip }} exists - name: Does {{ downloads_dir }}/{{ phpmyadmin_name_zip }} exist? # e.g. /opt/iiab/downloads/phpMyAdmin-4.8.3-all-languages.zip
stat: stat:
path: "{{ downloads_dir }}/{{ phpmyadmin_name_zip }}" path: "{{ downloads_dir }}/{{ phpmyadmin_name_zip }}"
register: phpmyadmin_dl register: phpmyadmin_dl
@ -22,14 +22,14 @@
dest: /opt dest: /opt
owner: "{{ apache_user }}" owner: "{{ apache_user }}"
- name: Create symbolic link /opt/phpmyadmin to phpMyAdmin folder above - name: Create symlink from /opt/phpmyadmin to {{ phpmyadmin_name }}
file: file:
src: "{{ phpmyadmin_name }}" src: "{{ phpmyadmin_name }}"
dest: /opt/phpmyadmin path: /opt/phpmyadmin
owner: "{{ apache_user }}" owner: "{{ apache_user }}"
state: link state: link
- name: Copy phpMyAdmin's config file into place - name: Install /opt/phpmyadmin/config.inc.php from template
template: template:
src: config.inc.php src: config.inc.php
dest: /opt/phpmyadmin/config.inc.php dest: /opt/phpmyadmin/config.inc.php
@ -46,28 +46,28 @@
# # recurse: yes # # recurse: yes
# # state: directory # # state: directory
- name: Put the alias into Apache config when enabled - name: Install /etc/{{ apache_config_dir }}/phpmyadmin.conf from template, if phpmyadmin_enabled
template: template:
src: phpmyadmin.j2 src: phpmyadmin.j2
dest: "/etc/{{ apache_config_dir }}/phpmyadmin.conf" dest: "/etc/{{ apache_config_dir }}/phpmyadmin.conf"
when: phpmyadmin_enabled when: phpmyadmin_enabled
- name: Enable phpMyAdmin - name: Create symlink phpmyadmin.conf from sites-enabled to sites-available (debuntu)
file: file:
src: /etc/apache2/sites-available/phpmyadmin.conf src: /etc/apache2/sites-available/phpmyadmin.conf
dest: /etc/apache2/sites-enabled/phpmyadmin.conf path: /etc/apache2/sites-enabled/phpmyadmin.conf
state: link state: link
when: phpmyadmin_enabled and is_debuntu when: phpmyadmin_enabled and is_debuntu
- name: Remove the alias into Apache config when not enabled - name: Remove /etc/apache2/sites-enabled/phpmyadmin.conf, if not phpmyadmin_enabled (debuntu)
file: file:
path: /etc/apache2/sites-enabled/phpmyadmin.conf path: /etc/apache2/sites-enabled/phpmyadmin.conf
state: absent state: absent
when: not phpmyadmin_enabled and is_debuntu when: not phpmyadmin_enabled and is_debuntu
- name: Add 'phpmyadmin' to list of services at {{ iiab_ini_file }} - name: Add 'phpmyadmin' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"
section: phpmyadmin section: phpmyadmin
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"

View file

@ -21,7 +21,7 @@
tags: tags:
- download - download
- name: Create postgresql-iiab systemd service - name: Install /etc/systemd/system/postgresql-iiab.service from template
template: template:
src: postgresql-iiab.service src: postgresql-iiab.service
dest: /etc/systemd/system/postgresql-iiab.service dest: /etc/systemd/system/postgresql-iiab.service
@ -29,7 +29,7 @@
group: root group: root
mode: 0644 mode: 0644
- name: Create postgres data directory - name: Create PostgreSQL data dir /library/pgsql-iiab, owned by postgres:postgres
file: file:
path: /library/pgsql-iiab path: /library/pgsql-iiab
owner: postgres owner: postgres
@ -37,17 +37,17 @@
mode: 0700 mode: 0700
state: directory state: directory
- name: Make sure that the en_US locale is enabled (debuntu) - name: Make sure locale {{ postgresql_locale }} is enabled (debuntu) # en_US.UTF-8
lineinfile: lineinfile:
dest: /etc/locale.gen dest: /etc/locale.gen
line: "{{ postgresql_locale }} UTF-8" line: "{{ postgresql_locale }} UTF-8"
when: is_debuntu when: is_debuntu
- name: Generate the selected locales (debuntu) - name: Generate locales (debuntu)
command: /usr/sbin/locale-gen command: /usr/sbin/locale-gen
when: is_debuntu when: is_debuntu
- name: Initialize the postgres db (debuntu) - name: Initialize the PostgreSQL db, creating /library/pgsql-iiab/pg_hba.conf (debuntu)
#command: su - postgres -c "/usr/lib/postgresql/{{ postgresql_version }}/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"
command: /usr/lib/postgresql/{{ postgresql_version }}/bin/initdb -E 'UTF-8' --locale={{ postgresql_locale }} -D /library/pgsql-iiab command: /usr/lib/postgresql/{{ postgresql_version }}/bin/initdb -E 'UTF-8' --locale={{ postgresql_locale }} -D /library/pgsql-iiab
args: args:
@ -56,7 +56,7 @@
become_user: postgres become_user: postgres
when: is_debuntu when: is_debuntu
- name: Initialize the postgres db (OS's other than debuntu) - name: Initialize the PostgreSQL db, creating /library/pgsql-iiab/pg_hba.conf (OS's other than debuntu)
#command: su - postgres -c "/usr/bin/initdb -E 'UTF-8' --lc-collate={{ postgresql_locale }} --lc-ctype={{ postgresql_locale }} -D /library/pgsql-iiab" #command: su - postgres -c "/usr/bin/initdb -E 'UTF-8' --lc-collate={{ postgresql_locale }} --lc-ctype={{ postgresql_locale }} -D /library/pgsql-iiab"
command: /usr/bin/initdb -E 'UTF-8' --lc-collate={{ postgresql_locale }} --lc-ctype={{ postgresql_locale }} -D /library/pgsql-iiab command: /usr/bin/initdb -E 'UTF-8' --lc-collate={{ postgresql_locale }} --lc-ctype={{ postgresql_locale }} -D /library/pgsql-iiab
args: args:
@ -65,7 +65,7 @@
become_user: postgres become_user: postgres
when: not is_debuntu when: not is_debuntu
- name: Configure PostgreSQL - name: Install /library/pgsql-iiab/postgresql.conf owned by postgres:postgres, from template
template: template:
backup: yes backup: yes
src: postgresql.conf.j2 src: postgresql.conf.j2
@ -74,34 +74,35 @@
group: postgres group: postgres
mode: 0640 mode: 0640
- name: Stop postgresql service (debuntu) # Probably Not Nec! Given stanza below does the same.
- name: 'Stop postgresql service: /etc/init.d/postgresql stop (debuntu)'
command: "/etc/init.d/postgresql stop" command: "/etc/init.d/postgresql stop"
ignore_errors: True ignore_errors: True
when: postgresql_install and is_debuntu when: postgresql_install and is_debuntu
- name: Stop and disable stock postgresql service - name: Disable stock postgresql service
service: systemd:
name: postgresql name: postgresql
state: stopped state: stopped
enabled: no enabled: no
- name: Start and enable postgresql-iiab service - name: Enable & Start postgresql-iiab systemd service, if postgresql_enabled
service: systemd:
name: postgresql-iiab name: postgresql-iiab
state: started state: started
enabled: yes enabled: yes
when: postgresql_enabled when: postgresql_enabled
- name: Stop and disable postgresql-iiab service if not postgresql_enabled - name: Disable postgresql-iiab service, if not postgresql_enabled
service: systemd:
name: postgresql-iiab name: postgresql-iiab
state: stopped state: stopped
enabled: no enabled: no
when: not postgresql_enabled when: not postgresql_enabled
- name: Add 'postgresql' to list of services at {{ iiab_ini_file }} - name: Add 'postgresql' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"
section: postgresql section: postgresql
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"

View file

@ -23,11 +23,12 @@
- include_tasks: rachel_enabled.yml - include_tasks: rachel_enabled.yml
when: rachel_enabled and rachel_content_found when: rachel_enabled and rachel_content_found
- name: Add rachel to service list - name: Add 'rachel' variable values to {{ iiab_ini_file }}
ini_file: dest='{{ iiab_ini_file }}' ini_file:
section=rachel path: "{{ iiab_ini_file }}"
option='{{ item.option }}' section: rachel
value='{{ item.value }}' option: "{{ item.option }}"
value: "{{ item.value }}"
with_items: with_items:
- option: name - option: name
value: rachel value: rachel

View file

@ -1,23 +1,19 @@
--- - name: "Create smb user: {{ smbuser }}"
# Create a smbuser
#
- name: Create smb user
user: user:
name: "{{ smbuser }}" name: "{{ smbuser }}"
shell: /sbin/nologin shell: /sbin/nologin
password: "{{ smbpassword }}" password: "{{ smbpassword }}"
- name: Create the public folder - name: "Create public folder: {{ shared_dir }}"
file: file:
dest: "{{ shared_dir }}" path: "{{ shared_dir }}"
owner: "{{ smbuser }}" owner: "{{ smbuser }}"
group: "{{ smbuser }}" group: "{{ smbuser }}"
mode: 0777 mode: 0777
state: directory state: directory
# Install and configure samba server (requires ports 137, 138, 139, 445 open). # Install and configure samba server (requires ports 137, 138, 139, 445 open).
- name: Install packages {samba, samba-client, samba-common, cifs-client} - name: "Install 4 packages: samba, samba-client, samba-common, cifs-client"
package: package:
name: name:
- samba - samba
@ -29,50 +25,50 @@
- samba - samba
- download - download
- name: Put our smb.conf in place - name: Install /etc/samba/smb.conf from template
template: template:
src: smb.conf.j2 src: smb.conf.j2
dest: /etc/samba/smb.conf dest: /etc/samba/smb.conf
- name: Ensure Samba is running and set to start on boot. - name: Enable & Start Samba systemd service
service: service:
name: "{{ smb_service }}" name: "{{ smb_service }}"
state: started state: started
enabled: yes enabled: yes
tags: tags:
- samba - samba
when : samba_enabled when: samba_enabled
- name: NetBIOS name server is running and set to start on boot - name: Enable & Start NetBIOS name server ({{ nmb_service }})
service: service:
name: "{{ nmb_service }}" name: "{{ nmb_service }}"
state: started state: started
enabled: yes enabled: yes
tags: tags:
- samba - samba
when : samba_enabled when: samba_enabled
- name: Disable Samba if that is wanted - name: Disable Samba if not samba_enabled
service: service:
name: "{{ smb_service }}" name: "{{ smb_service }}"
state: stopped state: stopped
enabled: no enabled: no
tags: tags:
- samba - samba
when : not samba_enabled when: not samba_enabled
- name: Disable Samba name server if that is wanted - name: Disable NetBIOS name server ({{ nmb_service }}) if not samba_enabled
service: service:
name: "{{ nmb_service }}" name: "{{ nmb_service }}"
state: stopped state: stopped
enabled: no enabled: no
tags: tags:
- samba - samba
when : not samba_enabled when: not samba_enabled
- name: Add 'samba' to list of services at {{ iiab_ini_file }} - name: Add 'samba' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"
section: samba section: samba
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"

View file

@ -55,11 +55,12 @@
enabled=no enabled=no
when: not schooltool_enabled when: not schooltool_enabled
- name: add schooltool to service list - name: Add 'schooltool' variable values to {{ iiab_ini_file }}
ini_file: dest='{{ iiab_ini_file }}' ini_file:
section=schooltool path: "{{ iiab_ini_file }}"
option='{{ item.option }}' section: schooltool
value='{{ item.value }}' option: "{{ item.option }}"
value: "{{ item.value }}"
with_items: with_items:
- option: name - option: name
value: Schooltool value: Schooltool

View file

@ -40,11 +40,12 @@
- include_tasks: statistics-consolidation.yml - include_tasks: statistics-consolidation.yml
- name: Add sugar-stats to service list - name: Add 'sugar-stats' variable values to {{ iiab_ini_file }}
ini_file: dest='{{ iiab_ini_file }}' ini_file:
section=sugar_stats path: "{{ iiab_ini_file }}"
option='{{ item.option }}' section: sugar_stats
value='{{ item.value }}' option: "{{ item.option }}"
value: "{{ item.value }}"
with_items: with_items:
- option: name - option: name
value: sugar_stats value: sugar_stats

View file

@ -6,6 +6,7 @@
warn: no warn: no
when: sugarizer_version == "sugarizer-1.0" when: sugarizer_version == "sugarizer-1.0"
# 1. DOWNLOAD+LINK /opt/iiab/sugarizer # 1. DOWNLOAD+LINK /opt/iiab/sugarizer
- name: Clone llaske/sugarizer ({{ sugarizer_git_version }}) from GitHub to /opt/iiab (MAY DOWNLOAD 600+ MB) - name: Clone llaske/sugarizer ({{ sugarizer_git_version }}) from GitHub to /opt/iiab (MAY DOWNLOAD 600+ MB)
@ -17,12 +18,13 @@
depth: 1 depth: 1
when: internet_available when: internet_available
- name: Create symbolic link /opt/iiab/sugarizer -> /opt/iiab/{{ sugarizer_version }} - name: Create symlink /opt/iiab/sugarizer -> /opt/iiab/{{ sugarizer_version }}
file: file:
src: "{{ sugarizer_location }}/{{ sugarizer_version }}" src: "{{ sugarizer_location }}/{{ sugarizer_version }}"
dest: "{{ sugarizer_location }}/sugarizer" dest: "{{ sugarizer_location }}/sugarizer"
state: link state: link
# 2. DOWNLOAD+LINK /opt/iiab/sugarizer-server # 2. DOWNLOAD+LINK /opt/iiab/sugarizer-server
# 2018-07-11: http://download.iiab.io/packages/sugarizer-server-1.0.tar.gz # 2018-07-11: http://download.iiab.io/packages/sugarizer-server-1.0.tar.gz
@ -55,6 +57,7 @@
dest: "{{ sugarizer_location }}/sugarizer-server" dest: "{{ sugarizer_location }}/sugarizer-server"
state: link state: link
# 3. INSTALL A GOOD VERSION OF Node.js AND npm # 3. INSTALL A GOOD VERSION OF Node.js AND npm
- name: Set up Node.js 8.x apt sources (debuntu, but avoid ubuntu-18) - name: Set up Node.js 8.x apt sources (debuntu, but avoid ubuntu-18)
@ -98,6 +101,7 @@
state: latest state: latest
when: internet_available and (is_ubuntu_18 or not is_debuntu) when: internet_available and (is_ubuntu_18 or not is_debuntu)
# 4. RUN "npm install" TO POPULATE ~35MB /opt/iiab/sugarizer-server/node_modules # 4. RUN "npm install" TO POPULATE ~35MB /opt/iiab/sugarizer-server/node_modules
# Re-running "npm install" USED TO fail on Raspbian 9 if not other OS's ? # Re-running "npm install" USED TO fail on Raspbian 9 if not other OS's ?
@ -170,9 +174,10 @@
chdir: "{{ sugarizer_location }}/{{ sugarizer_server_version }}" chdir: "{{ sugarizer_location }}/{{ sugarizer_server_version }}"
when: internet_available when: internet_available
# 5. PLACE CONFIG FILES # 5. PLACE CONFIG FILES
- name: Configure sugarizer.service (systemd), sugarizer.conf (Apache) and sugarizer.ini - name: "Install from templates: sugarizer.service (systemd), sugarizer.conf (Apache), sugarizer.ini and sugarizer-server"
template: template:
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
@ -185,15 +190,23 @@
- { src: 'sugarizer.service.j2', dest: '/etc/systemd/system/sugarizer.service', mode: '0644' } - { src: 'sugarizer.service.j2', dest: '/etc/systemd/system/sugarizer.service', mode: '0644' }
- { src: 'sugarizer.js', dest: '/opt/iiab/sugarizer-server', mode: '0644' } - { src: 'sugarizer.js', dest: '/opt/iiab/sugarizer-server', mode: '0644' }
- name: Create symlink for short URL http://box/sugarizer - name: Create symlink sugarizer.conf from sites-enabled to sites-available, for short URL http://box/sugarizer (debuntu)
file: file:
src: /etc/apache2/sites-available/sugarizer.conf src: /etc/apache2/sites-available/sugarizer.conf
dest: /etc/apache2/sites-enabled/sugarizer.conf path: /etc/apache2/sites-enabled/sugarizer.conf
state: link state: link
when: sugarizer_enabled and is_debuntu
- name: "Remove symlink /etc/apache2/sites-enabled/sugarizer.conf, if sugarizer_enabled: False (debuntu)"
file:
path: /etc/apache2/sites-enabled/sugarizer.conf
state: absent
when: not sugarizer_enabled and is_debuntu
# 6. RESTART/STOP SYSTEMD SERVICE # 6. RESTART/STOP SYSTEMD SERVICE
- name: Enable+restart systemd service if sugarizer_enabled, with "systemctl daemon-reload" (in case mongodb.service changed?) - name: Enable & Restart systemd service if sugarizer_enabled, with "systemctl daemon-reload" (in case mongodb.service changed?)
systemd: systemd:
name: sugarizer name: sugarizer
enabled: yes enabled: yes
@ -201,19 +214,19 @@
daemon_reload: yes daemon_reload: yes
when: sugarizer_enabled when: sugarizer_enabled
- name: Restart Apache so http://box/sugarizer works (not just http://box:8089) - name: "Disable systemd service, if sugarizer_enabled: False"
systemd:
name: "{{ apache_service }}" # httpd or apache2
state: restarted
when: sugarizer_enabled
- name: 'Disable+stop systemd service if sugarizer_enabled: False'
systemd: systemd:
name: sugarizer name: sugarizer
enabled: no enabled: no
state: stopped state: stopped
when: not sugarizer_enabled when: not sugarizer_enabled
- name: Restart Apache ({{ apache_service }}) to enable/disable http://box/sugarizer (not just http://box:8089)
systemd:
name: "{{ apache_service }}" # httpd or apache2
state: restarted
#when: sugarizer_enabled
#- name: Enable services (all OS's) #- name: Enable services (all OS's)
# service: # service:
# name: "{{ item.name }}" # name: "{{ item.name }}"
@ -231,9 +244,9 @@
# state: stopped # state: stopped
# when: not sugarizer_enabled # when: not sugarizer_enabled
- name: Add 'sugarizer' to list of services at {{ iiab_ini_file }} - name: Add 'sugarizer' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"
section: sugarizer section: sugarizer
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"

View file

@ -8,11 +8,12 @@
include_tasks: install.yml include_tasks: install.yml
when: teamviewer_install when: teamviewer_install
- name: Add teamviewer to service list - name: Add 'teamviewer' variable values to {{ iiab_ini_file }}
ini_file: dest='{{ iiab_ini_file }}' ini_file:
section=teamviewer path: "{{ iiab_ini_file }}"
option='{{ item.option }}' section: teamviewer
value='{{ item.value }}' option: "{{ item.option }}"
value: "{{ item.value }}"
with_items: with_items:
- option: name - option: name
value: teamviewer value: teamviewer

View file

@ -1,11 +1,11 @@
- name: Install packages transmission-daemon and transmission-cli - name: 'Install packages: transmission-daemon, transmission-cli'
package: package:
name: name:
- transmission-daemon - transmission-daemon
- transmission-cli - transmission-cli
state: present state: present
- name: Create /library/transmission download directory - name: Create download dir {{ transmission_download_dir }}, owned by {{ transmission_user }}:{{ transmission_group }} # /library/transmission
file: file:
path: "{{ transmission_download_dir }}" path: "{{ transmission_download_dir }}"
owner: "{{ transmission_user }}" owner: "{{ transmission_user }}"
@ -19,7 +19,7 @@
state: stopped state: stopped
ignore_errors: yes ignore_errors: yes
- name: Create transmission-daemon settings - name: Install /etc/transmission-daemon/settings.json from template
template: template:
src: settings.json.j2 src: settings.json.j2
dest: /etc/transmission-daemon/settings.json dest: /etc/transmission-daemon/settings.json
@ -27,7 +27,7 @@
owner: "{{ transmission_user }}" owner: "{{ transmission_user }}"
group: "{{ transmission_group }}" group: "{{ transmission_group }}"
- name: Enable and Restart transmission-daemon service - name: Enable & Restart transmission-daemon systemd service, incl daemon-reload
systemd: systemd:
name: transmission-daemon name: transmission-daemon
daemon_reload: yes daemon_reload: yes
@ -45,7 +45,7 @@
when: transmission_enabled and transmission_provision and transmission_kalite_languages is defined and transmission_kalite_languages is not none when: transmission_enabled and transmission_provision and transmission_kalite_languages is defined and transmission_kalite_languages is not none
ignore_errors: yes ignore_errors: yes
- name: Disable transmission-daemon service - name: Disable transmission-daemon service, if not transmission_enabled
systemd: systemd:
name: transmission-daemon name: transmission-daemon
daemon_reload: yes daemon_reload: yes
@ -53,9 +53,9 @@
state: stopped state: stopped
when: not transmission_enabled when: not transmission_enabled
- name: Add transmission to list of services at {{ iiab_ini_file }} - name: Add 'transmission' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"
section: transmission section: transmission
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"

View file

@ -1,12 +1,12 @@
- name: Add a content directory for links to be located - name: Add dir {{ doc_root }}/local_content, where USB drive links can appear
file: file:
dest: "{{ doc_root }}/local_content" path: "{{ doc_root }}/local_content"
state: directory state: directory
owner: "{{ apache_user }}" owner: "{{ apache_user }}"
group: "{{ iiab_admin_user }}" # ISN'T "{{ apache_user }}" MORE APPROPRIATE? group: "{{ iiab_admin_user }}" # ISN'T "{{ apache_user }}" MORE APPROPRIATE?
mode: 0775 mode: 0775
- name: Copy mount file to usbmount when enabled - name: Install /etc/usbmount/mount.d/70-usb-library from template
template: template:
src: mount.d/70-usb-library src: mount.d/70-usb-library
dest: /etc/usbmount/mount.d/ dest: /etc/usbmount/mount.d/
@ -15,7 +15,7 @@
mode: 0751 mode: 0751
when: usb_lib_enabled when: usb_lib_enabled
- name: Install udev to systemd link -> usbmount - name: 'Install from template: /etc/udev/rules.d/usbmount.rules, /etc/systemd/system/usbmount@.service, /usr/bin/iiab-usb-lib-show-all-on, /usr/bin/iiab-usb-lib-show-all-off'
template: template:
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
@ -26,13 +26,13 @@
- { src: 'iiab-usb-lib-show-all-on' , dest: '/usr/bin/', mode: '0755' } - { src: 'iiab-usb-lib-show-all-on' , dest: '/usr/bin/', mode: '0755' }
- { src: 'iiab-usb-lib-show-all-off' , dest: '/usr/bin/', mode: '0755' } - { src: 'iiab-usb-lib-show-all-off' , dest: '/usr/bin/', mode: '0755' }
- name: Enable exFAT and NTFS - name: Enable exFAT and NTFS in /etc/usbmount/usbmount.conf
lineinfile: lineinfile:
regexp: '^FILESYSTEMS.*' regexp: '^FILESYSTEMS.*'
line: 'FILESYSTEMS="vfat ext2 ext3 ext4 hfsplus exfat fuseblk ntfs"' line: 'FILESYSTEMS="vfat ext2 ext3 ext4 hfsplus exfat fuseblk ntfs"'
dest: /etc/usbmount/usbmount.conf path: /etc/usbmount/usbmount.conf
- name: Copy umount file to usbmount when enabled - name: Install /etc/usbmount/umount.d/70-usb-library from template
template: template:
src: umount.d/70-usb-library src: umount.d/70-usb-library
dest: /etc/usbmount/umount.d dest: /etc/usbmount/umount.d
@ -41,13 +41,13 @@
mode: 0751 mode: 0751
when: usb_lib_enabled when: usb_lib_enabled
- name: Remove mount file to usbmount when not enabled - name: Remove /etc/usbmount/mount.d/70-usb-library if not usb_lib_enabled
file: file:
path: /etc/usbmount/mount.d/70-usb-library path: /etc/usbmount/mount.d/70-usb-library
state: absent state: absent
when: not usb_lib_enabled when: not usb_lib_enabled
- name: Remove umount file to usbmount when not enabled - name: Remove /etc/usbmount/umount.d/70-usb-library if not usb_lib_enabled
file: file:
path: /etc/usbmount/umount.d/70-usb-library path: /etc/usbmount/umount.d/70-usb-library
state: absent state: absent
@ -55,39 +55,38 @@
- name: Put variable in iiab.env that enables display of content at root of USB - name: Put variable in iiab.env that enables display of content at root of USB
lineinfile: lineinfile:
dest: "{{ iiab_env_file }}" path: "{{ iiab_env_file }}"
regexp: "^IIAB_USB_LIB_SHOW_ALL.*" regexp: "^IIAB_USB_LIB_SHOW_ALL.*"
line: "IIAB_USB_LIB_SHOW_ALL={{ iiab_usb_lib_show_all }}" line: "IIAB_USB_LIB_SHOW_ALL={{ iiab_usb_lib_show_all }}"
- name: Add Apache config for content directory - name: Install /etc/{{ apache_config_dir }}/content_dir.conf from template
template: template:
src: content_dir.conf src: content_dir.conf
dest: "/etc/{{ apache_config_dir }}" dest: "/etc/{{ apache_config_dir }}"
when: usb_lib_enabled when: usb_lib_enabled
- name: Create the link to enable (debuntu) - name: Create symlink content_dir.conf from sites-enabled to sites-available (debuntu)
file: file:
src: "/etc/{{ apache_config_dir }}/content_dir.conf" src: "/etc/{{ apache_config_dir }}/content_dir.conf"
dest: /etc/apache2/sites-enabled/content_dir.conf dest: /etc/apache2/sites-enabled/content_dir.conf
state: link state: link
when: is_debuntu when: is_debuntu
- name: Remove the link that enables (debuntu) - name: Remove symlink content_dir.conf from /etc/apache2/sites-enabled (debuntu)
file: file:
src: "/etc/{{ apache_config_dir }}/content_dir.conf"
dest: /etc/apache2/sites-enabled/content_dir.conf dest: /etc/apache2/sites-enabled/content_dir.conf
state: absent state: absent
when: is_debuntu and not usb_lib_enabled when: is_debuntu and not usb_lib_enabled
- name: Remove Apache config for content directory - name: Remove content_dir.conf from /etc/{{ apache_config_dir }}
file: file:
name: "/etc/{{ apache_config_dir }}/content_dir.conf" name: "/etc/{{ apache_config_dir }}/content_dir.conf"
state: absent state: absent
when: not usb_lib_enabled when: not usb_lib_enabled
- name: Add usb-lib to service list - name: Add 'usb-lib' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"
section: usb-lib section: usb-lib
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"

View file

@ -21,14 +21,14 @@
when: iiab_lan_iface is defined when: iiab_lan_iface is defined
- name: Enable & Start vnStat's systemd service - name: Enable & Start vnStat's systemd service
service: systemd:
name: vnstat name: vnstat
enabled: yes enabled: yes
state: started state: started
- name: Add 'vnstat' to list of services at {{ iiab_ini_file }} - name: Add 'vnstat' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"
section: vnstat section: vnstat
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"

View file

@ -11,7 +11,7 @@
# and security enhancements using timestamps under /library/wordpress, as these # and security enhancements using timestamps under /library/wordpress, as these
# can arise without warning when WordPress is online, since WordPress ~4.8 # can arise without warning when WordPress is online, since WordPress ~4.8
- name: Download the latest WordPress software - name: Download {{ wordpress_download_base_url }}/{{ wordpress_src }} to {{ downloads_dir }}
get_url: get_url:
url: "{{ wordpress_download_base_url }}/{{ wordpress_src }}" url: "{{ wordpress_download_base_url }}/{{ wordpress_src }}"
dest: "{{ downloads_dir }}" dest: "{{ downloads_dir }}"
@ -21,14 +21,14 @@
register: wp_download_output register: wp_download_output
when: internet_available when: internet_available
- name: Create link /opt/iiab/downloads/wordpress.tar.gz pointing to {{ wp_download_output.dest }} - name: Create symlink from /opt/iiab/downloads/wordpress.tar.gz to {{ wp_download_output.dest }}
file: file:
src: "{{ wp_download_output.dest }}" src: "{{ wp_download_output.dest }}"
dest: "{{ downloads_dir }}/wordpress.tar.gz" path: "{{ downloads_dir }}/wordpress.tar.gz"
state: link state: link
when: wp_download_output.dest is defined when: wp_download_output.dest is defined
- name: Check if /opt/iiab/downloads/wordpress.tar.gz link exists - name: Does /opt/iiab/downloads/wordpress.tar.gz link exist?
stat: stat:
path: "{{ downloads_dir }}/wordpress.tar.gz" path: "{{ downloads_dir }}/wordpress.tar.gz"
register: wp_link register: wp_link
@ -61,7 +61,7 @@
- name: Make /library/wordpress directories 775 so Apache can traverse and write (most files remain 0664) - name: Make /library/wordpress directories 775 so Apache can traverse and write (most files remain 0664)
command: "/usr/bin/find {{ wp_abs_path }} -type d -exec chmod 775 {} +" command: "/usr/bin/find {{ wp_abs_path }} -type d -exec chmod 775 {} +"
- name: Copy wp salt values - name: Install {{ wp_abs_path }}/wp-keys.php.BAK
copy: copy:
src: wp-keys.php.BAK src: wp-keys.php.BAK
dest: "{{ wp_abs_path }}/wp-keys.php.BAK" dest: "{{ wp_abs_path }}/wp-keys.php.BAK"
@ -71,7 +71,7 @@
# Fetch random salts for WordPress config into wp-keys.php file by generating script and running # Fetch random salts for WordPress config into wp-keys.php file by generating script and running
- name: Create wp salt script - name: Install script /tmp/get-iiab-wp-salts from template
template: template:
src: get-iiab-wp-salts.j2 src: get-iiab-wp-salts.j2
dest: /tmp/get-iiab-wp-salts dest: /tmp/get-iiab-wp-salts
@ -79,20 +79,20 @@
group: root group: root
mode: 0700 mode: 0700
- name: Run wp salt script to create /library/wordpress/wp-keys.php - name: Run /tmp/get-iiab-wp-salts to create /library/wordpress/wp-keys.php
command: /tmp/get-iiab-wp-salts command: /tmp/get-iiab-wp-salts
- name: Cleanup - remove wp salt script - name: Remove script /tmp/get-iiab-wp-salts
file: file:
path: /tmp/get-iiab-wp-salts path: /tmp/get-iiab-wp-salts
state: absent state: absent
- name: MySQL database needs to be running if we are trying to create a new db - name: Start MySQL systemd service
service: service:
state: started state: started
name: "{{ mysql_service }}" name: "{{ mysql_service }}"
- name: Create MySQL wordpress database - name: 'Create MySQL wordpress database: {{ wp_db_name }}'
mysql_db: mysql_db:
name: "{{ wp_db_name }}" name: "{{ wp_db_name }}"
state: present state: present
@ -104,7 +104,7 @@
priv: "{{ wp_db_name }}.*:ALL,GRANT" priv: "{{ wp_db_name }}.*:ALL,GRANT"
state: present state: present
- name: Copy wp-config.php - name: Install {{ wp_abs_path }}/wp-config.php
template: template:
src: wp-config.php.j2 src: wp-config.php.j2
dest: "{{ wp_abs_path }}/wp-config.php" dest: "{{ wp_abs_path }}/wp-config.php"
@ -112,32 +112,32 @@
group: "{{ apache_user }}" group: "{{ apache_user }}"
mode: 0660 mode: 0660
- name: Copy wordpress.conf to permit http://box{{ wp_url }} - name: Install etc/{{ apache_config_dir }}/wordpress.conf from template, for http://box{{ wp_url }}
template: template:
src: wordpress.conf.j2 src: wordpress.conf.j2
dest: "/etc/{{ apache_config_dir }}/wordpress.conf" dest: "/etc/{{ apache_config_dir }}/wordpress.conf"
- name: Enable wordpress.conf if wordpress_enabled (debuntu) - name: Create symlink wordpress.conf from sites-enabled to sites-available, if wordpress_enabled (debuntu)
file: file:
src: /etc/apache2/sites-available/wordpress.conf src: /etc/apache2/sites-available/wordpress.conf
dest: /etc/apache2/sites-enabled/wordpress.conf path: /etc/apache2/sites-enabled/wordpress.conf
state: link state: link
when: wordpress_enabled and is_debuntu when: wordpress_enabled and is_debuntu
- name: Remove wordpress.conf if not wordpress_enabled (debuntu) - name: Remove /etc/apache2/sites-enabled/wordpress.conf if not wordpress_enabled (debuntu)
file: file:
path: /etc/apache2/sites-enabled/wordpress.conf path: /etc/apache2/sites-enabled/wordpress.conf
state: absent state: absent
when: not wordpress_enabled and is_debuntu when: not wordpress_enabled and is_debuntu
- name: Restart Apache to enable/disable http://box{{ wp_url }} - name: Restart Apache to enable/disable http://box{{ wp_url }}
service: systemd:
name: "{{ apache_service }}" name: "{{ apache_service }}"
state: restarted state: restarted
- name: Add 'wordpress' to list of services at {{ iiab_ini_file }} - name: Add 'wordpress' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"
section: wordpress section: wordpress
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"

View file

@ -1,4 +1,4 @@
- name: Install Couchdb and other necessary packages - name: Install CouchDB and other necessary packages
package: name={{ item }} package: name={{ item }}
state=present state=present
with_items: with_items:
@ -45,13 +45,13 @@
- name: Allow access to Couchdb from other hosts - name: Allow access to Couchdb from other hosts
command: sed -i 's/^\(bind_address\s*=\s*\).*$/\10\.0\.0\.0/' /etc/couchdb/default.ini command: sed -i 's/^\(bind_address\s*=\s*\).*$/\10\.0\.0\.0/' /etc/couchdb/default.ini
- name: Enable Couchdb service - name: Enable CouchDB service
service: name=couchdb service: name=couchdb
enabled=yes enabled=yes
state=started state=started
when: xovis_enabled when: xovis_enabled
- name: Wait for couchdb to become ready - name: Wait for CouchDB to become ready
wait_for: port=5984 wait_for: port=5984
delay=1 delay=1
timeout=5 timeout=5
@ -66,7 +66,7 @@
register: found_db register: found_db
ignore_errors: yes ignore_errors: yes
- name: Create Couchdb database if does not already exist - name: Create CouchDB database if does not already exist
command: kanso createdb {{ xovis_db_url }} command: kanso createdb {{ xovis_db_url }}
when: xovis_enabled and found_db.stdout != xovis_db_name when: xovis_enabled and found_db.stdout != xovis_db_name
@ -81,11 +81,12 @@
--server http://{{ xovis_db_login }}@{{ xovis_target_host }}" --server http://{{ xovis_db_login }}@{{ xovis_target_host }}"
when: xovis_enabled when: xovis_enabled
- name: Add xovis to service list - name: Add 'xovis' variable values to {{ iiab_ini_file }}
ini_file: dest='{{ iiab_ini_file }}' ini_file:
section=xovis path: "{{ iiab_ini_file }}"
option='{{ item.option }}' section: xovis
value='{{ item.value }}' option: "{{ item.option }}"
value: "{{ item.value }}"
with_items: with_items:
- option: name - option: name
value: xovis value: xovis