1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

patch 0002

This commit is contained in:
George Hunt 2017-05-27 16:10:45 -07:00
parent 3a1d427ea0
commit cb344d7d47
60 changed files with 211 additions and 172 deletions

View file

@ -111,7 +111,7 @@
- name: Set mysql service name to mysql for debian
set_fact:
mysql_service: mysql
when: ansible_distribution == "Debian"
when: is_debuntu
- name: Fedora 20
set_fact:

View file

@ -6,7 +6,7 @@
- name: get the uuidgen program
package: name=uuid-runtime
state=present
when: is_debian
when: is_debuntu
# for rpi, without rtc, we need time as soon as possible
- name: Install chrony package

View file

@ -8,7 +8,7 @@
src=xsce-extra.repo
owner=root
mode=0666
when: ansible_distribution != "Debian"
when: is_redhat
- name: Install xsce-testing repos
template: backup=yes
@ -16,7 +16,7 @@
src=xsce-testing.repo
owner=root
mode=0666
when: ansible_distribution != "Debian"
when: is_redhat
- name: Install rpmfusion-free-updates repo -- for exfat
template: dest=/etc/yum.repos.d/rpmfusion-free-updates.repo

View file

@ -36,11 +36,11 @@
lineinfile: regexp="^CONF_SWAPSIZE"
line=CONF_SWAPSIZE=500
dest=/etc/dphys-swapfile
when: is_debian
when: is_debuntu
- name: restart the swqp service
command: /etc/init.d/dphys-swapfile restart
when: is_debian
when: is_debuntu
- name: Add rpi rootfs resizing service
template: src={{ item.src }}

View file

@ -40,5 +40,5 @@
backup=no
- include: net_mods.yml
when: not is_debian and not is_F18
when: not is_debuntu and not is_F18

View file

@ -13,18 +13,18 @@
- name: get the createrepo program
package: name=createrepo
state=present
when: ansible_distribution != "Debian"
when: is_redhat
- name: Create local repo
shell: createrepo {{ yum_packages_dir }}
when: ansible_distribution != "Debian"
when: is_redhat
- name: Install local repo file.
template: dest=/etc/yum.repos.d/xsce-local.repo
src=local.repo
owner=root
mode=0644
when: ansible_distribution != "Debian"
when: is_redhat
- name: Install yum packages
package: name={{ item }}
@ -36,7 +36,7 @@
- linux-firmware
- syslog
- xml-common
when: ansible_distribution != "Debian"
when: is_redhat
tags:
- download
@ -46,7 +46,7 @@
with_items:
- inetutils-syslogd
- wpasupplicant
when: ansible_distribution == "Debian"
when: is_debuntu
tags:
- download
@ -87,7 +87,7 @@
- glibc # CVE-2015-7547
- bash
- iptables
when: ansible_distribution != "Debian"
when: is_redhat
tags:
- download
@ -98,7 +98,7 @@
- libc6
- bash
- iptables
when: ansible_distribution == "Debian"
when: is_debuntu
tags:
- download

View file

@ -13,18 +13,18 @@
- name: get the createrepo program
package: name=createrepo
state=present
when: ansible_distribution != "Debian"
when: is_redhat
- name: Create local repo
shell: createrepo {{ yum_packages_dir }}
when: ansible_distribution != "Debian"
when: is_redhat
- name: Install local repo file.
template: dest=/etc/yum.repos.d/xsce-local.repo
src=local.repo
owner=root
mode=0644
when: ansible_distribution != "Debian"
when: is_redhat
- name: Install yum packages
package: name={{ item }}
@ -36,7 +36,7 @@
- linux-firmware
- syslog
- xml-common
when: ansible_distribution != "Debian"
when: is_redhat
tags:
- download
@ -46,7 +46,7 @@
with_items:
- inetutils-syslogd
- wpasupplicant
when: ansible_distribution == "Debian"
when: is_debuntu
tags:
- download
@ -88,7 +88,7 @@
- glibc # CVE-2015-7547
- bash
- iptables
when: ansible_distribution != "Debian"
when: is_redhat
tags:
- download
@ -99,7 +99,7 @@
- libc6
- bash
- iptables
when: ansible_distribution == "Debian"
when: is_debuntu
tags:
- download

View file

@ -13,12 +13,12 @@
- name: Do the same if running on raspbian
template: src=lxde_ssh_warn.sh
dest=/home/pi/.config/lxsession/LXDE-pi/
when: lx.stat.isdir is defined and lx.stat.isdir and is_rpi and is_debian
when: lx.stat.isdir is defined and lx.staat.isdir and is_rpi and is_debuntu
- name: put a autostart line to check for default password in LXDE
lineinfile: line=@/home/pi/.config/lxsession/LXDE-pi/lxde_ssh_warn.sh
dest=/home/pi/.config/lxsession/LXDE-pi/autostart
when: lx.stat.isdir is defined and lx.stat.isdir and is_rpi and is_debian
when: lx.stat.isdir is defined and lx.staat.isdir and is_rpi and is_debuntu
- name: Base Server Installed
command: echo Base Server Installed

View file

@ -4,7 +4,7 @@
- name: Stop postgresql service
command: "/etc/init.d/postgresql stop"
ignore_errors: True
when: postgresql_install and is_debian
when: postgresql_install and is_debuntu
- name: Start postgresql service
service: name=postgresql-xs

View file

