91 lines
1.8 KiB
YAML
91 lines
1.8 KiB
YAML
---
|
|
|
|
- name: Install apt packages
|
|
apt:
|
|
name: '{{ apt_packages }}'
|
|
|
|
- name: Create odoo user
|
|
user:
|
|
name: odoo
|
|
comment: Odoo 14 user
|
|
shell: /bin/bash
|
|
|
|
- name: Prepare folders for Odoo
|
|
file:
|
|
path: '{{ item }}'
|
|
state: directory
|
|
mode: '0755'
|
|
owner: odoo
|
|
loop:
|
|
- /var/log/odoo
|
|
- /opt/odoo
|
|
- /home/odoo/.local/share/Odoo/filestore/agofer
|
|
- /home/odoo/src
|
|
- /etc/odoo
|
|
|
|
- name: Install python packages
|
|
pip:
|
|
virtualenv: /home/odoo/.venv/odoo
|
|
virtualenv_command: python3.8 -m venv
|
|
name: '{{ python_packages }}'
|
|
|
|
- name: Clone current Odoo code
|
|
git:
|
|
repo: '{{ sourcecode_location }}'
|
|
dest: /opt/odoo
|
|
depth: 1
|
|
|
|
- name: Install python requirements for Odoo
|
|
pip:
|
|
virtualenv: /home/odoo/.venv/odoo
|
|
virtualenv_command: python3.8 -m venv
|
|
requirements: '{{ item }}'
|
|
loop:
|
|
- /opt/odoo/core/requirements.txt
|
|
- /opt/odoo/vendor/requirements.txt
|
|
|
|
- name: Download and install wkhtmltopdf
|
|
apt:
|
|
deb: '{{ wkhtmltopdf_location }}'
|
|
|
|
- name: Link wkhtmltopdf scripts
|
|
file:
|
|
dest: '/usr/bin/{{ item }}'
|
|
src: '/usr/local/bin/{{ item }}'
|
|
state: link
|
|
loop:
|
|
- wkhtmltopdf
|
|
- wkhtmltoimage
|
|
|
|
- import_tasks: setup-postgresql.yml
|
|
|
|
# Disable SQL execution until the script has been tested
|
|
# - import_tasks: edit-odoo-settings.yml
|
|
|
|
- import_tasks: setup-nginx.yml
|
|
|
|
- name: Configure Odoo log rotation
|
|
copy:
|
|
src: logrotate
|
|
dest: /etc/logrotate.d/odoo
|
|
mode: '0644'
|
|
|
|
- name: Configure Odoo
|
|
template:
|
|
src: odoo.conf.j2
|
|
dest: /etc/odoo/odoo.conf
|
|
mode: '0640'
|
|
owner: odoo
|
|
group: odoo
|
|
|
|
- copy:
|
|
src: systemd_unit
|
|
dest: /etc/systemd/system/odoo.service
|
|
|
|
- name: Enable and restart Odoo service
|
|
systemd:
|
|
name: odoo
|
|
enabled: true
|
|
state: started
|
|
|