conference-website/playbooks/install.yaml

59 lines
1.4 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
- libpq-dev
- nginx
- postgresql-client
- vim
tags:
- deps
- 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 }}"
- name: Creating {{ env_file }}
ansible.builtin.template:
src: templates/dotenv
dest: "{{ env_file }}"
mode: 0644
tags:
- dotenv
- import_tasks: tasks/configure_uwsgi.yaml
- import_tasks: tasks/copy_initial_django_settings.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