@ -6,4 +6,4 @@ dependencies:
- { role: kalite, tags: ['kalite','edu-apps'], when: kalite_install }
- { role: kiwix, tags: ['kiwix','edu-apps'], when: kiwix_install }
- { role: sugarizer, tags: ['sugarizer','edu-apps'], when: sugarizer_install }
- { role: debian_schooltool, tags: ['schooltool','debian_schooltool','edu-apps'], when: debian_schooltool_install and is_debian }
- { role: debian_schooltool, tags: ['schooltool','debian_schooltool','edu-apps'], when: debian_schooltool_install and is_debuntu }

View file

@ -79,19 +79,19 @@
- name: enable mod_expires for debian
command: a2enmod expires
when: is_debian
when: is_debuntu
- name: create the link which enables the site
file: src=/etc/apache2/sites-available/xs-activity-server.conf
dest=/etc/apache2/sites-enabled/xs-activity-server.conf
state=link
when: activity_server_enabled and is_debian
when: activity_server_enabled and is_debuntu
- name: delete the link which enables the site
file: src=/etc/apache2/sites-available/xs-activity-server.conf
dest=/etc/apache2/sites-enabled/xs-activity-server.conf
state=absent
when: not activity_server_enabled and is_debian
when: not activity_server_enabled and is_debuntu
- name: Copy xs-activity-server usbmount file

View file

@ -14,13 +14,13 @@
with_items:
- libapache2-mod-authnz-external
- apache2-utils
when: is_debian
when: is_debuntu
tags:
- download
- name: enable cgi execution
command: a2enmod cgi
when: is_debian
when: is_debuntu
- name: Create directory for awstat to use as intermediate summary storage
file: path={{ item }}
@ -39,7 +39,7 @@
owner=root
group=root
mode=0644
when: awstats_enabled and is_debian
when: awstats_enabled and is_debuntu
- name: Install the Apache config for Advanced Web Statistics
template: src=apache-awstats.conf
@ -47,12 +47,12 @@
owner=root
group=root
mode=0644
when: awstats_enabled and not is_debian
when: awstats_enabled and not is_debuntu
- name: make sure logrotate does not make logs unreadable
template: src=logrotate.d.apache2
dest=/etc/logrotate.d/apache2
when: is_debian
when: is_debuntu
- name: See if awstats package installed a config file
stat: path=/etc/awstats/awstats.conf
@ -68,12 +68,12 @@
file: src=/etc/apache2/sites-available/awstats.conf
path=/etc/apache2/sites-enabled/awstats.conf
state=link
when: awstats_enabled and is_debian
when: awstats_enabled and is_debuntu
- name: Disable Awstats
file: path=/etc/apache2/sites-enabled/awstats.conf
state=absent
when: not awstats_enabled and is_debian
when: not awstats_enabled and is_debuntu
- name: Install the awstats config for Advanced Web Statistics
template: src=awstats.schoolserver.conf.j2
@ -91,9 +91,9 @@
- name: On first enabling of awstats, summarize httpd logs up to now
shell: /bin/perl /usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=schoolserver -update
when: awstats_enabled and not is_debian
when: awstats_enabled and not is_debuntu
- name: On first enabling of awstats, summarize httpd logs up to now
shell: /usr/bin/perl /usr/lib/cgi-bin/awstats.pl -config=schoolserver -update
when: awstats_enabled and is_debian
when: awstats_enabled and is_debuntu

View file

@ -48,7 +48,7 @@
# Example: "/pathtotools/logresolvemerge.pl *.log |"
#
{% if is_debian %}
{% if is_debuntu %}
LogFile="/usr/share/awstats/tools/logresolvemerge.pl /var/log/{{ apache_service }}/access.log* |"
{% else %}
LogFile="/usr/share/awstats/tools/logresolvemerge.pl /var/log/httpd/access_log* |"

View file

@ -41,7 +41,7 @@
file: src=/etc/apache2/sites-available/calibre.conf
dest=/etc/apache2/sites-enabled/calibre.conf
state=link
when: is_debian and calibre_enabled
when: is_debuntu and calibre_enabled
- name: Enable Calibre server
service: name=calibre-serve

View file

@ -5,7 +5,7 @@ After=syslog.target network.target local-fs.target
[Service]
Type=forking
PIDFile=/var/run/calibre.pid
{% if is_debian %}
{% if is_debuntu %}
ExecStart=/usr/bin/calibre-server --daemonize --pidfile=/var/run/calibre.pid --port={{ calibre_port }} --with-library={{ calibre_dbpath }}
{% else %}
ExecStart=/bin/calibre-server --daemonize --pidfile=/var/run/calibre.pid --port={{ calibre_port }} --with-library={{ calibre_dbpath }}

View file

@ -21,7 +21,7 @@
file: src=/etc/apache2/sites-available/cups.conf
dest=/etc/apache2/sites-enabled/cups.conf
state=link
when: cups_enabled and is_debian
when: cups_enabled and is_debuntu
- name: Enable services for cups
service: name={{ item }}

View file

@ -15,7 +15,7 @@
- redis-server
- libjpeg-dev
- xvfb
when: debian_schooltool_install and is_debian
when: debian_schooltool_install and is_debuntu
tags:
- download

View file

@ -18,12 +18,12 @@
file: path=/etc/apache2/sites-enabled/dokuwiki.conf
src=/etc/apache2/sites-available/dokuwiki.conf
state=link
when: dokuwiki_enabled and is_debian
when: dokuwiki_enabled and is_debuntu
- name: disable the dokuwiki
file: path=/etc/apache2/sites-enabled/dokuwiki.conf
state=absent
when: not dokuwiki_enabled and is_debian
when: not dokuwiki_enabled and is_debuntu
- name: Change permissions on engine directory so apache can write

