This commit is contained in:
SebClem 2023-07-21 13:48:49 +02:00
parent a267db1d12
commit e641f84b3e
Signed by: sebclem
GPG Key ID: 5A4308F6A359EA50
4 changed files with 42 additions and 2 deletions

View File

@ -1,3 +1,5 @@
---
# defaults file for Dolibarr
dolibarr_version: 17.0.1
dolibarr_install_dir: "/opt/dolibarr"

View File

@ -1,6 +1,6 @@
- name: Ensure dolibar folder exist
ansible.builtin.file:
path: "/opt/dolibarr"
path: "{{ dolibarr_install_dir }}"
owner: "www-data"
group: "www-data"
mode: "755"
@ -10,8 +10,30 @@
ansible.builtin.unarchive:
remote_src: true
src: "{{ dolibarr_dowload_url }}"
dest: "/opt/dolibarr"
dest: "{{ dolibarr_install_dir }}"
owner: "www-data"
group: "www-data"
extra_opts:
- --strip-components=1
- name: Enable apache modules
community.general.apache2_module:
name: "{{ item }}"
state: present
loop: "{{ dolibarr_apache_modules }}"
- name: Add dolibarr apache site
ansible.builtin.template:
src: dolibarr.conf.j2
dest: /etc/apache2/sites-available/dolibarr.conf
mode: "644"
- name: Disable default site
ansible.builtin.file:
path: "/etc/apache2/sites-enabled/000-default.conf"
- name: Enable dolibarr site
ansible.builtin.file:
path: "/etc/apache2/sites-enabled/dolibarr"
src: "/etc/apache2/sites-available/dolibarr.conf"
state: link

View File

@ -0,0 +1,11 @@
<VirtualHost *:80>
DocumentRoot {{ dolibarr_install_dir }}/htdocs
<Directory /var/www/html/dolibarr/htdocs>
AllowOverride All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.lo
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

View File

@ -21,3 +21,8 @@ dolibarr_apache_dependencies:
- libapache2-mod-php
dolibarr_dowload_url: https://github.com/Dolibarr/dolibarr/archive/refs/tags/{{ dolibarr_version }}.tar.gz
dolibarr_apache_modules:
- headers
- env
- rewrite