ansible-dolibarr-role/tasks/install.yml

46 lines
1.1 KiB
YAML
Raw Normal View History

2023-07-21 13:34:12 +02:00
- name: Ensure dolibar folder exist
ansible.builtin.file:
2023-07-21 13:48:49 +02:00
path: "{{ dolibarr_install_dir }}"
2023-07-21 13:34:12 +02:00
owner: "www-data"
group: "www-data"
mode: "755"
state: directory
2023-07-21 13:21:16 +02:00
- name: Download and unzip dolibarr
ansible.builtin.unarchive:
remote_src: true
src: "{{ dolibarr_dowload_url }}"
2023-07-21 13:48:49 +02:00
dest: "{{ dolibarr_install_dir }}"
2023-07-21 13:21:16 +02:00
owner: "www-data"
group: "www-data"
2023-07-21 13:37:56 +02:00
extra_opts:
- --strip-components=1
2023-07-21 13:53:45 +02:00
notify: Restart Apache
2023-07-21 13:48:49 +02:00
- name: Enable apache modules
community.general.apache2_module:
name: "{{ item }}"
state: present
loop: "{{ dolibarr_apache_modules }}"
2023-07-21 13:53:45 +02:00
notify: Restart Apache
2023-07-21 13:48:49 +02:00
- name: Add dolibarr apache site
ansible.builtin.template:
src: dolibarr.conf.j2
dest: /etc/apache2/sites-available/dolibarr.conf
mode: "644"
2023-07-21 13:53:45 +02:00
notify: Restart Apache
2023-07-21 13:48:49 +02:00
- name: Disable default site
ansible.builtin.file:
path: "/etc/apache2/sites-enabled/000-default.conf"
2023-07-21 13:51:41 +02:00
state: absent
2023-07-21 13:53:45 +02:00
notify: Restart Apache
2023-07-21 13:48:49 +02:00
- name: Enable dolibarr site
ansible.builtin.file:
2023-07-21 13:51:41 +02:00
path: "/etc/apache2/sites-enabled/dolibarr.conf"
2023-07-21 13:48:49 +02:00
src: "/etc/apache2/sites-available/dolibarr.conf"
state: link
2023-07-21 13:53:45 +02:00
notify: Restart Apache