View file

@ -5,7 +5,7 @@
- ejabberd-2.1.11
tags:
- download
when: not is_debian
when: not is_debuntu
- name: Install ejabberd packages
package: name={{ item }}
@ -14,7 +14,7 @@
- ejabberd
tags:
- download
when: is_debian
when: is_debuntu
- name: Configure ejabberd
template: backup=yes
@ -38,12 +38,12 @@
- name: Put the startup script in place - debian
template: src='ejabberd-xs.init'
dest='/etc/init.d/ejabberd-xs'
when: is_debian
when: is_debuntu
- name: Put the startup script in place - non debian
template: src='ejabberd-xs.init'
dest='/usr/libexec/ejabberd-xs'
when: not is_debian
when: not is_debuntu
- name: Remove ejabberd_domain if domain changes
file: path=/etc/sysconfig/ejabberd_domain_name

View file

@ -92,12 +92,12 @@
file: path=/etc/apache2/sites-enabled/elgg.conf
src=/etc/apache2/sites-available/elgg.conf
state=link
when: elgg_enabled and is_debian
when: elgg_enabled and is_debuntu
- name: disable elgg
file: path=/etc/apache2/sites-enabled/elgg.conf
state=absent
when: not elgg_enabled and is_debian
when: not elgg_enabled and is_debuntu
- name: Change permissions on engine directory so apache can write
file: path=/opt/elgg/engine/ owner={{ apache_data }} mode=0755 state=directory

View file

@ -10,6 +10,16 @@
- download
when: is_debian
- name: Install httpd required packages
package: name={{ item }}
state=present
with_items:
- apache2
- php
tags:
- download
when: is_ubuntu
+
- name: Install httpd required packages
package: name={{ item }}
state=present
@ -20,13 +30,13 @@
# - php-sqlite
tags:
- download
when: not is_debian
when: is_redhat
- name: remove the default apache2 config file
file: path=/etc/apache2/sites-enabled/000-default.conf
src=/etc/apache2/sites-available/000-default.conf
state=absent
when: is_debian
+ when: is_debuntu
- name: Create httpd config files
template: backup=yes
@ -47,7 +57,7 @@
with_items:
- mpm_event.conf
- mpm_event.load
when: is_debian
when: is_debuntu
- name: create symlinks for mpm-prefork
file: path=/etc/apache2/mods-enabled/{{ item }}
@ -56,7 +66,7 @@
with_items:
- mpm_prefork.conf
- mpm_prefork.load
when: is_debian
when: is_debuntu
- name: turn on mod_proxy
command: a2enmod {{ item }}
@ -65,7 +75,7 @@
- proxy_html
- headers
- rewrite
when: is_debian
when: is_debuntu
- name: create symlinks for enabling our site
file: path=/etc/apache2/sites-enabled/{{ item }}
@ -73,12 +83,12 @@
state=link
with_items:
- 010-xsce.conf
when: is_debian
when: is_debuntu
- name: Remove the default site container
file: dest=/etc/apache2/000-default.conf
state=absent
when: is_debian
when: is_debuntu
- name: Create http pid dir
file: path=/var/run/{{ apache_user }}

View file

@ -7,13 +7,13 @@
- liblzma-dev
- libapache2-mod-wsgi
- libapache2-mod-xsendfile
when: is_debian
when: is_debuntu
tags:
- download
- name: fix the pip bug (incompatible with requests)
command: easy_install --upgrade pip
when: is_debian
when: is_debuntu
- name: Install IIAB required packages
package: name={{ item }}
@ -25,7 +25,7 @@
- xz-devel
- mod_wsgi
- mod_xsendfile
when: not is_debian
when: not is_debuntu
tags:
- download
@ -115,12 +115,12 @@
file: src=/etc/apache2/sites-available/iiab.conf
dest=/etc/apache2/sites-enabled/iiab.conf
state=link
when: iiab_enabled and is_debian
when: iiab_enabled and is_debuntu
- name: Remove the link from sites-enabled to sites-available
file: dest=/etc/apache2/sites-enabled/iiab.conf
state=absent
when: not iiab_enabled and is_debian
when: not iiab_enabled and is_debuntu
- name: Create link to cgi
file: src=/bin/iiab.wsgi
@ -128,7 +128,7 @@
owner=root
group=root
state=link
when: not is_debian
when: not is_debuntu
- name: Create link to cgi
file: src=/usr/local/bin/iiab.wsgi
@ -136,7 +136,7 @@
owner=root
group=root
state=link
when: is_debian
when: is_debuntu
- name: Restart httpd service
service: name={{ apache_service }}
@ -147,12 +147,12 @@
state=directory
owner={{ apache_user }}
group={{ apache_user }}
when: is_debian
when: is_debuntu
- name: copy the default.ini with our location of /library/knowledge
template: src=defaults.ini
dest=/usr/local/lib/python2.7/dist-packages/iiab/defaults.ini
when: is_debian
when: is_debuntu
- name: add iiab to service list
ini_file: dest='{{ service_filelist }}'

View file

@ -5,7 +5,7 @@ XSendFilePath /
WSGIScriptAlias /iiab {{ doc_root }}/iiab.wsgi
{% if is_debian %}
{% if is_debuntu %}
Alias /iiabstatic /usr/local/lib/python2.7/dist-packages/iiab/static
<Directory /usr/local/lib/python2.7/dist-packages/iiab/static>

