mirror of
https://github.com/iiab/iiab.git
synced 2025-02-13 11:42:08 +00:00
117 lines
3 KiB
YAML
117 lines
3 KiB
YAML
- name: Install packages required by Lokole
|
|
apt:
|
|
name: "{{ item }}"
|
|
state: present
|
|
with_items:
|
|
- python3
|
|
- python3-pip
|
|
- python3-venv
|
|
- python3-dev
|
|
- libffi-dev
|
|
- libssl-dev
|
|
- bcrypt
|
|
tags:
|
|
- download
|
|
|
|
- name: Install Lokole from PyPI
|
|
pip:
|
|
name: opwen_email_client
|
|
version: "{{ lokole_version }}"
|
|
virtualenv: "{{ lokole_venv }}"
|
|
virtualenv_program: python3 -m venv "{{ lokole_venv }}"
|
|
tags:
|
|
- download
|
|
when: internet_available
|
|
|
|
- name: Configure Lokole
|
|
template:
|
|
src: webapp_secrets.sh.j2
|
|
dest: "{{ lokole_run_directory }}/webapp_secrets.sh"
|
|
tags:
|
|
- configure
|
|
|
|
# Everything below this line is unused
|
|
|
|
- name: MySQL database needs to be running if we are trying to create a new db
|
|
service:
|
|
state: started
|
|
name: "{{ mysql_service }}"
|
|
|
|
- name: Create MySQL lokole database
|
|
mysql_db:
|
|
name: "{{ lokole_db_name }}"
|
|
state: present
|
|
|
|
- name: Create MySQL lokole database user
|
|
mysql_user:
|
|
name: "{{ lokole_db_user }}"
|
|
password: "{{ lokole_db_user_password }}"
|
|
priv: "{{ lokole_db_name }}.*:ALL,GRANT"
|
|
state: present
|
|
|
|
- name: Configure Lokole
|
|
shell: >
|
|
php '{{ lokole_abs_path }}/maintenance/install.php'
|
|
--dbname={{ lokole_db_name }}
|
|
--dbserver="localhost"
|
|
--installdbuser={{ lokole_db_user }}
|
|
--installdbpass={{ lokole_db_user_password }}
|
|
--dbuser={{ lokole_db_user }}
|
|
--dbpass={{ lokole_db_user_password }}
|
|
--scriptpath=/lokole
|
|
--lang=en
|
|
--pass={{ lokole_admin_user_password }}
|
|
"{{ lokole_site_name }}"
|
|
"{{ lokole_admin_user }}"
|
|
args:
|
|
chdir: "{{ lokole_abs_path }}"
|
|
creates: "{{ lokole_abs_path }}/LocalSettings.php"
|
|
|
|
- name: Copy lokole httpd conf file
|
|
template:
|
|
src: lokole.conf.j2
|
|
dest: "/etc/{{ apache_config_dir }}/lokole.conf"
|
|
|
|
- name: Enable httpd conf file if we are disabled (debuntu)
|
|
file:
|
|
src: /etc/apache2/sites-available/lokole.conf
|
|
dest: /etc/apache2/sites-enabled/lokole.conf
|
|
state: link
|
|
when: lokole_enabled and is_debuntu
|
|
|
|
- name: Remove httpd conf file if we are disabled (OS's other than debuntu)
|
|
file:
|
|
path: /etc/apache2/sites-enabled/lokole.conf
|
|
state: absent
|
|
when: not lokole_enabled and is_debuntu
|
|
|
|
- name: Restart Apache, so it picks up the new aliases
|
|
service:
|
|
name: "{{ apache_service }}"
|
|
state: restarted
|
|
|
|
- name: Add 'lokole' to list of services at /etc/iiab/iiab.ini
|
|
ini_file:
|
|
dest: "{{ service_filelist }}"
|
|
section: lokole
|
|
option: "{{ item.option }}"
|
|
value: "{{ item.value }}"
|
|
with_items:
|
|
- option: name
|
|
value: lokole
|
|
- option: description
|
|
value: '"lokole is an email service."'
|
|
- option: lokole_src
|
|
value: "{{ lokole_src }}"
|
|
- option: lokole_abs_path
|
|
value: "{{ lokole_abs_path }}"
|
|
- option: lokole_db_name
|
|
value: "{{ lokole_db_name }}"
|
|
- option: lokole_db_user
|
|
value: "{{ lokole_db_user }}"
|
|
- option: lokole_url
|
|
value: "{{ lokole_url }}"
|
|
- option: lokole_full_url
|
|
value: "{{ lokole_full_url }}"
|
|
- option: lokole_enabled
|
|
value: "{{ lokole_enabled }}"
|