generated from sebclem/ansible-role-template
Add site
This commit is contained in:
parent
a267db1d12
commit
e641f84b3e
@ -1,3 +1,5 @@
|
|||||||
---
|
---
|
||||||
# defaults file for Dolibarr
|
# defaults file for Dolibarr
|
||||||
dolibarr_version: 17.0.1
|
dolibarr_version: 17.0.1
|
||||||
|
|
||||||
|
dolibarr_install_dir: "/opt/dolibarr"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
- name: Ensure dolibar folder exist
|
- name: Ensure dolibar folder exist
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "/opt/dolibarr"
|
path: "{{ dolibarr_install_dir }}"
|
||||||
owner: "www-data"
|
owner: "www-data"
|
||||||
group: "www-data"
|
group: "www-data"
|
||||||
mode: "755"
|
mode: "755"
|
||||||
@ -10,8 +10,30 @@
|
|||||||
ansible.builtin.unarchive:
|
ansible.builtin.unarchive:
|
||||||
remote_src: true
|
remote_src: true
|
||||||
src: "{{ dolibarr_dowload_url }}"
|
src: "{{ dolibarr_dowload_url }}"
|
||||||
dest: "/opt/dolibarr"
|
dest: "{{ dolibarr_install_dir }}"
|
||||||
owner: "www-data"
|
owner: "www-data"
|
||||||
group: "www-data"
|
group: "www-data"
|
||||||
extra_opts:
|
extra_opts:
|
||||||
- --strip-components=1
|
- --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
|
||||||
|
11
templates/dolibarr.conf.j2
Normal file
11
templates/dolibarr.conf.j2
Normal 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>
|
@ -21,3 +21,8 @@ dolibarr_apache_dependencies:
|
|||||||
- libapache2-mod-php
|
- libapache2-mod-php
|
||||||
|
|
||||||
dolibarr_dowload_url: https://github.com/Dolibarr/dolibarr/archive/refs/tags/{{ dolibarr_version }}.tar.gz
|
dolibarr_dowload_url: https://github.com/Dolibarr/dolibarr/archive/refs/tags/{{ dolibarr_version }}.tar.gz
|
||||||
|
|
||||||
|
dolibarr_apache_modules:
|
||||||
|
- headers
|
||||||
|
- env
|
||||||
|
- rewrite
|
||||||
|
Loading…
Reference in New Issue
Block a user