View file

@ -58,7 +58,7 @@
- proxy
- proxy_html
- rewrite
when: is_debian
when: is_debuntu
- name: Unarchive it to permanent location - bin only
unarchive: src="{{ downloads_dir }}/{{ kiwix_src_file }}"

View file

@ -36,6 +36,7 @@
#TODO: create systemd script
- name: Enable monit service
command: chkconfig monit on
when: is_debian
#- name: Restart monit service
# command: service monit restart

View file

@ -4,7 +4,7 @@ After={{ apache_service }}.service
[Service]
Type=oneshot
{% if is_debian %}
{% if is_debuntu %}
ExecStart=/etc/init.d/moodle-xs-init start
{% else $}
ExecStart=/usr/libexec/moodle-xs-init start

View file

@ -5,7 +5,7 @@
with_items:
- python-psycopg2
- php-pgsql
when: not is_debian
when: not is_debuntu
tags:
- download
@ -14,8 +14,8 @@
state=present
with_items:
- python-psycopg2
- php5-pgsql
when: is_debian
- php{{ php_version }}-pgsql
when: is_debuntu
tags:
- download
@ -72,12 +72,12 @@
file: path=/etc/apache2/sites-enabled/022-moodle.conf
src=/etc/apache2/sites-available/022-moodle.conf
state=link
when: moodle_enabled and is_debian
when: moodle_enabled and is_debuntu
- name: Disable moodle
file: path=/etc/apache2/sites-enabled/022-moodle.conf
state=absent
when: not moodle_enabled and is_debian
when: not moodle_enabled and is_debuntu
- name: Start postgresql-xs
service: name=postgresql-xs

View file

@ -9,7 +9,7 @@
- libapache2-mod-fcgid
tags:
- download
when: is_debian
when: is_debuntu
- name: Install munin package
package: name={{ item }}
@ -19,7 +19,7 @@
- munin-node
tags:
- download
when: not is_debian
when: not is_debuntu
- name: Copy munin config file
template: src={{ item.src }}
@ -48,13 +48,13 @@
file: src=/etc/apache2/sites-available/munin24.conf
dest=/etc/apache2/sites-enabled/munin24.conf
state=link
when: munin_enabled and is_debian
when: munin_enabled and is_debuntu
- name: disable apache lookup
file: src=/etc/apache2/sites-available/munin24.conf
dest=/etc/apache2/sites-enabled/munin24.conf
state=absent
when: not munin_enabled and is_debian
when: not munin_enabled and is_debuntu
- name: Disable munin-node service when it becomes disabled
service: name=munin-node

View file

@ -5,16 +5,16 @@
- mariadb-server
- mariadb-client
- python-mysqldb
- php5
- php5-mysql
- php{{ php_version }}
- php{{ php_version }}-mysql
- php-pear
- php5-gd
- php5-imap
- php5-ldap
- php5-odbc
- php{{ php_version }}-gd
- php{{ php_version }}-imap
- php{{ php_version }}-ldap
- php{{ php_version }}-odbc
- php-xml-parser
- php5-xmlrpc
when: is_debian
- php{{ php_version }}-xmlrpc
when: is_debuntu
tags:
- download
@ -33,7 +33,7 @@
- php-odbc
- php-xml
- php-xmlrpc
when: not is_debian
when: not is_debuntu
tags:
- download

View file

@ -5,7 +5,7 @@
- libnss-mdns
- avahi-daemon
- avahi-discover
when: is_debian
when: is_debuntu
tags:
- download
@ -16,7 +16,7 @@
- nss-mdns
- avahi
- avahi-tools
when: not is_debian
when: not is_debuntu
tags:
- download
@ -24,7 +24,7 @@
user: name=avahi
createhome=no
shell=/bin/false
when: is_debian
when: is_debuntu
- name: Install avahi announce config files
template: src=avahi/schoolserver.service
@ -43,12 +43,12 @@
- name: Grab a clean copy of ssh.service
copy: src='/usr/share/doc/{{ avahi_ver.stdout }}/ssh.service'
dest='/etc/avahi/services/'
when: avahi_ver.stdout != "" and not is_debian
when: avahi_ver.stdout != "" and not is_debuntu
- name: Grab a clean copy of ssh.service
copy: src='/usr/share/doc/avahi-daemon/examples/ssh.service'
dest='/etc/avahi/services/'
when: is_debian
when: is_debuntu
- name: set ssh port for avahi
lineinfile: dest=/etc/avahi/services/ssh.service

View file

@ -12,7 +12,7 @@
owner=dansguardian
group=dansguardian
mode=0640
when: ansible_distribution == "Debian"
when: is_debuntu
- name: Copy dansguardian config file for CentOS
template: src=squid/dansguardian.conf.centos.j2

View file

@ -1,14 +1,14 @@
- name: Install dhcp package
package: name=isc-dhcp-server
state=present
when: is_debian
when: is_debuntu
tags:
- download
- name: Install dhcp package
package: name=dhcp
state=present
when: not is_debian
when: not is_debuntu
tags:
- download
@ -29,7 +29,7 @@
- name: Create dhcpd needed files
command: touch /var/lib/dhcpd/dhcpd.leases
creates=/var/lib/dhcpd/dhcpd.leases
when: ansible_distribution != "Debian"
when: is_redhat
- name: Check leases permissions
file: path=/var/lib/dhcpd/dhcpd.leases
@ -37,4 +37,4 @@
group=dhcpd
mode=0644
state=file
when: ansible_distribution != "Debian"
when: is_redhat

