73 lines
1.7 KiB
YAML
73 lines
1.7 KiB
YAML
---
|
|
- hosts: http
|
|
gather_facts: true
|
|
become: true
|
|
roles: [common]
|
|
vars:
|
|
playbook_type: install
|
|
tasks:
|
|
- name: Installing required packages
|
|
ansible.builtin.apt: name={{ item }} state=present
|
|
with_items:
|
|
- clamav-daemon
|
|
- clamav-unofficial-sigs
|
|
- git
|
|
- libpq-dev
|
|
- nginx-full
|
|
- postfix # to be able to configure /etc/aliases for cron
|
|
- postgresql-client
|
|
- python3.10
|
|
- python3-pip
|
|
- python3.10-venv
|
|
- vim
|
|
tags:
|
|
- deps
|
|
|
|
- name: Creating user "{{ user }}:{{ group }}"
|
|
ansible.builtin.user:
|
|
name: "{{ user }}"
|
|
group: "{{ group }}"
|
|
|
|
- import_tasks: common/tasks/add_alias.yaml
|
|
|
|
- name: Creating various directories
|
|
ansible.builtin.file: path={{ item }} state=directory owner={{ user }} group={{ group }} recurse=yes
|
|
with_items:
|
|
- "{{ dir.errors }}"
|
|
- "{{ dir.media }}"
|
|
- "{{ dir.source }}"
|
|
|
|
- import_tasks: tasks/pull.yaml
|
|
|
|
- name: Creating {{ env_file }}
|
|
ansible.builtin.template:
|
|
src: templates/dotenv
|
|
dest: "{{ env_file }}"
|
|
mode: 0644
|
|
backup: true
|
|
tags:
|
|
- dotenv
|
|
|
|
- name: Copying ASGI config files
|
|
ansible.builtin.template:
|
|
src: "{{ item.src }}"
|
|
dest: "{{ item.dest }}"
|
|
mode: 0644
|
|
loop:
|
|
- { src: templates/asgi/asgi.service, dest: "/etc/systemd/system/{{ service_name }}.service" }
|
|
notify:
|
|
- restart service
|
|
tags:
|
|
- asgi
|
|
- gunicorn
|
|
|
|
- import_tasks: tasks/deploy.yaml
|
|
|
|
- import_tasks: tasks/configure_nginx.yaml
|
|
tags:
|
|
- nginx
|
|
|
|
- import_tasks: tasks/setup_other_services.yaml
|
|
tags:
|
|
- services
|