publik-devinst/roles/base/tasks/main.yml

212 lines
4.6 KiB
YAML
Raw Normal View History

2018-01-09 14:30:23 +01:00
---
- name: Install system packages dependencies
2018-01-09 14:30:23 +01:00
apt:
name:
2019-01-03 16:12:17 +01:00
- acl
- gettext
- graphicsmagick
- graphviz
2018-01-26 12:14:09 +01:00
- inkscape
- libjs-leaflet
2018-01-09 14:30:23 +01:00
- libldap2-dev
2019-10-07 17:28:37 +02:00
- libmagic1
2019-10-03 12:44:51 +02:00
- libpq-dev
2018-12-13 14:57:06 +01:00
- libreoffice
2018-01-09 14:30:23 +01:00
- libsasl2-dev
- libssl-dev
- libsystemd-dev
2018-01-26 12:14:09 +01:00
- make
- memcached
2018-01-09 14:30:23 +01:00
- nginx
- pkg-config
- postgresql
2019-10-03 12:44:51 +02:00
- python3-apt
- python3-dev
2019-12-23 14:43:53 +01:00
- python3-lasso
2020-04-02 08:35:40 +02:00
- python3-pip
- python3-psycopg2
- python3-uwsgidecorators
2018-01-09 14:30:23 +01:00
- rabbitmq-server
2019-09-25 16:30:16 +02:00
- sassc
2018-01-09 14:30:23 +01:00
- supervisor
- uwsgi
- uwsgi-plugin-python3
- virtualenv
state: present
2018-01-09 14:30:23 +01:00
become: yes
- name: "create the postgresql user named {{user}}"
postgresql_user:
name: "{{user}}"
role_attr_flags: SUPERUSER,LOGIN
2019-11-25 16:12:46 +01:00
port: "{{postgresql_port}}"
become: yes
become_user: postgres
2020-04-02 08:52:23 +02:00
- name: clean the virtualenv
file:
path: "{{venv_py3}}"
state: absent
when: clean_venv
- name: create the virtualenvs and install django
2018-01-09 14:30:23 +01:00
pip:
name: django
version: "{{django_version}}"
2020-04-02 08:35:40 +02:00
virtualenv: "{{venv_py3}}"
virtualenv_python: "python3"
2018-01-09 14:30:23 +01:00
- name: install django-debug-toolbar
pip:
name: "django-debug-toolbar<3"
2020-04-02 08:35:40 +02:00
virtualenv: "{{venv_py3}}"
2021-08-17 11:24:06 +02:00
- name: install pytest
pip:
name: pytest
virtualenv: "{{venv_py3}}"
- name: "create {{src_dir}} directory"
file:
path: "{{src_dir}}"
state: directory
owner: "{{user}}"
group: "{{user}}"
2018-01-31 11:27:38 +01:00
- name: "create misc directory"
file:
2020-04-02 08:35:40 +02:00
path: "{{venv_py3}}/misc"
2018-01-31 11:27:38 +01:00
state: directory
- name: "create conf directory"
file:
path: "{{publik_conf}}"
state: directory
- name: "create settings directory"
file:
path: "{{publik_settings}}"
state: directory
2018-01-31 11:27:38 +01:00
2021-07-15 13:10:59 +02:00
- name: "create base run directory"
file:
path: "{{base_run_dir}}"
state: directory
- name: create getlasso scripts
2018-01-09 14:30:23 +01:00
template:
src: getlasso.j2
2020-04-02 08:35:40 +02:00
dest: "{{venv_py3_bin}}/getlasso.sh"
2018-01-09 14:30:23 +01:00
mode: "u=rwx,g=rx,o=rx"
vars:
2020-04-02 08:35:40 +02:00
virtualenv_python: "{{venv_py3_python}}"
system_python: "/usr/bin/python3"
2018-01-09 14:30:23 +01:00
- name: execute getlasso
2020-04-02 08:35:40 +02:00
command: "{{venv_py3_bin}}/getlasso.sh"
2018-01-26 12:14:09 +01:00
- name: clean psycopg2 pip installation
ansible.builtin.pip:
name:
- psycopg2-binary
- psycopg2
state: absent
virtualenv: "{{venv_py3}}"
- name: create getpsycopg2 scripts
ansible.builtin.template:
src: getpsycopg2.j2
dest: "{{venv_py3_bin}}/getpsycopg2.sh"
mode: "u=rwx,g=rx,o=rx"
vars:
virtualenv_python: "{{venv_py3_python}}"
- name: execute getpsycopg2
ansible.builtin.command: "{{venv_py3_bin}}/getpsycopg2.sh"
- name: create get-uwsgidecorators scripts
template:
src: get-uwsgidecorators.j2
dest: "{{venv_py3_bin}}/get-uwsgidecorators.sh"
mode: "u=rwx,g=rx,o=rx"
vars:
virtualenv_python: "{{venv_py3_python}}"
system_python: "/usr/bin/python3"
- name: execute get-uwsgidecorators
command: "{{venv_py3_bin}}/get-uwsgidecorators.sh"
- name: source install eopayment
include_tasks: install_source.yml
vars:
repo: "eopayment"
repo_dir: "{{ src_dir }}/eopayment"
virtualenv: "{{venv_py3}}"
- name: source install django-tenant-schemas
include_tasks: install_source.yml
vars:
repo: "debian/django-tenant-schemas"
repo_dir: "{{ src_dir }}/django-tenant-schemas"
2020-04-02 08:35:40 +02:00
virtualenv: "{{venv_py3}}"
- name: source install django-mellon
include_tasks: install_source.yml
vars:
repo: "django-mellon"
repo_dir: "{{ src_dir }}/django-mellon"
2020-04-02 08:35:40 +02:00
virtualenv: "{{venv_py3}}"
- name: source install gadjo
include_tasks: install_source.yml
vars:
repo: "gadjo"
repo_dir: "{{ src_dir }}/gadjo"
2020-04-02 08:35:40 +02:00
virtualenv: "{{venv_py3}}"
- name: install python-memcached
pip:
name: python-memcached
2020-04-02 08:35:40 +02:00
virtualenv: "{{venv_py3}}"
- name: source install django-ckeditor
include_tasks: install_source.yml
vars:
repo: "debian/django-ckeditor"
repo_dir: "{{ src_dir }}/django-ckeditor"
2020-04-02 08:35:40 +02:00
virtualenv: "{{venv_py3}}"
- name: install theme
import_tasks: tasks/install_theme.yml
vars:
src_theme_dir: "{{src_dir}}/{{theme_repo}}"
tags:
- theme
- name: create cert directory
file:
path: "{{certs_dir}}"
state: directory
become: yes
tags:
- tls
- name: Download fullchain.pem
get_url:
url: https://doc-publik.entrouvert.com/media/certificates/dev.publik.love/fullchain.pem
dest: "{{certs_dir}}/dev.publik.love-fullchain.pem"
2019-02-05 14:57:55 +01:00
force: yes
become: yes
tags:
- tls
- name: Download privkey.pem
get_url:
url: https://doc-publik.entrouvert.com/media/certificates/dev.publik.love/privkey.pem
dest: "{{certs_dir}}/dev.publik.love-privkey.pem"
2019-02-05 14:57:55 +01:00
force: yes
become: yes
tags:
- tls