38 lines
1.5 KiB
YAML
38 lines
1.5 KiB
YAML
---
|
|
- name: Upgrade the mailman, postorius and hyperkitty packages
|
|
block:
|
|
- name: Install the required packages in the mailman virtualenv
|
|
become: True
|
|
become_user: '{{ mailman_user }}'
|
|
pip:
|
|
executable: '{{ mailman_bindir }}/pip3'
|
|
virtualenv_command: '/bin/virtualenv-3'
|
|
virtualenv_site_packages: no
|
|
name: '{{ item.pkg }}'
|
|
extra_args: "{{ item.extra_args | default('') }}"
|
|
state: 'latest'
|
|
editable: no
|
|
with_items: '{{ mailman_pip_packages_to_upgrade }}'
|
|
notify:
|
|
- Restart mailman
|
|
- Restart postorius
|
|
|
|
- name: Remove the postorius static files
|
|
file: dest='{{ mailman_postorius_dir }}/static' state=absent
|
|
|
|
- name: Recreate the postorius static and locale directories
|
|
file: dest='{{ mailman_postorius_dir }}/{{ item }}' state=directory owner={{ mailman_postorius_user }} group={{ mailman_postorius_user }}
|
|
with_items:
|
|
- 'static'
|
|
- 'locale'
|
|
|
|
- name: Setup postorius and hyperkitty
|
|
become_user: '{{ mailman_user }}'
|
|
shell: cd '{{ mailman_postorius_dir }}' && {{ mailman_home }}/{{ mailman_virtualenv_name }}/bin/python3 manage.py migrate && {{ mailman_home }}/{{ mailman_virtualenv_name }}/bin/python3 manage.py compilemessages && {{ mailman_home }}/{{ mailman_virtualenv_name }}/bin/python3 manage.py collectstatic
|
|
args:
|
|
creates: '{{ mailman_postorius_dir }}/static/admin/js/actions.js'
|
|
notify: Restart postorius
|
|
|
|
when: mailman_upgrade_all_the_distribution
|
|
tags: [ 'mailman_upgrade' ]
|