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

Merge pull request #1271 from holta/ansible-output

Ansible output more consistent/informative across playbooks
This commit is contained in:
A Holt 2018-10-31 04:23:32 -04:00 committed by GitHub
commit c446fee603
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
41 changed files with 403 additions and 402 deletions

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

@ -12,19 +12,19 @@
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

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

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

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

@ -17,7 +17,7 @@
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"
@ -172,7 +172,7 @@
# 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 }}"
@ -231,9 +231,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