View file

@ -77,7 +77,7 @@
lineinfile: regexp='^CONFIG'
line='CONFIG=/etc/{{ proxy }}/squid-xs.conf'
dest=/etc/init.d/{{ proxy }}
when: squid_enabled and is_debian
when: squid_enabled and is_debuntu
- name: Disable squid service
service: name={{ proxy }}

View file

@ -38,7 +38,7 @@
- name: Restart hostapd if slave is inactive
service: name=hostapd.service
state=restarted
when: is_debian and xsce_lan_iface == "br0" and item|trim == ""
when: is_debuntu and xsce_lan_iface == "br0" and item|trim == ""
with_items:
- "{{ wifi_slave.stdout }}"
ignore_errors: true

View file

@ -1,22 +1,22 @@
- name: Disable firewalld service
service: name=firewalld
enabled=no
when: not is_debian
when: not is_debuntu
- name: Use larger hammer to disable firewalld (2 symbolic links involved)
shell: "systemctl disable firewalld.service"
when: not is_debian
when: not is_debuntu
- name: Mask firewalld service
shell: 'systemctl mask firewalld'
ignore_errors: yes
when: not installing and not is_debian
when: not installing and not is_debuntu
- name: Stop firewalld service
service: name=firewalld
state=stopped
ignore_errors: yes
when: not installing and not is_debian
when: not installing and not is_debuntu
- name: Remove iptables.service file from /etc
file: path=/etc/systemd/system/iptables.service
@ -29,14 +29,14 @@
- name: Install iptables service package
package: name=iptables-persistent
state=present
when: is_debian
when: is_debuntu
tags:
- download
- name: Install iptables service package
package: name=iptables-services
state=present
when: not is_debian
when: not is_debuntu
tags:
- download
@ -53,4 +53,4 @@
- name: Install debian config
template: src=gateway/iptables dest=/etc/network/if-pre-up.d/iptables
mode=0755
when: is_debian
when: is_debuntu

View file

@ -93,17 +93,17 @@
- include: ifcfg_mods.yml
tags:
- network
when: ansible_distribution != 'Debian' and not installing
when: is_redhat and not installing
- include: debian.yml
tags:
- network
when: is_debian and not is_rpi and not installing
when: is_debuntu and not is_rpi and not installing
- include: rpi_debian.yml
tags:
- network
when: is_debian and is_rpi and not installing
when: is_debuntu and is_rpi and not installing
- name: Create xs network flags
template: src=network/{{ item }}.j2

View file

@ -4,7 +4,7 @@
with_items:
- bind9
- bind9utils
when: is_debian
when: is_debuntu
tags:
- download
@ -14,7 +14,7 @@
with_items:
- bind
- bind-utils
when: not is_debian
when: not is_debuntu
tags:
- download
@ -78,15 +78,15 @@
file: src=/etc/{{ apache_config_dir }}/dns-jail.conf
path=/etc/{{ apache_service }}/sites-enabled/dns-jail.conf
state=link
when: is_debian and dns_jail_enabled
when: is_debuntu and dns_jail_enabled
- name: Separate enabling/disabling required for debian
file: src=/etc/{{ apache_config_dir }}/dns-jail.conf
path=/etc/{{ apache_service }}/sites-enabled/dns-jail.conf
state=absent
when: is_debian and not dns_jail_enabled
when: is_debuntu and not dns_jail_enabled
- name: Separate enabling/disabling required for non debian
file: path=/etc/{{ apache_config_dir }}/dns-jail.conf
state=absent
when: not is_debian and not dns_jail_enabled
when: not is_debuntu and not dns_jail_enabled

View file

@ -19,7 +19,7 @@
- name: add a reference to name server in resolv.conf
lineinfile: line="nameserver 127.0.0.1"
dest=/etc/resolvconf/resolv.conf.d/head
when: named_enabled and is_debian and dns_started.changed
when: named_enabled and is_debuntu and dns_started.changed
- name: Stop dansguardian
service: name=dansguardian

View file

@ -1,5 +1,5 @@
#!/bin/bash -x
{% if is_debian %}
{% if is_debuntu %}
IPTABLES=/sbin/iptables
IPTABLES_DATA=/etc/iptables.up.rules
{% else %}
@ -35,7 +35,7 @@ $IPTABLES -A INPUT -p udp --dport 5984 -j DROP
if [ "x$WANIF" == "x" ]; then
clear_fw
# save the rule set
{% if is_debian %}
{% if is_debuntu %}
netfilter-persistent save
{% else %}
iptables-save > $IPTABLES_DATA
@ -118,7 +118,7 @@ fi
# Enable routing.
echo 1 > /proc/sys/net/ipv4/ip_forward
# save the whole rule set now
{% if is_debian %}
{% if is_debuntu %}
netfilter-persistent save
{% else %}
iptables-save > $IPTABLES_DATA

View file

