- 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: - install - name: Install Lokole from PyPI pip: name: opwen_email_client version: "{{ lokole_version }}" virtualenv: "{{ lokole_venv }}" virtualenv_command: python3 -m venv "{{ lokole_venv }}" tags: - install when: internet_available - name: Create run directory file: path: "{{ lokole_run_directory }}" state: directory - 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: 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 }}"