Anna Sirota
ce08b404dd
Upgrading to Python 3.10 lead to the following changes: * Python's builtin `venv` is used instead of `virtualenv`: `python3-virtualenv` is packaged incorrectly making it impossible to use with Python binaries from ppa:deadsnakes, see https://github.com/pre-commit/pre-commit/issues/2211#issuecomment-1013954780 * uWSGI is installed in the venv, the OS-wide uWSGI is no longer used
67 lines
1.8 KiB
YAML
67 lines
1.8 KiB
YAML
---
|
|
- hosts: http
|
|
gather_facts: false
|
|
become: true
|
|
roles: [common]
|
|
tasks:
|
|
- name: Installing required packages
|
|
ansible.builtin.apt: name={{ item }} state=present
|
|
with_items:
|
|
- git
|
|
- libjpeg-turbo-progs
|
|
- libjpeg8-dev
|
|
- libpq-dev
|
|
- libtiff5-dev
|
|
- nginx
|
|
- postgresql-client
|
|
- vim
|
|
- zlib1g-dev
|
|
tags:
|
|
- deps
|
|
|
|
# This is here only because Fund is running on Ubuntu 20.04 currently
|
|
- import_tasks: common/tasks/install_deadsnakes_python.yaml
|
|
|
|
- name: Creating user "{{ user }}:{{ group }}"
|
|
ansible.builtin.user:
|
|
name: "{{ user }}"
|
|
group: "{{ group }}"
|
|
|
|
- import_tasks: common/tasks/add_alias.yaml
|
|
|
|
- name: Creating various directories
|
|
block:
|
|
- ansible.builtin.file: path={{ item }} state=directory owner={{ user }} group={{ group }} recurse=yes
|
|
with_items:
|
|
- "{{ dir.errors }}"
|
|
- "{{ dir.media }}"
|
|
- "{{ dir.source }}"
|
|
- "{{ dir.static }}"
|
|
|
|
# FIXME(anna): creating .env before running deploy doesn't work:
|
|
# it fails because git expects an missing or empty dir.
|
|
# Creating .env after also doesn't work because deploy expects .env.
|
|
# There must a solution to this chicken and egg problem.
|
|
- name: Creating {{ env_file }}
|
|
ansible.builtin.template:
|
|
src: templates/dotenv
|
|
dest: "{{ env_file }}"
|
|
mode: 0644
|
|
backup: true
|
|
tags:
|
|
- dotenv
|
|
|
|
- import_tasks: tasks/configure_uwsgi.yaml
|
|
|
|
- import_tasks: tasks/deploy.yaml
|
|
become: true
|
|
become_user: "{{ user }}"
|
|
|
|
- import_tasks: tasks/configure_nginx.yaml
|
|
tags:
|
|
- nginx
|
|
|
|
- import_tasks: tasks/setup_other_services.yaml
|
|
tags:
|
|
- services
|