@ -49,11 +49,11 @@
- name: put up_wan in place for debian
template: src=up_wan dest=/usr/lib/xsce/up_wan
when: is_debian
when: is_debuntu
- name: put dispatcher up for NM
template: src=15-openvpn dest=/etc/NetworkManager/dispatcher.d/
when: not is_debian
when: not is_debuntu
- name: check for manually configured openvpn tunnel
stat: path=/etc/openvpn/xsce-vpn.conf
@ -62,11 +62,11 @@
# note that ansible does not currently handle @ in a service name
- name: enable the openvpn tunnel at boot time
shell: systemctl enable openvpn@xscenet.service
when: openvpn_enabled and not stat.exists is defined and is_debian
when: openvpn_enabled and not stat.exists is defined and is_debuntu
- name: enable the openvpn tunnel at boot time for Debian
shell: update-rc.d openvpn enable
when: openvpn_enabled and not stat.exists is defined and is_debian
when: openvpn_enabled and not stat.exists is defined and is_debuntu
- name: start the openvpn tunnel now
shell: systemctl start openvpn@xscenet.service
@ -88,11 +88,11 @@
- name: stop starting the openvpn tunnel at boot time
shell: systemctl disable openvpn@xscenet.service
when: not openvpn_enabled and not is_debian
when: not openvpn_enabled and not is_debuntu
- name: stop starting the openvpn tunnel at boot time for Debian
shell: update-rc.d openvpn disable
when: not openvpn_enabled and is_debian
when: not openvpn_enabled and is_debuntu
- name: stop openvpn tunnel immediately
shell: systemctl stop openvpn@xscenet.service

View file

