2020-05-16 21:51:56 +00:00
|
|
|
- name: "Set 'apache_install: True' and 'apache_enabled: True'"
|
|
|
|
set_fact:
|
|
|
|
apache_install: True
|
|
|
|
apache_enabled: True
|
|
|
|
|
|
|
|
- name: APACHE - run 'httpd' role
|
|
|
|
include_role:
|
|
|
|
name: httpd
|
|
|
|
|
2020-06-15 20:06:43 +00:00
|
|
|
# 2020-06-15: roles/httpd/tasks/install.yml now takes care of this.
|
|
|
|
# # 2020-05-21: Required now that mysql/tasks/install.yml installs
|
|
|
|
# # "php{{ php_version }}-common" rather than the full "php{{ php_version }}"
|
|
|
|
# - name: "Install package: libapache2-mod-php{{ php_version }}"
|
|
|
|
# package:
|
|
|
|
# name: "libapache2-mod-php{{ php_version }}"
|
2020-02-04 20:03:59 +00:00
|
|
|
|
2020-05-16 21:51:56 +00:00
|
|
|
# Assume (enforce?) MySQL is running
|
|
|
|
#
|
2020-02-04 23:19:44 +00:00
|
|
|
# - name: "Set 'mysql_install: True' and 'mysql_enabled: True'"
|
|
|
|
# set_fact:
|
|
|
|
# mysql_install: True
|
|
|
|
# mysql_enabled: True
|
|
|
|
#
|
|
|
|
# - name: MYSQL - run 'mysql' role (attempt to install & enable MySQL)
|
|
|
|
# include_role:
|
|
|
|
# name: mysql
|
2020-02-04 20:03:59 +00:00
|
|
|
|
2019-09-01 08:11:01 +00:00
|
|
|
|
|
|
|
- name: Download {{ iiab_download_url }}/elgg-{{ elgg_version }}.zip to {{ downloads_dir }}
|
|
|
|
#shell: wget {{ iiab_download_url }}/elgg-{{ elgg_version }}.zip -c -P {{ downloads_dir }}
|
|
|
|
#args:
|
|
|
|
# creates: "{{ downloads_dir }}/elgg-{{ elgg_version }}.zip"
|
|
|
|
get_url:
|
|
|
|
url: "{{ iiab_download_url }}/elgg-{{ elgg_version }}.zip"
|
|
|
|
dest: "{{ downloads_dir }}"
|
|
|
|
timeout: "{{ download_timeout }}"
|
2020-10-16 20:46:19 +00:00
|
|
|
when: internet_available
|
2019-09-01 08:11:01 +00:00
|
|
|
|
|
|
|
- name: Check for existence of /opt/elgg-{{ elgg_version }}/index.php
|
|
|
|
stat:
|
|
|
|
path: "/opt/elgg-{{ elgg_version }}/index.php"
|
|
|
|
register: elgg
|
|
|
|
|
|
|
|
- name: Unpack (unarchive) .zip to /opt, if above index.php doesn't exist
|
|
|
|
#shell: "/usr/bin/unzip -o {{ downloads_dir }}/elgg-{{ elgg_version }}.zip -d /opt"
|
|
|
|
unarchive:
|
|
|
|
#remote_src: yes
|
|
|
|
#src: "{{ iiab_download_url }}/elgg-{{ elgg_version }}.zip"
|
|
|
|
src: "{{ downloads_dir }}/elgg-{{ elgg_version }}.zip"
|
|
|
|
dest: /opt
|
|
|
|
owner: "{{ apache_user }}"
|
|
|
|
group: "{{ apache_user }}"
|
|
|
|
when: elgg.stat.exists is defined and not elgg.stat.exists
|
|
|
|
|
|
|
|
- name: Create softlink from /opt/elgg to /opt/elgg-{{ elgg_version }}
|
|
|
|
file:
|
|
|
|
src: "./elgg-{{ elgg_version }}"
|
|
|
|
path: /opt/elgg
|
|
|
|
owner: "{{ apache_user }}"
|
|
|
|
group: "{{ apache_user }}"
|
|
|
|
state: link
|
|
|
|
force: yes
|
|
|
|
|
|
|
|
- name: 'Install /opt/elgg/elgg-config/settings.php from template (WARNING: overwrites manual settings!)'
|
|
|
|
template:
|
|
|
|
src: "settings.php.j2"
|
|
|
|
dest: "/opt/{{ elgg_xx }}/elgg-config/settings.php"
|
|
|
|
owner: "{{ apache_user }}"
|
|
|
|
group: "{{ apache_user }}"
|
|
|
|
|
|
|
|
# The name of this file changed from 1.9 to 1.10.
|
|
|
|
- name: Copy default .htaccess into /opt/{{ elgg_xx }}, root of Elgg tree
|
|
|
|
copy:
|
|
|
|
src: "/opt/{{ elgg_xx }}/vendor/elgg/elgg/install/config/htaccess.dist"
|
|
|
|
dest: "/opt/{{ elgg_xx }}/.htaccess"
|
|
|
|
owner: "{{ apache_user }}"
|
|
|
|
group: "{{ apache_user }}"
|
2020-01-30 09:00:00 +00:00
|
|
|
mode: '0644'
|
2019-09-01 08:11:01 +00:00
|
|
|
|
|
|
|
#regexp='^#RewriteBase'
|
2020-01-12 17:12:49 +00:00
|
|
|
- name: Change .htaccess to include RewriteBase for http://box{{ elgg_url }} # http://box/elgg
|
2019-09-01 08:11:01 +00:00
|
|
|
lineinfile:
|
|
|
|
backup: no
|
|
|
|
path: "/opt/{{ elgg_xx }}/.htaccess"
|
|
|
|
state: present
|
|
|
|
insertafter: '^#RewriteBase'
|
|
|
|
line: "RewriteBase {{ elgg_url }}/"
|
|
|
|
|
|
|
|
- name: Set /opt/elgg/engine directory permissions to 0755 so Apache can write there
|
|
|
|
file:
|
2020-01-30 09:00:00 +00:00
|
|
|
state: directory
|
2019-09-01 08:11:01 +00:00
|
|
|
path: /opt/elgg/engine/
|
|
|
|
owner: "{{ apache_user }}"
|
2020-01-30 09:00:00 +00:00
|
|
|
mode: '0755'
|
2019-09-01 08:11:01 +00:00
|
|
|
|
|
|
|
- name: Change /opt/elgg-{{ elgg_version }} ownership to {{ apache_user }}:{{ apache_user }} (likely not nec, as unarchive & all do this above)
|
|
|
|
file:
|
2020-01-30 09:00:00 +00:00
|
|
|
state: directory # Overkill given recurse below?
|
2019-09-01 08:11:01 +00:00
|
|
|
path: "/opt/elgg-{{ elgg_version }}"
|
|
|
|
owner: "{{ apache_user }}"
|
|
|
|
group: "{{ apache_user }}"
|
|
|
|
recurse: yes
|
|
|
|
|
|
|
|
- name: Create upload directory {{ elgg_upload_path }} that Apache (and Elgg) can write to
|
|
|
|
file:
|
|
|
|
path: "{{ elgg_upload_path }}"
|
|
|
|
state: directory
|
|
|
|
owner: "{{ apache_user }}"
|
|
|
|
|
2020-01-30 09:00:00 +00:00
|
|
|
- name: Install /etc/{{ apache_conf_dir }}/elgg.conf from template, for http://box{{ elgg_url }} # http://box/elgg
|
2019-09-01 08:11:01 +00:00
|
|
|
template:
|
|
|
|
src: elgg.conf
|
2020-01-30 09:00:00 +00:00
|
|
|
dest: "/etc/{{ apache_conf_dir }}/elgg.conf"
|
|
|
|
|
|
|
|
|
2020-02-04 20:03:59 +00:00
|
|
|
- name: Set up Elgg's MySQL database
|
|
|
|
include_tasks: setup.yml
|
|
|
|
|
|
|
|
|
2020-01-30 09:00:00 +00:00
|
|
|
# RECORD Elgg AS INSTALLED
|
|
|
|
|
|
|
|
- name: "Set 'elgg_installed: True'"
|
|
|
|
set_fact:
|
|
|
|
elgg_installed: True
|
2019-09-01 08:11:01 +00:00
|
|
|
|
2020-01-12 23:15:33 +00:00
|
|
|
- name: "Add 'elgg_installed: True' to {{ iiab_state_file }}"
|
2019-09-09 17:14:13 +00:00
|
|
|
lineinfile:
|
2020-02-04 20:03:59 +00:00
|
|
|
path: "{{ iiab_state_file }}" # /etc/iiab/iiab_state.yml
|
2019-09-09 17:14:13 +00:00
|
|
|
regexp: '^elgg_installed'
|
2019-10-07 17:11:21 +00:00
|
|
|
line: 'elgg_installed: True'
|