diff --git a/roles/1-prep/tasks/computed_vars.yml b/roles/1-prep/tasks/computed_vars.yml
index 4ca0460b6..e93c04054 100644
--- a/roles/1-prep/tasks/computed_vars.yml
+++ b/roles/1-prep/tasks/computed_vars.yml
@@ -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:
diff --git a/roles/1-prep/tasks/main.yml b/roles/1-prep/tasks/main.yml
index ae9ad3af3..b0a9d772b 100644
--- a/roles/1-prep/tasks/main.yml
+++ b/roles/1-prep/tasks/main.yml
@@ -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
diff --git a/roles/1-prep/tasks/prep.yml b/roles/1-prep/tasks/prep.yml
index 9bc38e46d..cd184b2c7 100644
--- a/roles/1-prep/tasks/prep.yml
+++ b/roles/1-prep/tasks/prep.yml
@@ -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
diff --git a/roles/1-prep/tasks/raspberry_pi_2.yml b/roles/1-prep/tasks/raspberry_pi_2.yml
index f79b09f47..ba3eb3371 100644
--- a/roles/1-prep/tasks/raspberry_pi_2.yml
+++ b/roles/1-prep/tasks/raspberry_pi_2.yml
@@ -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 }}
diff --git a/roles/2-common/tasks/main.yml b/roles/2-common/tasks/main.yml
index 57aa258c4..d1587b46a 100644
--- a/roles/2-common/tasks/main.yml
+++ b/roles/2-common/tasks/main.yml
@@ -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
diff --git a/roles/2-common/tasks/packages.yml b/roles/2-common/tasks/packages.yml
index d6be0ee1e..8a57a09e6 100644
--- a/roles/2-common/tasks/packages.yml
+++ b/roles/2-common/tasks/packages.yml
@@ -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
diff --git a/roles/2-common/tasks/yum.yml b/roles/2-common/tasks/yum.yml
index 4e8d6a2cc..f8f4ce86d 100644
--- a/roles/2-common/tasks/yum.yml
+++ b/roles/2-common/tasks/yum.yml
@@ -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
diff --git a/roles/3-base-server/tasks/main.yml b/roles/3-base-server/tasks/main.yml
index d7966493f..e735f7a88 100644
--- a/roles/3-base-server/tasks/main.yml
+++ b/roles/3-base-server/tasks/main.yml
@@ -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
diff --git a/roles/4-server-options/tasks/main.yml b/roles/4-server-options/tasks/main.yml
index f9cc47a73..36cb9df48 100644
--- a/roles/4-server-options/tasks/main.yml
+++ b/roles/4-server-options/tasks/main.yml
@@ -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
diff --git a/roles/7-edu-apps/meta/main.yml b/roles/7-edu-apps/meta/main.yml
index 25ff2fb28..5af0ff945 100644
--- a/roles/7-edu-apps/meta/main.yml
+++ b/roles/7-edu-apps/meta/main.yml
@@ -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 }
diff --git a/roles/activity-server/tasks/main.yml b/roles/activity-server/tasks/main.yml
index 39d0c06bb..bd7911c3b 100644
--- a/roles/activity-server/tasks/main.yml
+++ b/roles/activity-server/tasks/main.yml
@@ -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
diff --git a/roles/awstats/tasks/install.yml b/roles/awstats/tasks/install.yml
index 71a353880..b2dbeb6af 100644
--- a/roles/awstats/tasks/install.yml
+++ b/roles/awstats/tasks/install.yml
@@ -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
diff --git a/roles/awstats/templates/awstats.schoolserver.conf.j2 b/roles/awstats/templates/awstats.schoolserver.conf.j2
index 0f792f452..d7b6998fe 100644
--- a/roles/awstats/templates/awstats.schoolserver.conf.j2
+++ b/roles/awstats/templates/awstats.schoolserver.conf.j2
@@ -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* |"
diff --git a/roles/calibre/tasks/main.yml b/roles/calibre/tasks/main.yml
index 343dd0314..a4f955a61 100644
--- a/roles/calibre/tasks/main.yml
+++ b/roles/calibre/tasks/main.yml
@@ -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
diff --git a/roles/calibre/templates/calibre-serve.service.j2 b/roles/calibre/templates/calibre-serve.service.j2
index 12d2d45d5..39ad70f01 100644
--- a/roles/calibre/templates/calibre-serve.service.j2
+++ b/roles/calibre/templates/calibre-serve.service.j2
@@ -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 }}
diff --git a/roles/cups/tasks/main.yml b/roles/cups/tasks/main.yml
index 948a45f06..26de7a612 100644
--- a/roles/cups/tasks/main.yml
+++ b/roles/cups/tasks/main.yml
@@ -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 }}
diff --git a/roles/debian_schooltool/tasks/main.yml b/roles/debian_schooltool/tasks/main.yml
index a2ed6b74a..878e28d71 100644
--- a/roles/debian_schooltool/tasks/main.yml
+++ b/roles/debian_schooltool/tasks/main.yml
@@ -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
diff --git a/roles/dokuwiki/tasks/install.yml b/roles/dokuwiki/tasks/install.yml
index 83f09472c..6a3d0a04c 100644
--- a/roles/dokuwiki/tasks/install.yml
+++ b/roles/dokuwiki/tasks/install.yml
@@ -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
diff --git a/roles/ejabberd/tasks/main.yml b/roles/ejabberd/tasks/main.yml
index 32e441eb9..b8fcf0014 100644
--- a/roles/ejabberd/tasks/main.yml
+++ b/roles/ejabberd/tasks/main.yml
@@ -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
diff --git a/roles/elgg/tasks/main.yml b/roles/elgg/tasks/main.yml
index 807916348..cd67c272c 100644
--- a/roles/elgg/tasks/main.yml
+++ b/roles/elgg/tasks/main.yml
@@ -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
diff --git a/roles/httpd/tasks/main.yml b/roles/httpd/tasks/main.yml
index 04958a592..4ac639fce 100644
--- a/roles/httpd/tasks/main.yml
+++ b/roles/httpd/tasks/main.yml
@@ -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 }}
diff --git a/roles/iiab/tasks/main.yml b/roles/iiab/tasks/main.yml
index 0f50b6dc5..9a1e8da26 100644
--- a/roles/iiab/tasks/main.yml
+++ b/roles/iiab/tasks/main.yml
@@ -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 }}'
diff --git a/roles/iiab/templates/iiab.conf.j2 b/roles/iiab/templates/iiab.conf.j2
index bdbe6eafe..14a3e9343 100644
--- a/roles/iiab/templates/iiab.conf.j2
+++ b/roles/iiab/templates/iiab.conf.j2
@@ -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
diff --git a/roles/kiwix/tasks/kiwix_install.yml b/roles/kiwix/tasks/kiwix_install.yml
index 15364235f..33cf42237 100644
--- a/roles/kiwix/tasks/kiwix_install.yml
+++ b/roles/kiwix/tasks/kiwix_install.yml
@@ -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 }}"
diff --git a/roles/monit/tasks/main.yml b/roles/monit/tasks/main.yml
index 96e29f0f8..f14d945e7 100644
--- a/roles/monit/tasks/main.yml
+++ b/roles/monit/tasks/main.yml
@@ -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
diff --git a/roles/moodle-1.9/moodle/templates/moodle-xs.service.in b/roles/moodle-1.9/moodle/templates/moodle-xs.service.in
index 8455e6c1e..ab1f565a6 100755
--- a/roles/moodle-1.9/moodle/templates/moodle-xs.service.in
+++ b/roles/moodle-1.9/moodle/templates/moodle-xs.service.in
@@ -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
diff --git a/roles/moodle/tasks/main.yml b/roles/moodle/tasks/main.yml
index 88e0ab0cd..026432286 100644
--- a/roles/moodle/tasks/main.yml
+++ b/roles/moodle/tasks/main.yml
@@ -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
diff --git a/roles/munin/tasks/main.yml b/roles/munin/tasks/main.yml
index 678d57ea2..b8ec4cd8f 100644
--- a/roles/munin/tasks/main.yml
+++ b/roles/munin/tasks/main.yml
@@ -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
diff --git a/roles/mysql/tasks/main.yml b/roles/mysql/tasks/main.yml
index 08a16bfa3..27241f761 100644
--- a/roles/mysql/tasks/main.yml
+++ b/roles/mysql/tasks/main.yml
@@ -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
diff --git a/roles/network/tasks/avahi.yml b/roles/network/tasks/avahi.yml
index 28b0cfe38..d9af10a94 100644
--- a/roles/network/tasks/avahi.yml
+++ b/roles/network/tasks/avahi.yml
@@ -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
diff --git a/roles/network/tasks/dansguardian.yml b/roles/network/tasks/dansguardian.yml
index 34d8faeb7..fbdfe3413 100644
--- a/roles/network/tasks/dansguardian.yml
+++ b/roles/network/tasks/dansguardian.yml
@@ -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
diff --git a/roles/network/tasks/dhcpd.yml b/roles/network/tasks/dhcpd.yml
index 8f1a8e3eb..bd701e0bd 100644
--- a/roles/network/tasks/dhcpd.yml
+++ b/roles/network/tasks/dhcpd.yml
@@ -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
diff --git a/roles/network/tasks/enable_services.yml b/roles/network/tasks/enable_services.yml
index b6d770b90..54349fe19 100644
--- a/roles/network/tasks/enable_services.yml
+++ b/roles/network/tasks/enable_services.yml
@@ -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 }}
diff --git a/roles/network/tasks/hostapd.yml b/roles/network/tasks/hostapd.yml
index 3872d63a2..42e8bc9e9 100644
--- a/roles/network/tasks/hostapd.yml
+++ b/roles/network/tasks/hostapd.yml
@@ -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
diff --git a/roles/network/tasks/iptables.yml b/roles/network/tasks/iptables.yml
index d0dfea28c..4d2bbc078 100644
--- a/roles/network/tasks/iptables.yml
+++ b/roles/network/tasks/iptables.yml
@@ -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
diff --git a/roles/network/tasks/main.yml b/roles/network/tasks/main.yml
index a5a8f6666..cbfabd9e1 100644
--- a/roles/network/tasks/main.yml
+++ b/roles/network/tasks/main.yml
@@ -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
diff --git a/roles/network/tasks/named.yml b/roles/network/tasks/named.yml
index 523d28474..32f23411b 100644
--- a/roles/network/tasks/named.yml
+++ b/roles/network/tasks/named.yml
@@ -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
diff --git a/roles/network/tasks/restart.yml b/roles/network/tasks/restart.yml
index fc27a3002..9da4537a8 100644
--- a/roles/network/tasks/restart.yml
+++ b/roles/network/tasks/restart.yml
@@ -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
diff --git a/roles/network/templates/gateway/xs-gen-iptables b/roles/network/templates/gateway/xs-gen-iptables
index 887be590e..3be25db89 100755
--- a/roles/network/templates/gateway/xs-gen-iptables
+++ b/roles/network/templates/gateway/xs-gen-iptables
@@ -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
diff --git a/roles/openvpn/tasks/main.yml b/roles/openvpn/tasks/main.yml
index 30fd23627..7a7aeb41f 100644
--- a/roles/openvpn/tasks/main.yml
+++ b/roles/openvpn/tasks/main.yml
@@ -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
diff --git a/roles/openvpn/templates/announcer b/roles/openvpn/templates/announcer
index beff653a8..62f69714a 100755
--- a/roles/openvpn/templates/announcer
+++ b/roles/openvpn/templates/announcer
@@ -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 %}
diff --git a/roles/owncloud/tasks/owncloud_enabled.yml b/roles/owncloud/tasks/owncloud_enabled.yml
index 96ca3c4ff..54892daae 100644
--- a/roles/owncloud/tasks/owncloud_enabled.yml
+++ b/roles/owncloud/tasks/owncloud_enabled.yml
@@ -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
diff --git a/roles/pathagar/tasks/main.yml b/roles/pathagar/tasks/main.yml
index ff29640b2..f758261fb 100644
--- a/roles/pathagar/tasks/main.yml
+++ b/roles/pathagar/tasks/main.yml
@@ -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 }}
diff --git a/roles/phpmyadmin/tasks/main.yml b/roles/phpmyadmin/tasks/main.yml
index 540b0d8f2..60fe922d0 100644
--- a/roles/phpmyadmin/tasks/main.yml
+++ b/roles/phpmyadmin/tasks/main.yml
@@ -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 }}'
diff --git a/roles/postgresql/tasks/main.yml b/roles/postgresql/tasks/main.yml
index 8696efce7..8db8922c6 100644
--- a/roles/postgresql/tasks/main.yml
+++ b/roles/postgresql/tasks/main.yml
@@ -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
diff --git a/roles/postgresql/templates/postgresql-xs.service b/roles/postgresql/templates/postgresql-xs.service
index 87dec0c71..123635054 100644
--- a/roles/postgresql/templates/postgresql-xs.service
+++ b/roles/postgresql/templates/postgresql-xs.service
@@ -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
diff --git a/roles/rachel/tasks/rachel_enabled.yml b/roles/rachel/tasks/rachel_enabled.yml
index 849be1245..518cfc927 100644
--- a/roles/rachel/tasks/rachel_enabled.yml
+++ b/roles/rachel/tasks/rachel_enabled.yml
@@ -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
diff --git a/roles/usb-lib/tasks/main.yml b/roles/usb-lib/tasks/main.yml
index 4b78c5655..eb1fe34ab 100644
--- a/roles/usb-lib/tasks/main.yml
+++ b/roles/usb-lib/tasks/main.yml
@@ -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
diff --git a/roles/usb-lib/templates/umount.d/70-usb-library b/roles/usb-lib/templates/umount.d/70-usb-library
index f5fe2c9c7..7803b880f 100644
--- a/roles/usb-lib/templates/umount.d/70-usb-library
+++ b/roles/usb-lib/templates/umount.d/70-usb-library
@@ -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
diff --git a/roles/wordpress/tasks/install.yml b/roles/wordpress/tasks/install.yml
index 51085ba4d..7bd384dd6 100644
--- a/roles/wordpress/tasks/install.yml
+++ b/roles/wordpress/tasks/install.yml
@@ -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
diff --git a/roles/xsce-admin/tasks/cmdsrv.yml b/roles/xsce-admin/tasks/cmdsrv.yml
index b49ffa022..cb8022e46 100644
--- a/roles/xsce-admin/tasks/cmdsrv.yml
+++ b/roles/xsce-admin/tasks/cmdsrv.yml
@@ -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
diff --git a/roles/xsce-admin/tasks/console.yml b/roles/xsce-admin/tasks/console.yml
index 8c5d39256..c778e967d 100644
--- a/roles/xsce-admin/tasks/console.yml
+++ b/roles/xsce-admin/tasks/console.yml
@@ -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
diff --git a/roles/xsce-admin/templates/cmdsrv/xsce-cmdsrv-init.j2 b/roles/xsce-admin/templates/cmdsrv/xsce-cmdsrv-init.j2
index a1ad21a86..441b0aa67 100644
--- a/roles/xsce-admin/templates/cmdsrv/xsce-cmdsrv-init.j2
+++ b/roles/xsce-admin/templates/cmdsrv/xsce-cmdsrv-init.j2
@@ -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
diff --git a/roles/xsce-admin/templates/cmdsrv/xsce-cmdsrv.service.j2 b/roles/xsce-admin/templates/cmdsrv/xsce-cmdsrv.service.j2
index 4e7b65d99..f01439626 100644
--- a/roles/xsce-admin/templates/cmdsrv/xsce-cmdsrv.service.j2
+++ b/roles/xsce-admin/templates/cmdsrv/xsce-cmdsrv.service.j2
@@ -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
diff --git a/roles/xsce-admin/templates/console/xs-console-ssl.conf.j2 b/roles/xsce-admin/templates/console/xs-console-ssl.conf.j2
index e19df1de3..a5ce4f92a 100644
--- a/roles/xsce-admin/templates/console/xs-console-ssl.conf.j2
+++ b/roles/xsce-admin/templates/console/xs-console-ssl.conf.j2
@@ -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
diff --git a/roles/xsce-admin/templates/console/xs-console.conf.j2 b/roles/xsce-admin/templates/console/xs-console.conf.j2
index 3c20581c8..0a4f5e023 100644
--- a/roles/xsce-admin/templates/console/xs-console.conf.j2
+++ b/roles/xsce-admin/templates/console/xs-console.conf.j2
@@ -8,7 +8,7 @@ Alias /admin "{{ admin_console_path }}"
require valid-user
-{% if is_debian %}
+{% if is_debuntu %}
AddExternalAuth pwauth /usr/sbin/pwauth
SetExternalAuthMethod pwauth pipe
diff --git a/runansible b/runansible
index 8da19f686..22df97de5 100755
--- a/runansible
+++ b/runansible
@@ -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 ]
diff --git a/vars/Fedora.yml b/vars/Fedora.yml
index 660a48bec..c6b9aabde 100644
--- a/vars/Fedora.yml
+++ b/vars/Fedora.yml
@@ -1,6 +1,7 @@
is_debian: false
is_debuntu: false
is_centos: false
+is_redhat: true
dns_service: named
dns_user: named
proxy: squid
diff --git a/vars/OLPC.yml b/vars/OLPC.yml
index 684e86bfc..2b79c60d9 100644
--- a/vars/OLPC.yml
+++ b/vars/OLPC.yml
@@ -1,6 +1,7 @@
is_debian: false
is_debuntu: false
is_centos: false
+is_redhat: true
dns_service: named
dns_user: named
proxy: squid
diff --git a/vars/default_vars.yml b/vars/default_vars.yml
index 01996c64b..5a5845315 100644
--- a/vars/default_vars.yml
+++ b/vars/default_vars.yml
@@ -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"