@ -21,7 +21,7 @@ source /etc/init.d/functions
SERVER=/usr/bin/ncat
PID_FILE=/var/run/openvpn/announce.pid
HANDLE=${HANDLE// /_}
{% if is_debian %}
{% if is_debuntu %}
ID=`printf "HANDLE = %s|UUID = %s|" $HANDLE $UUID`
$SERVER -l -k -p1705 --exec "/bin/echo $ID" &
{% else %}

View file

@ -16,12 +16,12 @@
file: path=/etc/apache2/sites-enabled/owncloud.conf
src=/etc/apache2/sites-available/owncloud.conf
state=link
when: owncloud_enabled and is_debian
when: owncloud_enabled and is_debuntu
- name: Disable owncloud
file: path=/etc/apache2/sites-enabled/owncloud.conf
state=absent
when: not owncloud_enabled and is_debian
when: not owncloud_enabled and is_debuntu
- name: Restart apache, so it picks up the new aliases
service: name={{ apache_service }} state=restarted

View file

@ -19,7 +19,7 @@
- libapache2-mod-wsgi
- libxml2-dev
- libxslt-dev
when: is_debian
when: is_debuntu
tags:
- download
@ -30,7 +30,7 @@
- mod_wsgi
- libxml2-devel
- libxslt-devel
when: not is_debian
when: not is_debuntu
tags:
- download
@ -180,12 +180,12 @@
file: path=/etc/apache2/sites-enabled/pathagar.conf
src=/etc/apache2/sites-available/pathagar.conf
state=link
when: pathagar_enabled and is_debian
when: pathagar_enabled and is_debuntu
- name: Disable pathagar
file: path=/etc/apache2/sites-enabled/pathagar.conf
state=absent
when: not pathagar_enabled and is_debian
when: not pathagar_enabled and is_debuntu
- name: Restart http
service: name={{ apache_service }}

View file

@ -24,12 +24,12 @@
file: path=/etc/apache2/sites-enabled/phpmyadmin.conf
src=/etc/apache2/sites-available/phpmyadmin.conf
state=link
when: phpmyadmin_enabled and is_debian
when: phpmyadmin_enabled and is_debuntu
- name: Remove the alias into Apache config when not enabled
file: path=/etc/apache2/sites-enabled/phpmyadmin.conf
state=absent
when: not phpmyadmin_enabled and is_debian
when: not phpmyadmin_enabled and is_debuntu
- name: add phpmyadmin to service list
ini_file: dest='{{ service_filelist }}'

View file

@ -8,13 +8,13 @@
- name: Install postgresql for debian
package: name=postgresql-client
when: is_debian
when: is_debuntu
tags:
- download
- name: Install postgresql for fedora
package: name=postgresql-server
when: not is_debian
when: not is_debuntu
tags:
- download
@ -35,21 +35,26 @@
- name: make sure that the en_US locale is enabled
lineinfile: dest=/etc/locale.gen
line="{{ postgresql_locale }} UTF-8"
when: is_debian
when: is_debuntu
- name: generate the selected locales
command: /usr/sbin/locale-gen
when: is_debian
when: is_debuntu
- name: Initialize the postgres db
command: su - postgres -c "/usr/lib/postgresql/9.4/bin/initdb -E 'UTF-8' --locale={{ postgresql_locale }} -D /library/pgsql-xs"
creates=/library/pgsql-xs/pg_hba.conf
when: is_debian
- name: Initialize the postgres db
command: su - postgres -c "/usr/lib/postgresql/9.5/bin/initdb -E 'UTF-8' --locale={{ postgresql_locale }} -D /library/pgsql-xs"
creates=/library/pgsql-xs/pg_hba.conf
when: is_ubuntu
- name: Initialize the postgres db
command: su - postgres -c "/usr/bin/initdb -E 'UTF-8' --lc-collate={{ postgresql_locale }} --lc-ctype={{ postgresql_locale }} -D /library/pgsql-xs"
creates=/library/pgsql-xs/pg_hba.conf
when: not is_debian
when: not is_debuntu
- name: Configure postgres
template: backup=yes

View file

@ -1,4 +1,4 @@
{% if is_debian %}
{% if is_debuntu %}
[Unit]
Description=PostgreSQL database server
After=network.target
@ -27,9 +27,9 @@ Environment=PGSTARTTIMEOUT=270
Environment=PGDATA=/library/pgsql-xs
ExecStart=/usr/lib/postgresql/9.4/bin/pg_ctl start -D ${PGDATA} -s -w -t ${PGSTARTTIMEOUT}
ExecStop=/usr/lib/postgresql/9.4/bin/pg_ctl stop -D ${PGDATA} -s -m fast
ExecReload=/usr/lib/postgresql/9.4/bin/pg_ctl reload -D ${PGDATA} -s
ExecStart=/usr/lib/postgresql/{{ postgresql_version }}/bin/pg_ctl start -D ${PGDATA} -s -w -t ${PGSTARTTIMEOUT}
ExecStop=/usr/lib/postgresql/{{ postgresql_version }}/bin/pg_ctl stop -D ${PGDATA} -s -m fast
ExecReload=/usr/lib/postgresql/{{ postgresql_version }}/bin/pg_ctl reload -D ${PGDATA} -s
# Give a reasonable amount of time for the server to start up/shut down.
# Ideally, the timeout for starting PostgreSQL server should be handled more

View file

@ -6,12 +6,12 @@
file: path=/etc/apache2/sites-enabled/rachel.conf
src=/etc/apache2/sites-available/rachel.conf
state=link
when: rachel_enabled and is_debian
when: rachel_enabled and is_debuntu
- name: Remove RACHEL conf file if we are disabled
file: path=/etc/apache2/sites-enabled/rachel.conf
state=absent
when: not rachel_enabled and is_debian
when: not rachel_enabled and is_debuntu
# This probably doesn't work, but we can't get search to work either
- name: Create link to rachel mysql db from mysql data dir

View file

@ -40,13 +40,13 @@
file: src=/etc/{{ apache_config_dir }}/content_dir.conf
dest=/etc/apache2/sites-enabled/content_dir.conf
state=link
when: is_debian
when: is_debuntu
- name: remove the link that enables in debian
file: src=/etc/{{ apache_config_dir }}/content_dir.conf
dest=/etc/apache2/sites-enabled/content_dir.conf
state=absent
when: is_debian and not usb_lib_enabled
when: is_debuntu and not usb_lib_enabled
- name: remove apache config for content directory
file: name=/etc/{{ apache_config_dir }}/content_dir.conf

View file

@ -15,7 +15,7 @@ CONTENT_LINK="{{ doc_root }}/local_content/$CONTENT_LINK_USB"
logger -p user.notice -t "70-usb-library" -- "Attempting to remove link $CONTENT_LINK."
if [ -L $CONTENT_LINK ]; then
{% if is_debian %}
{% if is_debuntu %}
/bin/rm $CONTENT_LINK
{% else %}
/usr/bin/rm $CONTENT_LINK

View file

@ -74,13 +74,13 @@
file: path=/etc/apache2/sites-enabled/wordpress.conf
src=/etc/apache2/sites-available/wordpress.conf
state=link
when: wordpress_enabled and is_debian
when: wordpress_enabled and is_debuntu
- name: Remove httpd conf file if we are disabled
file: path=/etc/apache2/sites-enabled/wordpress.conf
state=absent
when: not wordpress_enabled and is_debian
when: not wordpress_enabled and is_debuntu
- name: Restart apache, so it picks up the new aliases
service: name={{ apache_service }} state=restarted

View file

@ -3,9 +3,9 @@
state=present
with_items:
- apache2
- php5
- php{{ php_version }}
- php{{ php_version }}-mysql
- build-essential
- php5-dev
- php-pear
- python-dev
- python-pip
@ -14,8 +14,15 @@
- pkg-config
tags:
- download
when: is_debian
when: is_debuntu
- name: install ubuntu connector apache to php
package: libapache2-mod-php
state=present
tags:
- download
when: is_ubuntu
- name: Install packages for cmdsrv
package: name={{ item }}
state=present
@ -35,7 +42,7 @@
- cracklib-python
tags:
- download
when: not is_debian
when: not is_debuntu
- name: check the config_vars.yml file
stat: path=/etc/xsce/config_vars.yml
@ -155,7 +162,7 @@
owner=root
group=root
mode=0644
when: is_debian
when: is_debuntu
- name: Create cmdsrv.conf file
template: backup=yes
@ -164,7 +171,7 @@
owner=root
group=root
mode=0644
when: not is_debian
when: not is_debuntu
- name: Create a folder for xsce-cmdsrv executable not on path
file: path=/usr/lib/xsce
@ -193,6 +200,20 @@
- { src: 'cmdsrv/zmq.ini', dest: '/etc/php5/apache2/conf.d/20-zmq.ini', mode: '0755'}
when: is_debian
- name: Create xsce-cmdsrv service
template: backup=yes
src={{ item.src }}
dest={{ item.dest }}
mode={{ item.mode }}
with_items:
- { src: 'cmdsrv/xsce-cmdsrv-init.j2', dest: '/etc/init.d/xsce-cmdsrv', mode: '0755'}
- { src: 'cmdsrv/zmq.ini', dest: '/etc/php/7.0/mods-available/20-zmq.ini', mode: '0755'}
when: is_ubuntu
- name: Enable the ubuntu php config file
command: phpenmod 20-zmq.ini
when: is_ubuntu
- name: Create xsce-cmdsrv service
template: backup=yes
src={{ item.src }}
@ -201,7 +222,7 @@
with_items:
- { src: 'cmdsrv/xsce-cmdsrv-init.j2', dest: '/usr/libexec/xsce-cmdsrv', mode: '0755'}
- { src: 'cmdsrv/zmq.ini', dest: '/etc/php.d/20-zmq.ini', mode: '0755'}
when: not is_debian
when: is_redhat
- name: Enable xsce-cmdsrv service
service: name=xsce-cmdsrv

View file

@ -4,13 +4,13 @@
with_items:
- libapache2-mod-authnz-external
- pwauth
when: is_debian
when: is_debuntu
tags:
- download
- name: Enable ssl
apache2_module: name=ssl
when: is_debian
when: is_debuntu
- name: Create admin-console directory tree
file: path={{ item }}
@ -84,33 +84,33 @@
- name: Remove the debian default config which gets in the way
file: dest=/etc/apache2/sites-enabled/000-default.conf
state=absent
when: is_debian
when: is_debuntu
# without ssl
- name: Make the xs-console enabled in apache2
file: state=link
dest=/etc/apache2/sites-enabled/xs-console.conf
src=/etc/{{ apache_config_dir }}/xs-console.conf
when: is_debian and not adm_cons_force_ssl
when: is_debuntu and not adm_cons_force_ssl
- name: Make the xs-console ssl version disabled in apache2
file: state=absent
dest=/etc/apache2/sites-enabled/xs-console-ssl.conf
src=/etc/{{ apache_config_dir }}/xs-console-ssl.conf
when: is_debian and not adm_cons_force_ssl
when: is_debuntu and not adm_cons_force_ssl
# with ssl
- name: add link for admin-console config file with ssl support
file: path=/etc/apache2/sites-enabled/xs-console-ssl.conf
src=/etc/{{ apache_config_dir }}/xs-console-ssl.conf
state=link
when: is_debian and adm_cons_force_ssl
when: is_debuntu and adm_cons_force_ssl
- name: remove link for admin-console config file with ssl support
file: path=/etc/apache2/sites-enabled/xs-console.conf
src=/etc/{{ apache_config_dir }}/xs-console.conf
state=absent
when: adm_cons_force_ssl and is_debian
when: adm_cons_force_ssl and is_debuntu
- name: Install admin-console service
template: src=console/cmd-service.php
@ -141,7 +141,7 @@
file: src=/etc/{{ apache_config_dir }}/xsce-home-page.conf
dest=/etc/apache2/sites-enabled/xsce-home-page.conf
state=link
when: is_debian
when: is_debuntu
- name: Create the home directory
file: dest={{ doc_root }}/home

View file

@ -31,7 +31,7 @@
# Command Server on the XSCE School server
#
# Source function library
{% if is_debian %}
{% if is_debuntu %}
. /lib/lsb/init-functions
{% else %}
. /etc/rc.d/init.d/functions
@ -47,7 +47,7 @@ RETVAL=0
start() {
# Start daemons.
{% if is_debian %}
{% if is_debuntu %}
log_daemon_msg "Starting $prog: " "cmdsrv"
if start-stop-daemon --start --oknodo --quiet --exec $SERVER \
--pidfile $PID_FILE -- $OPTS; then

View file

@ -5,7 +5,7 @@ After=syslog.target network.target local-fs.target
[Service]
Type=forking
PIDFile=/var/run/xsce-cmdsrv.pid
{% if is_debian %}
{% if is_debuntu %}
ExecStart=/etc/init.d/xsce-cmdsrv start
{% else %}
ExecStart=/usr/libexec/xsce-cmdsrv start

View file

@ -8,7 +8,7 @@ Alias /admin "{{ admin_console_path }}"
AddExternalAuth pwauth /usr/sbin/pwauth
SetExternalAuthMethod pwauth pipe
SSLEngine on
{% if is_debian %}
{% if is_debuntu %}
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem

View file

@ -8,7 +8,7 @@ Alias /admin "{{ admin_console_path }}"
require valid-user
</Directory>
{% if is_debian %}
{% if is_debuntu %}
<IfModule mod_authnz_external.c>
AddExternalAuth pwauth /usr/sbin/pwauth
SetExternalAuthMethod pwauth pipe

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash -x
# copy var files to /etc/xsce for subsequent use
mkdir -p /etc/xsce
@ -22,7 +22,7 @@ then
. /etc/xsce/xsce.env
cd $XSCE_DIR
else
XSCE_DIR=/opt/schoolserver/xsce
XSCE_DIR=/opt/schoolserver/iiab
fi
if [ ! -f xsce.yml ]

View file

@ -1,6 +1,7 @@
is_debian: false
is_debuntu: false
is_centos: false
is_redhat: true
dns_service: named
dns_user: named
proxy: squid

View file

@ -1,6 +1,7 @@
is_debian: false
is_debuntu: false
is_centos: false
is_redhat: true
dns_service: named
dns_user: named
proxy: squid

View file

@ -11,7 +11,7 @@ doc_base: "{{ content_base }}/www"
doc_root: "{{ doc_base }}/html"
xsce_base: /opt/schoolserver
xsce_dir: "{{ xsce_base }}/xsce"
xsce_dir: "{{ xsce_base }}/iiab"
pip_packages_dir: "{{ xsce_base }}/pip-packages"
yum_packages_dir: "{{ xsce_base }}/yum-packages"
downloads_dir: "{{ xsce_base }}/downloads"