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

Update install.yml

This commit is contained in:
A Holt 2018-11-04 01:50:04 -04:00 committed by GitHub
parent 6c0deea8cc
commit 8f94e3373b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,4 @@
- name: Install packages required by Lokole - name: "Install 7 packages for Lokole: python3, python3-pip, python3-venv, python3-dev, libffi-dev, libssl-dev, bcrypt"
apt: apt:
name: name:
- python3 - python3
@ -12,7 +12,7 @@
tags: tags:
- install - install
- name: Install Lokole from PyPI - name: pip install opwen_email_client (Lokole) {{ lokole_version }} from PyPI to {{ lokole_venv }}
pip: pip:
name: opwen_email_client name: opwen_email_client
version: "{{ lokole_version }}" version: "{{ lokole_version }}"
@ -31,21 +31,21 @@
tags: tags:
- install - install
- name: Create run directory - name: Create dir {{ lokole_run_directory }}
file: file:
path: "{{ lokole_run_directory }}" path: "{{ lokole_run_directory }}"
state: directory state: directory
tags: tags:
- configure - configure
- name: Configure Lokole - name: Install {{ lokole_run_directory }}/webapp_secrets.sh from template, to configure Lokole
template: template:
src: webapp_secrets.sh.j2 src: webapp_secrets.sh.j2
dest: "{{ lokole_run_directory }}/webapp_secrets.sh" dest: "{{ lokole_run_directory }}/webapp_secrets.sh"
tags: tags:
- configure - configure
- name: Configure Gunicorn - name: Install {{ lokole_run_directory }}/webapp.sh from template, to configure Gunicorn
template: template:
src: webapp.sh.j2 src: webapp.sh.j2
dest: "{{ lokole_run_directory }}/webapp.sh" dest: "{{ lokole_run_directory }}/webapp.sh"
@ -53,14 +53,14 @@
tags: tags:
- configure - configure
- name: Create 'lokole' service - name: Install unit file /etc/systemd/system/lokole.service from template
template: template:
src: lokole.service.j2 src: lokole.service.j2
dest: /etc/systemd/system/lokole.service dest: /etc/systemd/system/lokole.service
tags: tags:
- systemd - systemd
- name: Enable 'lokole' service - name: Enable & Restart 'lokole' systemd service, with daemon_reload, if lokole_enabled
systemd: systemd:
daemon_reload: yes daemon_reload: yes
name: lokole name: lokole
@ -68,32 +68,38 @@
state: restarted state: restarted
when: lokole_enabled when: lokole_enabled
- name: Disable 'lokole' service - name: Disable 'lokole' service, if not lokole_enabled
systemd: systemd:
name: lokole name: lokole
enabled: no enabled: no
state: stopped state: stopped
when: not lokole_enabled when: not lokole_enabled
- name: Copy lokole httpd conf file - name: Install /etc/{{ apache_config_dir }}/lokole.conf from template, for http://box/lokole
template: template:
src: lokole.conf.j2 src: lokole.conf.j2
dest: "/etc/{{ apache_config_dir }}/lokole.conf" dest: "/etc/{{ apache_config_dir }}/lokole.conf"
- name: Enable httpd conf file if lokole_enabled (debuntu) - name: Symlink /etc/apache2/sites-enabled/lokole.conf to /etc/{{ apache_config_dir }}/lokole.conf, if lokole_enabled (debuntu)
file: file:
src: "/etc/{{ apache_config_dir }}/lokole.conf" src: "/etc/{{ apache_config_dir }}/lokole.conf"
dest: /etc/apache2/sites-enabled/lokole.conf path: /etc/apache2/sites-enabled/lokole.conf
state: link state: link
when: lokole_enabled and is_debuntu when: lokole_enabled and is_debuntu
- name: Remove httpd conf file if we are disabled (OS's other than debuntu) - name: Remove /etc/apache2/sites-enabled/lokole.conf, if not lokole_enabled (debuntu)
file: file:
path: /etc/apache2/sites-enabled/lokole.conf path: /etc/apache2/sites-enabled/lokole.conf
state: absent state: absent
when: not lokole_enabled and is_debuntu when: not lokole_enabled and is_debuntu
- name: Restart Apache, so it picks up the new aliases - name: Remove /etc/{{ apache_config_dir }}/lokole.conf, if not lokole_enabled (OS's other than debuntu)
file:
path: "/etc/{{ apache_config_dir }}/lokole.conf"
state: absent
when: (not lokole_enabled) and (not is_debuntu)
- name: Restart Apache ({{ apache_service }}) to enable/disable http://box/lokole
service: service:
name: "{{ apache_service }}" name: "{{ apache_service }}"
state: restarted state: restarted